// ESAF : Euso Simulation and Analysis Framework // class MacroCellData // these objects are the output from the simulation of a whole // macrocell for an event // M. Pallavicini - created // modified 24/10/2003; trigger implemented as visitor of the class // many trigger algorythms handled independently // #ifndef _MACROCELLDATA_HH_ #define _MACROCELLDATA_HH_ #include #include #include "ChipGtuData.hh" class ChipGtuData; class MacroCellHit; class MacroCell; class MacroCellData { public: // ctor MacroCellData(MacroCell*); // dtor virtual ~MacroCellData(); // add data from front end to macrocell void Add( Int_t, ChipGtuData* ); // simulate Macrocell response for a single GTU void BuildGtu(Int_t); // check if two GTUs have contiguous hits Bool_t CheckContiguity(Int_t gtu1, Int_t gtu2 ); // simulate event response for GTU and trigger // many different trigger algorythms are handled as visitors void SimulateTrigger(); // returns true if a trigger occurred and returns // the gtu number when this happened Bool_t HasTriggered(Int_t& gtu) const {gtu=fGtuTrigger; return (Bool_t)fGtuTrigger;} // pointer to parent MacroCell inline MacroCell* Cell() {return pCell;} // is there any data ? inline Bool_t IsEmpty() const {return fEmpty;} inline void SetEmpty(Bool_t val=kTRUE) {fEmpty=val;} // infos about GTUs inline Int_t GtuStart() const {return fGtuStart;} inline Int_t GtuEnd() const {return fGtuEnd;} inline Int_t GtuTrigger() const {return fGtuTrigger;} inline Int_t NGtus() const {return fNumActiveGtus;} // time in ns of the first edge of the first GTU for this event // the time is measured from the Photons time Double_t GtuTimeStart(); // same for second edge of last GTU Double_t GtuTimeEnd(); // return vector of hits for one gtu; no checks on boundaries vector* Hits(Int_t gtu) {return fData[gtu];} // return point to hit iH for gtu iGtu; no checks on boundaries MacroCellHit* Hit(Int_t iGtu, Int_t iHit) {return ((*fData[iGtu])[iHit]);} // returns total number of MacroCellHit objects Int_t NumMacroCellHits(); // returns the chipgtudata of a chip in a given gtu ChipGtuData* GetChipGtuData(Int_t chip, Int_t gtu); // dump some data on string string& Dump(); private: MacroCell* pCell; // parent macrocell string text_dump; // string used for dump Int_t fGtuStart; // first GTU in which there was activity Int_t fGtuEnd; // last GTU in which there was activity Int_t fGtuTrigger; // GTU in which there was trigger Int_t fNumActiveGtus; // number of GTUs in which there was activity // map of vectors of objects from chips (first index GTU) map* > fChipData; // same as before where first map key is front end chip id and second gtu map* > fChipData2; // map of vectors of macrocell hits (first index GTU) map* > fData; // true if no data are available Bool_t fEmpty; // set gtu at which trigger occurred inline void SetGtuTrigger(Int_t gtu) {if ( gtu < fGtuTrigger) fGtuTrigger = gtu;} ClassDef(MacroCellData,0) friend class ChipTrackingTrgEngine; friend class ChipTrackingTrgEngine0; friend class ChipTrackingTrgEngine1; friend class ChipTrackingTrgEngine2; friend class ChipTrackingTrgEngine3; friend class ChipTrackingTrgEngine4; friend class LblChipTrackingTrgEngine; friend class SignalChipTrackingTrgEngine; }; #endif