#ifndef _TRECONSTRUCT_H_ #define _TRECONSTRUCT_H_ #include "TShowerParams.h" #include "Er.h" /// Basic reconstructor. All reconstructors must inherit from it and implement the Reconstruct() function class TReconstruct: virtual public TShowerParams { public: virtual ~ TReconstruct() {} TErEvent *fErEvent; /// To associate an event to a reconstructor void Associate(TErEvent * ev) { fErEvent = ev; fGPSSecond=ev->RefSecond(); // fill GPS second } /// Reconstructing function. Must be defined in inheriting class virtual bool _Reconstruct() = 0; /// Reconstruction called on an event bool Reconstruct(TErEvent & ev) { Associate(&ev); bool ret = _Reconstruct(); // launch reconstruction ev.fRec = *this; // copy result to event if (ret) ev.fRecError=0; // indicate if rec was successful else ev.fRecError=1; return ret; } }; #endif