#ifndef STNTUPLE_TSiStripBlock #define STNTUPLE_TSiStripBlock //----------------------------------------------------------------------------- // This is a collection of silicon strips in blocks of the same digicode. // // To loop over all the strips in a given detector element (myDigiCode), // you would get the first and last index of the strips in the // TClonesArray with the fIndexFirstHit[myDigiCode] and fIndexLastHit[myDigiCode] // arrays and then fish them out of fSiStripList. // // To make basic plots interactively, you can draw the puffed data // members of the TClonesArray objects (TStnSiStrip). For example, to // draw the ADC value vs strip number for a given digicode: // // STNTUPLE->Draw("fSiStripList.fADC:fSiStripList.fStrip","fSiStripList.fDigiCode==2130","prof") // // Author: Aaron Dominguez (CDF/LBNL) // Date: Oct 19 2001 //----------------------------------------------------------------------------- #include "Stntuple/obj/TStnDataBlock.hh" #include "Stntuple/obj/TStnSiStrip.hh" #include "Stntuple/obj/TStnSiDigiCode.hh" #include "TClonesArray.h" #include "TArrayI.h" class TSiStripBlock: public TStnDataBlock { friend Int_t StntupleInitSiStripBlock(TStnDataBlock* block, AbsEvent* event, int mode); public: //------------------------------------------------------------------------------ // data members //------------------------------------------------------------------------------ Int_t fNSiStrips; // Total number of strips. TClonesArray* fSiStripList; //-> Flat array of strips in // blocks of the same digicode. Int_t *fIndexFirstHit; //![fMaxDigiCode] Used for looping over Int_t *fIndexLastHit; //![fMaxDigiCode] strips in one detector. Short_t *fBEState; //![fMaxDigiCode] Backend state of HDI Short_t *fDtL1A; //![fMaxDigiCode] Time since prev L1A UShort_t fMaxDigiCode; //! Array size for Indexes. Int_t fNDigiCodes; // Number of detector elements with strips. UShort_t *fDigiCodes; //[fNDigiCodes] List of all detector elements with hits. // These three arrays are Int_t *fDigiCodeFirstHit; //[fNDigiCodes] used to puff up the Int_t *fDigiCodeLastHit; //[fNDigiCodes] look-up tables. Char_t *fDigiCodeBEState; //[fNDigiCodes] Use to puff like others Short_t *fDigiCodeDtL1A; //[fNDigiCodes] Bool_t fStreamGeometryInfo; //! Stream geometry of strips Bool_t fInitialized; //! Has InitEvent been called? //----------------------------------------------------------------------------- // functions //----------------------------------------------------------------------------- public: // ****** constructors and destructor TSiStripBlock(); virtual ~TSiStripBlock(); // ****** init methods Int_t InitEvent(Int_t flag=0); // ****** accessors Int_t NSiStrips () { return fNSiStrips; } TClonesArray* SiStripList() { return fSiStripList; } TStnSiStrip* SiStrip(int i) const { return (TStnSiStrip*) fSiStripList->UncheckedAt(i); } Int_t FindStrip(int digi, int stripnum); // Returns the index into the clonesarray // ****** modifiers TStnSiStrip* NewSiStrip() { return new ((*fSiStripList)[fNSiStrips++]) TStnSiStrip(); } // ****** overloaded methods of // TObject void Clear(Option_t* opt=""); void Print(Option_t* opt="") const; ClassDef(TSiStripBlock,3) }; #endif