// ------------------------------------------------------------------------- // ----- Kratta source file ----- // ----- Created 26.01.2012 by S.Kupny ----- // ----- based on class R3BChimera ----- // ------------------------------------------------------------------------- /** Kratta.h **/ #ifndef KRATTA_H #define KRATTA_H #include "R3BDetector.h" #include "TLorentzVector.h" #include "TGeoTube.h" #include "TGeoManager.h" class TClonesArray; class KrattaPoint; class FairVolume; class Kratta : public R3BDetector { public: /** Default constructor **/ Kratta(); /** Standard constructor. *@param name detetcor name *@param active sensitivity flag **/ Kratta(const char* name, Bool_t active); /** Destructor **/ virtual ~Kratta(); /** Virtual method ProcessHits ** ** Defines the action to be taken when a step is inside the ** active volume. Creates a KrattaPoint and adds it to the ** collection. *@param vol Pointer to the active volume **/ virtual Bool_t ProcessHits(FairVolume* vol = 0); /** Virtual method BeginEvent ** If verbosity level is set, print hit collection at the ** end of the event and resets it afterwards. **/ virtual void BeginEvent(); /** Virtual method EndOfEvent ** If verbosity level is set, print hit collection at the ** end of the event and resets it afterwards. **/ virtual void EndOfEvent(); /** Virtual method Register Registers the hit collection in the ROOT manager. **/ virtual void Register(); /** Accessor to the hit collection **/ virtual TClonesArray* GetCollection(Int_t iColl) const; /** Virtual method Print Screen output of hit collection. */ virtual void Print() const; /** Virtual method Reset Clears the hit collection */ virtual void Reset(); /** Virtual method CopyClones ** Copies the hit collection with a given track index offset *@param cl1 Origin *@param cl2 Target *@param offset Index offset **/ virtual void CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset); /** Virtaul method Construct geometry ** Constructs the STS geometry **/ virtual void ConstructGeometry(); virtual void Initialize(); virtual void SetSpecialPhysicsCuts(); void SetEnergyCutOff( Double_t cutE ){ //fCutE = cutE; } Double_t GetEnergyCutOff ( ) { //return fCutE; } // construct detector from .geo file void ConstructASCIIGeometry(){;} // construct detector from .root file void ConstructRootGeometry(); // New Geometry construct by Paolo. Russoto void ConstructMechGeometry(); void ConstructMechGeometryOld(); TGeoVolume * CreateDetector (TGeoManager * geom ); TGeoVolume * CreateCover (TGeoManager * geom, TGeoMedium * A_medForCover ); TGeoVolume * CreatePhotodiodeWithFrame (TGeoManager * geom, TGeoMedium * A_mediumForPhotodiode, TGeoMedium * A_mediumForFrame, TGeoMedium * A_mediumForEmptySpace ); TGeoVolume * CreatePhotodiodeThridWithFrame (TGeoManager * geom, TGeoMedium * A_mediumForPhotodiode, TGeoMedium * A_mediumForFrame, TGeoMedium * A_mediumForEmptySpace ); TGeoVolume * CreateCrystalThin (TGeoManager * geom, TGeoMedium * A_mediumForCrystal, TGeoMedium * A_mediumForReflexFoil, TGeoMedium * A_mediumForMylarFoil, TGeoMedium * A_mediumInEmptySpace ); TGeoVolume * CreateCrystalThick (TGeoManager * geom, TGeoMedium * A_mediumForCrystal, TGeoMedium * A_mediumForReflexFoil, TGeoMedium * A_mediumForMylarFoil, TGeoMedium * A_mediumInEmptySpace ); TGeoVolume * CreatePartitionWall (TGeoManager * geom, TGeoMedium * A_medium, TGeoMedium * A_mediumInEmptySpace ); TGeoVolume * CreateCooperFrontface ( TGeoManager * geom, TGeoMedium * A_medMaterial , TGeoMedium * A_mediumInEmptySpace ); TGeoVolume * CreateDistanceWall ( TGeoManager * geom, TGeoMedium * A_medMaterial , TGeoMedium * A_mediumInEmptySpace ); TGeoVolume * CreateBackWall ( TGeoManager * geom, TGeoMedium * A_medMaterial , TGeoMedium * A_mediumInEmptySpace ); TGeoVolume * CreateSupport ( TGeoManager * geom, TGeoMedium * A_medForSupport, TGeoMedium * A_medForEmptySpace ); TGeoVolume * CreateSupport ( TGeoManager * geom ); // recursively add volumes to the geoManager ///void ExpandNode(TGeoVolume *fVol, TGeoVolume *Cave); // void SaveGeoParams(); private: Double_t fGeoDistanceFromTargetToFirstCrystal; // cm Double_t fGeoModuleAngle; // deg Double_t fGeoColumnAngle; // deg /** Track information to be stored until the track leaves the active volume. **/ Int_t fTrackID; //! track index Int_t fVolumeID; //! volume id TLorentzVector fPosIn, fPosOut; //! position TLorentzVector fMomIn, fMomOut; //! momentum Double32_t fTime; //! time Double32_t fLength; //! length Double32_t fELoss; //! energy loss Double32_t fLightYield; //! light yield Double32_t fSlow; //! slow Double32_t fCutE; //! Sec. Energy Cut-Off Double_t fBirkC0,fBirkC1,fBirkC2; //! Double_t fBirkCS0,fBirkCS1,fBirkCS2; //! Int_t fPosIndex; //! TClonesArray* fKrakowCollection; //! The hit collection Bool_t kGeoSaved; //! TList *flGeoPar; //! /** Private method AddHit ** ** Adds a KrakowPoint to the HitCollection **/ KrattaPoint* AddHit( Int_t trackID, Int_t detID, TVector3 posIn, TVector3 pos_out, TVector3 momIn, TVector3 momOut, Double_t time, Double_t length, Double_t eLoss, Double_t lightYield, Double_t slow); /** Private method ResetParameters ** ** Resets the private members for the track parameters **/ void ResetParameters(); /** container for data points */ TClonesArray *fMyPointCollection; ///same like commented fKrakowCollection (use one of them) ClassDef(Kratta,1); }; inline void Kratta::ResetParameters() { fTrackID = fVolumeID = 0; fPosIn.SetXYZM(0.0, 0.0, 0.0, 0.0); fPosOut.SetXYZM(0.0, 0.0, 0.0, 0.0); fMomIn.SetXYZM(0.0, 0.0, 0.0, 0.0); fMomOut.SetXYZM(0.0, 0.0, 0.0, 0.0); fTime = fLength = fELoss = 0; fLightYield = fSlow = 0; fPosIndex = 0; }; #endif /* !KRATTA_H */