#ifndef PNDMVDSTRIPHITPRODUCER_H #define PNDMVDSTRIPHITPRODUCER_H #include "CbmTask.h" #include "PndMvdStripDigiPar.h" #include "PndMvdGeoMappingPar.h" #include "PndMvdMCPoint.h" #include "PndMvdStrip.h" #include "PndMvdDigiPixel.h" #include "CbmGeoVector.h" #include "CbmGeoTransform.h" #include "TVector3.h" #include "TRandom.h" #include "TGeoMatrix.h" #include "TGeoBBox.h" #include "PndMvdGeoHandling.h" #include #include class TClonesArray; //! Hit Producer Task for strip detectors /** * The choice of the parameters used for Digitisation depends on the invocation of the * different constructors of this task. Instantiating by the default constructor forces * the digitisation parameters initialized from the DigiPar-Database. On the other hand these * parameters may be overridden by invoking the constructor: * @code PndMvdStripHitProducer(Double_t, Double_t, Double_t, Double_t, TVector2, TVector2, * Int_t, Int_t, Int_t, Double_t, Double_t) @endcode \n * Basically, the sensors are thought to be rectangular (even if they are not). * Knowing the origin of the wafer, the strips can be described by an angle (orientation), * their separation with respect to each other (pitch) and one point that is known to be part of the first strip (anchor point).\n * The numbering scheme is as follows (assuming 128 channels per FE): \n *
strip index frontend # side
0 0 top
<- Top Anchor
1 0 top
... 0 top
127 0 top
128 1 top
... 1 top
255 1 top
256 2 top
... ... top
topNrFE*128-1 topNrFE-1 top
topNrFE*128 topNrFE bottom
<- Bottom Anchor
... topNrFE bottom
topNrFE*128+127 topNrFE bottom
topNrFE*128+128 topNrFE+1 bottom
... ... bottom
(topNrFE+botNrFE)*128-1 topNrFE+botNrFE-1 bottom
* \n * The numbering starts from the strip containing the anchor point following the direction * orthogonal to the strips in mathematically positive sense (along x-axis in positive direction, * if the strip orientation equals 90 degrees). * \n * @author HG Zaunick * **/ class PndMvdStripHitProducer : public CbmTask { public: /** Default constructor \n * creates object with parameters taken implicitly from DigiPar-File **/ PndMvdStripHitProducer(); /** * creates object with explicit assignment of Digitisation parameters * * @param topPitch strip pitch on top side (cm) * @param botPitch strip pitch on bottom side (cm) * @param ori Orientation angle of strips on top side (x-y-plane) * @param skew Orientation angle of bottom strips relative to top strips * @param topAnchor Anchor Point on top side. The coordinates of this point are to be in centimeters * from the lower left corner (0,0) of the sensor. * @param botAnchor Anchor Point on bottom side. Same as above * @param nrTopFE number of frontends attached to the top sensor side * @param nrBotFE number of frontends attached to the bottom sensor side * @param nrFECh number of channels of one single frontend * @param threshold charge threshold (electrons) * @param noise equiv. noise charge (electrons) */ PndMvdStripHitProducer(Double_t topPitch, Double_t botPitch, Double_t ori, Double_t skew, TVector2 topAnchor, TVector2 botAnchor, Int_t nrTopFE, Int_t nrBotFE, Int_t nrFECh, Double_t threshold, Double_t noise); /** Destructor **/ virtual ~PndMvdStripHitProducer(); virtual void SetParContainers(); /** Virtual method Init **/ virtual InitStatus Init(); virtual InitStatus ReInit(); /** Virtual method Exec **/ virtual void Exec(Option_t* opt); /** Accessor functions **/ // Double_t GetTopPitch() const {return ftopPitch;} // Double_t GetBotPitch() const {return fbotPitch;} // Double_t GetOrient() const {return forient;} // Double_t GetSkew() const {return fskew;} // TVector2 GetTopAnchor() const {return fTopAnchor;} // TVector2 GetBotAnchor() const {return fBotAnchor;} // Int_t GetNrTopFE() const {return fnrTopFE;} // Int_t GetNrBotFE() const {return fnrBotFE;} // Int_t GetNrFECh() const {return fnrFECh;} // Double_t GetThreshold() const {return fthreshold;} // Double_t GetNoise() const {return fnoise;} private: TString fBranchName; /** Input array of PndMvdMCPoints **/ TClonesArray* fPointArray; //! Output array of PndMvdHits // TClonesArray* fHitArray; //! Array of hit strips TClonesArray* fStripArray; // TClonesArray* fFeStripArray; //! Digitisation Parameters PndMvdStripDigiPar* fDigiPar; PndMvdGeoMappingPar* fGeoMappingPar; void Register(); void Reset(); void ProduceHits(); TGeoHMatrix GetTransformation (std::string detName) const; void GetLocalHitPoints(PndMvdMCPoint* myPoint, CbmGeoVector& myHitIn, CbmGeoVector& myHitOut); TVector3 GetSensorDimensions(std::string detName) const; PndMvdGeoHandling* fGeoH; // converter for detector names Double_t ftopPitch; // strip pitch on top side Double_t fbotPitch; // strip pitch on bottom side Double_t forient; // orientation of top strips Double_t fskew; // skew angle between upper and lower strips TVector2 fTopAnchor; // Anchor Point on top side TVector2 fBotAnchor; // Anchor Point on bottom side Int_t fnrTopFE; // Number of Frontends attached to the top side Int_t fnrBotFE; // Number of Frontends attached to the bottom side Int_t fnrFECh; // Number of channels per frontend-chip Double_t fthreshold; // strip threshold in electrons Double_t fnoise; // strip noise in electrons Bool_t fOverrideParams; // internal Flag that controls use of Parameter Invocations // Int_t stripHits; ClassDef(PndMvdStripHitProducer,5); }; #endif