SND@LHC Software
Loading...
Searching...
No Matches
ecal Class Reference

#include <ecal.h>

Inheritance diagram for ecal:
Collaboration diagram for ecal:

Public Member Functions

 ecal ()
 
 ecal (const char *name, Bool_t active, const char *fileGeo="ecal_Detailed.geo")
 
virtual ~ecal ()
 
virtual Bool_t ProcessHits (FairVolume *vol=NULL)
 
virtual void ConstructGeometry ()
 
virtual void EndOfEvent ()
 
virtual void BeginEvent ()
 
virtual void Reset ()
 
virtual void Print () const
 
virtual void CopyClones (TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
 
virtual void Register ()
 
virtual void ChangeHit (ecalPoint *oldHit=NULL)
 
virtual void FinishPrimary ()
 
virtual void Initialize ()
 
virtual TClonesArray * GetCollection (Int_t iColl) const
 
virtual void SetSpecialPhysicsCuts ()
 

Static Public Member Functions

static Bool_t GetCellCoord (Int_t fVolumeID, Float_t &x, Float_t &y, Int_t &tenergy)
 
static Bool_t GetCellCoordInf (Int_t fVolumeID, Float_t &x, Float_t &y, Int_t &tenergy)
 
static Bool_t GetCellCoordForPy (Int_t fVolID, TVector3 &all)
 

Protected Member Functions

ecalPointAddHit (Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgcode)
 
ecalPointAddLiteHit (Int_t trackID, Int_t detID, Double32_t time, Double32_t eLoss)
 

Private Member Functions

Bool_t FillLitePoint (Int_t volnum)
 
void FillWallPoint ()
 
void ResetParameters ()
 
void SetEcalCuts (Int_t medium)
 
ecalPointFindHit (Int_t VolId, Int_t TrackId)
 
Int_t GetVolType (Int_t volnum)
 
TGeoVolume * ConstructRaw (Int_t number)
 
void ConstructModule (Int_t type)
 
void ConstructCell (Int_t type)
 
void ConstructTile (Int_t type, Int_t material)
 
void ConstructModuleSimple (Int_t type)
 
void ConstructCellSimple (Int_t type)
 
void ConstructTileSimple (Int_t type, Int_t material)
 
Int_t InitMedium (const char *name)
 
void InitMedia ()
 
 ecal (const ecal &)
 
ecaloperator= (const ecal &)
 

Private Attributes

ecalInffInf
 
Option_t * fDebug
 
Int_t fTrackID
 
Int_t fVolumeID
 
TLorentzVector fPos
 
TLorentzVector fMom
 
Double32_t fTime
 
Double32_t fLength
 
Double32_t fELoss
 
Int_t fPosIndex
 
TClonesArray * fEcalCollection
 
TClonesArray * fLiteCollection
 
Float_t fEcalSize [3]
 
Int_t fSimpleGeo
 
Int_t fXSize
 
Int_t fYSize
 
Float_t fDX
 
Float_t fDY
 
Float_t fModuleSize
 
Float_t fZEcal
 
Float_t fSemiX
 
Float_t fSemiY
 
Float_t fThicknessLead
 
Float_t fThicknessScin
 
Float_t fThicknessTyvk
 
Float_t fThicknessLayer
 
Float_t fThicknessSteel
 
Float_t fEdging
 
Float_t fHoleRad
 
Float_t fFiberRad
 
Float_t fXCell [cMaxModuleType]
 
Float_t fYCell [cMaxModuleType]
 
Int_t fNH [cMaxModuleType]
 
Int_t fCF [cMaxModuleType]
 
TString fLightMapNames [cMaxModuleType]
 
ecalLightMapfLightMaps [cMaxModuleType]
 
Int_t fNLayers
 
Float_t fModuleLenght
 
Float_t fGeoScale
 
Int_t fNColumns1
 
Int_t fNRows1
 
Int_t fNColumns2
 
Int_t fNRows2
 
Int_t fNColumns
 
Int_t fNRows
 
Int_t fVolIdMax
 
Int_t fFirstNumber
 
Int_t fVolArr [kNumberOfECALSensitiveVolumes]
 
TGeoVolume * fModules [cMaxModuleType]
 
TGeoVolume * fCells [cMaxModuleType]
 Calorimeter Modules.
 
TGeoVolume * fScTiles [cMaxModuleType]
 Calorimeter Cells.
 
TGeoVolume * fTileEdging [cMaxModuleType]
 Pb tiles.
 
TGeoVolume * fPbTiles [cMaxModuleType]
 Edging of scintillator tiles.
 
TGeoVolume * fTvTiles [cMaxModuleType]
 Scintillator tiles.
 
TGeoVolume * fHoleVol [3]
 Tyvek sheets.
 
TGeoVolume * fFiberVol [3]
 Hole volume.
 
TGeoVolume * fSteelTapes [2]
 Fiber volume.
 
TGeoTranslation ** fHolePos [cMaxModuleType]
 Steel tapes.
 
Int_t fModulesWithType [cMaxModuleType]
 Positions of holes.
 
std::list< std::pair< Int_t, TGeoVolume * > > fRawNumber
 Number of mudules with type.
 
Int_t fStructureId
 List of constructed raws.
 

Detailed Description

Definition at line 32 of file ecal.h.

Constructor & Destructor Documentation

◆ ecal() [1/3]

ecal::ecal ( )

Default constructor

Definition at line 46 of file ecal.cxx.

47 : FairDetector("ECAL", kTRUE, kecal),
48 fInf(NULL),
49 fDebug(NULL),
50 fTrackID(-1),
51 fVolumeID(-1),
52 fPos(),
53 fMom(),
54 fTime(-1.),
55 fLength(-1.),
56 fELoss(-1.),
57 fPosIndex(0),
58 fEcalCollection(new TClonesArray("ecalPoint")),
59 fLiteCollection(new TClonesArray("ecalPoint")),
60 fEcalSize(),
61 fSimpleGeo(0),
62 fXSize(0),
63 fYSize(0),
64 fDX(0.),
65 fDY(0.),
66 fModuleSize(0.),
67 fZEcal(0.),
68 fSemiX(0.),
69 fSemiY(0.),
75 fEdging(0.),
76 fHoleRad(0.),
77 fFiberRad(0.),
78 fXCell(),
79 fYCell(),
80 fNH(),
81 fCF(),
83 fLightMaps(),
84 fNLayers(0),
85 fModuleLenght(0.),
86 fGeoScale(0.),
87 fNColumns1(0),
88 fNRows1(0),
89 fNColumns2(0),
90 fNRows2(0),
91 fNColumns(0),
92 fNRows(0),
93 fVolIdMax(0),
94 fFirstNumber(0),
95 fVolArr(),
96 fModules(),
97 fCells(),
98 fScTiles(),
100 fPbTiles(),
101 fTvTiles(),
102 fHoleVol(),
103 fFiberVol(),
104 fSteelTapes(),
105 fHolePos(),
107 fRawNumber(),
109{
110 fVerboseLevel = 1;
111
112 Int_t i;
113
114 for(i=kN-1;i>-1;i--)
115 fVolArr[i]=-1111;
116}
@ kecal
Double32_t fELoss
Definition ecal.h:130
Int_t fCF[cMaxModuleType]
Definition ecal.h:178
Int_t fYSize
Definition ecal.h:146
Double32_t fLength
Definition ecal.h:128
Float_t fThicknessLayer
Definition ecal.h:164
std::list< std::pair< Int_t, TGeoVolume * > > fRawNumber
Number of mudules with type.
Definition ecal.h:241
Float_t fEdging
Definition ecal.h:168
ecalLightMap * fLightMaps[cMaxModuleType]
Definition ecal.h:182
ecalInf * fInf
Definition ecal.h:110
TGeoVolume * fHoleVol[3]
Tyvek sheets.
Definition ecal.h:236
Int_t fSimpleGeo
Definition ecal.h:143
Option_t * fDebug
Definition ecal.h:111
Float_t fGeoScale
Definition ecal.h:188
Float_t fYCell[cMaxModuleType]
Definition ecal.h:175
Int_t fNColumns2
Definition ecal.h:194
Float_t fSemiY
Definition ecal.h:156
Float_t fThicknessTyvk
Definition ecal.h:162
Int_t fPosIndex
Definition ecal.h:132
Int_t fXSize
Definition ecal.h:145
TClonesArray * fLiteCollection
Definition ecal.h:137
Float_t fModuleSize
Definition ecal.h:151
TGeoVolume * fTileEdging[cMaxModuleType]
Pb tiles.
Definition ecal.h:233
Float_t fFiberRad
Definition ecal.h:172
Float_t fEcalSize[3]
Definition ecal.h:140
TGeoVolume * fSteelTapes[2]
Fiber volume.
Definition ecal.h:238
Float_t fThicknessLead
Definition ecal.h:158
TLorentzVector fMom
Definition ecal.h:124
Int_t fFirstNumber
Definition ecal.h:204
Int_t fVolArr[kNumberOfECALSensitiveVolumes]
Definition ecal.h:213
TGeoTranslation ** fHolePos[cMaxModuleType]
Steel tapes.
Definition ecal.h:239
Int_t fVolumeID
Definition ecal.h:120
Float_t fHoleRad
Definition ecal.h:170
Int_t fNLayers
Definition ecal.h:184
Int_t fNRows
Definition ecal.h:200
Int_t fNRows1
Definition ecal.h:192
Float_t fZEcal
Definition ecal.h:153
Float_t fXCell[cMaxModuleType]
Definition ecal.h:174
TGeoVolume * fCells[cMaxModuleType]
Calorimeter Modules.
Definition ecal.h:231
Float_t fSemiX
Definition ecal.h:155
Int_t fVolIdMax
Definition ecal.h:202
Int_t fNRows2
Definition ecal.h:196
TString fLightMapNames[cMaxModuleType]
Definition ecal.h:180
Float_t fThicknessScin
Definition ecal.h:160
TGeoVolume * fPbTiles[cMaxModuleType]
Edging of scintillator tiles.
Definition ecal.h:234
TGeoVolume * fScTiles[cMaxModuleType]
Calorimeter Cells.
Definition ecal.h:232
Int_t fNH[cMaxModuleType]
Definition ecal.h:177
Double32_t fTime
Definition ecal.h:126
Float_t fThicknessSteel
Definition ecal.h:166
Float_t fModuleLenght
Definition ecal.h:186
TGeoVolume * fTvTiles[cMaxModuleType]
Scintillator tiles.
Definition ecal.h:235
Int_t fStructureId
List of constructed raws.
Definition ecal.h:244
TGeoVolume * fModules[cMaxModuleType]
Definition ecal.h:230
TGeoVolume * fFiberVol[3]
Hole volume.
Definition ecal.h:237
Int_t fNColumns1
Definition ecal.h:190
Float_t fDX
Definition ecal.h:148
Float_t fDY
Definition ecal.h:149
TClonesArray * fEcalCollection
Definition ecal.h:135
Int_t fTrackID
Definition ecal.h:118
Int_t fModulesWithType[cMaxModuleType]
Positions of holes.
Definition ecal.h:240
TLorentzVector fPos
Definition ecal.h:122
Int_t fNColumns
Definition ecal.h:198
#define kN
Definition ecal.cxx:43
int i
Definition ShipAna.py:86

◆ ecal() [2/3]

ecal::ecal ( const char *  name,
Bool_t  active,
const char *  fileGeo = "ecal_Detailed.geo" 
)

Standard constructor.

Parameters
namedetetcor name
activesensitivity flag

ecal constructor: reads geometry parameters from the ascii file <fileGeo>, creates the ECAL geometry container ecalInf and initializes basic geometry parameters needed to construct TGeo geometry

Counting modules

Definition at line 122 of file ecal.cxx.

123 : FairDetector(name, active, kecal),
124 fInf(NULL),
125 fDebug(NULL),
126 fTrackID(-1),
127 fVolumeID(-1),
128 fPos(),
129 fMom(),
130 fTime(-1.),
131 fLength(-1.),
132 fELoss(-1.),
133 fPosIndex(0),
134 fEcalCollection(new TClonesArray("ecalPoint")),
135 fLiteCollection(new TClonesArray("ecalPoint")),
136 fEcalSize(),
137 fSimpleGeo(0),
138 fXSize(0),
139 fYSize(0),
140 fDX(0.),
141 fDY(0.),
142 fModuleSize(0.),
143 fZEcal(0.),
144 fSemiX(0.),
145 fSemiY(0.),
146 fThicknessLead(0.),
147 fThicknessScin(0.),
148 fThicknessTyvk(0.),
149 fThicknessLayer(0.),
150 fThicknessSteel(0.),
151 fEdging(0.),
152 fHoleRad(0.),
153 fFiberRad(0.),
154 fXCell(),
155 fYCell(),
156 fNH(),
157 fCF(),
159 fLightMaps(),
160 fNLayers(0),
161 fModuleLenght(0.),
162 fGeoScale(0.),
163 fNColumns1(0),
164 fNRows1(0),
165 fNColumns2(0),
166 fNRows2(0),
167 fNColumns(0),
168 fNRows(0),
169 fVolIdMax(0),
170 fFirstNumber(0),
171 fVolArr(),
172 fModules(),
173 fCells(),
174 fScTiles(),
175 fTileEdging(),
176 fPbTiles(),
177 fTvTiles(),
178 fHoleVol(),
179 fFiberVol(),
180 fSteelTapes(),
181 fHolePos(),
183 fRawNumber(),
185{
193 fVerboseLevel=0;
194 Int_t i;
195 Int_t j;
196 TString nm;
197 Info("ecal","Geometry is read from file %s.", fileGeo);
198 fInf=ecalInf::GetInstance(fileGeo);
199 if (fInf==NULL)
200 {
201 Fatal("ecal"," Can't read geometry from %s.", fileGeo);
202 return;
203 }
204 fGeoScale=1.;
208
210
215
218
219 fPosIndex=0;
220 fDebug="";
221
222 fSemiX=fInf->GetVariableStrict("xsemiaxis");
223 fSemiY=fInf->GetVariableStrict("ysemiaxis");
224 fHoleRad=fInf->GetVariableStrict("holeradius");
225 fFiberRad=fInf->GetVariableStrict("fiberradius");
227 fEdging=fInf->GetVariableStrict("tileedging");
228 fModuleSize=fInf->GetVariableStrict("modulesize");
229 fSimpleGeo=(Int_t)fInf->GetVariableStrict("usesimplegeo");
230 fDX=fInf->GetVariableStrict("xpos");
231 fDY=fInf->GetVariableStrict("ypos");
232
233 fInf->AddVariable("ecalversion", "1");
234 for(i=kN-1;i>-1;i--)
235 fVolArr[i]=-1111;
236
237
238 for(i=0;i<cMaxModuleType;i++)
239 {
240 fModules[i]=NULL;
241 fCells[i]=NULL;
242 fScTiles[i]=NULL;
243 fPbTiles[i]=NULL;
244 fTvTiles[i]=NULL;
245 fHolePos[i]=NULL;
246 fTileEdging[i]=NULL;
248 fLightMapNames[i]="";
249 fLightMaps[i]=NULL;
250 }
251 for(i=0;i<2;i++)
252 {
253 fSteelTapes[i]=NULL;
254 }
255 for(i=0;i<3;i++)
256 {
257 fHoleVol[i]=NULL;
258 fFiberVol[i]=NULL;
259 }
261 for(i=0;i<fInf->GetXSize();i++)
262 for(j=0;j<fInf->GetYSize();j++)
264
265 for(i=1;i<cMaxModuleType;i++)
266 {
267 if (fModulesWithType[i]==0) continue;
268 nm="cf["; nm+=i; nm+="]";
269 fCF[i]=(Int_t)fInf->GetVariableStrict(nm);
270 nm="nh[";nm+=i; nm+="]";
271 fNH[i]=(Int_t)fInf->GetVariableStrict(nm);
272 nm="lightmap["; nm+=i; nm+="]";
274 if (fLightMapNames[i]!="none")
275 {
277 Info("ecal", "Number of modules of type %d is %d (%d channels), lightmap %s", i, fModulesWithType[i], fModulesWithType[i]*i*i, fLightMapNames[i].Data());
278 }
279 else
280 fLightMaps[i]=NULL;
283 Info("ecal", "Size of cell of type %d is %f cm.", i, fXCell[i]);
284 }
285}
Int_t GetYSize() const
Definition ecalInf.h:46
char GetType(Int_t x, Int_t y) const
Definition ecalInf.h:155
Double_t GetTyveec() const
Definition ecalInf.h:41
Double_t GetZPos() const
Definition ecalInf.h:34
Int_t GetXSize() const
Definition ecalInf.h:45
TString GetStringVariable(const char *key)
Definition ecalInf.cxx:103
Double_t GetScin() const
Definition ecalInf.h:40
void AddVariable(const char *key, const char *value)
Definition ecalInf.cxx:128
Double_t GetVariableStrict(const char *key)
Definition ecalInf.cxx:82
Double_t GetLead() const
Definition ecalInf.h:39
Double_t GetEcalSize(Int_t num) const
Definition ecalInf.h:54
Int_t GetNLayers() const
Definition ecalInf.h:38
static ecalInf * GetInstance(const char *filename)
Definition ecalInf.cxx:35
const Int_t cMaxModuleType
Definition ecal.h:30

◆ ~ecal()

ecal::~ecal ( )
virtual

Destructor

Definition at line 302 of file ecal.cxx.

303{
304 if (fEcalCollection) {
305 fEcalCollection->Delete();
306 delete fEcalCollection;
307 fEcalCollection=NULL;
308 }
309 if (fLiteCollection) {
310 fLiteCollection->Delete();
311 delete fLiteCollection;
312 fLiteCollection=NULL;
313 }
314}

◆ ecal() [3/3]

ecal::ecal ( const ecal )
private

Member Function Documentation

◆ AddHit()

ecalPoint * ecal::AddHit ( Int_t  trackID,
Int_t  detID,
TVector3  pos,
TVector3  mom,
Double_t  time,
Double_t  length,
Double_t  eLoss,
Int_t  pdgcode 
)
protected

Definition at line 829 of file ecal.cxx.

832{
833 TClonesArray& clref = *fEcalCollection;
834 Int_t size = clref.GetEntriesFast();
835 return new(clref[size]) ecalPoint(trackID, detID, pos, mom,
836 time, length, eLoss, pdgcode);
837}

◆ AddLiteHit()

ecalPoint * ecal::AddLiteHit ( Int_t  trackID,
Int_t  detID,
Double32_t  time,
Double32_t  eLoss 
)
protected

Definition at line 841 of file ecal.cxx.

842{
843 TClonesArray& clref = *fLiteCollection;
844 Int_t size = clref.GetEntriesFast();
845 return new(clref[size]) ecalPoint(trackID, detID, time, eLoss);
846}

◆ BeginEvent()

void ecal::BeginEvent ( )
virtual

Definition at line 819 of file ecal.cxx.

820{
821 ;
822}

◆ ChangeHit()

void ecal::ChangeHit ( ecalPoint oldHit = NULL)
virtual

Definition at line 344 of file ecal.cxx.

345{
346 Double_t edep = fELoss;
347 Double_t el=oldHit->GetEnergyLoss();
348 Double_t ttime=gMC->TrackTime()*1.0e9;
349 oldHit->SetEnergyLoss(el+edep);
350 if(ttime<oldHit->GetTime())
351 oldHit->SetTime(ttime);
352}

◆ ConstructCell()

void ecal::ConstructCell ( Int_t  type)
private

Construct a cell with given type

Definition at line 941 of file ecal.cxx.

942{
943 if (fCells[type]!=NULL) return;
944
945 ConstructTile(type, 0);
946 ConstructTile(type, 1);
947 if (fThicknessTyvk>0) ConstructTile(type, 2);
948
950 Int_t i;
951 TString nm="EcalCell"; nm+=type;
952 TString scin="ScTile"; scin+=type; scin+="_edging";
953 TString lead="LeadTile"; lead+=type;
954 TString tyvek="TvTile"; tyvek+=type;
955 Double_t* buf=NULL;
956 Double_t moduleth=thickness*fNLayers;
957 Double_t par[3]={fXCell[type]/2.0+fEdging, fYCell[type]/2.0+fEdging, moduleth/2.0};
958// TGeoVolume* cellv=new TGeoVolumeAssembly(nm);
959 TGeoVolume* cellv=gGeoManager->Volume(nm.Data(),"BOX", gGeoManager->GetMedium("ECALAir")->GetId(), par, 3);
960 for(i=0;i<fNLayers;i++)
961 {
962 gGeoManager->Node(scin.Data(), i+1, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin/2.0+i*thickness, 0, kTRUE, buf, 0);
963 gGeoManager->Node(lead.Data(), i+1, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin+i*thickness+fThicknessTyvk+fThicknessLead/2.0, 0, kTRUE, buf, 0);
964 if (fThicknessTyvk>0.0)
965 {
966 gGeoManager->Node(tyvek.Data(), 2*i+1, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin+i*thickness+1.5*fThicknessTyvk+fThicknessLead, 0, kTRUE, buf, 0);
967 gGeoManager->Node(tyvek.Data(), 2*i+2, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin+i*thickness+0.5*fThicknessTyvk, 0, kTRUE, buf, 0);
968 }
969 }
970 fCells[type]=cellv;
971}
void ConstructTile(Int_t type, Int_t material)
Definition ecal.cxx:1048

◆ ConstructCellSimple()

void ecal::ConstructCellSimple ( Int_t  type)
private

Construct a cell with given type

Definition at line 975 of file ecal.cxx.

976{
977 if (fCells[type]!=NULL) return;
978
979 ConstructTileSimple(type, 0);
980 ConstructTileSimple(type, 1);
981 if (fThicknessTyvk>0) ConstructTileSimple(type, 2);
982
984 Int_t i;
985 TString nm="EcalCell"; nm+=type;
986 TString scin="ScTile"; scin+=type;
987 TString lead="LeadTile"; lead+=type;
988 TString tyvek="TvTile"; tyvek+=type;
989 Double_t* buf=NULL;
990 Double_t moduleth=thickness*fNLayers;
991 Double_t par[3]={fModuleSize/type/2.0, fModuleSize/type/2.0, moduleth/2.0};
992// TGeoVolume* cellv=new TGeoVolumeAssembly(nm);
993 TGeoVolume* cellv=gGeoManager->Volume(nm.Data(),"BOX", gGeoManager->GetMedium("ECALAir")->GetId(), par, 3);
994 for(i=0;i<fNLayers;i++)
995 {
996 gGeoManager->Node(scin.Data(), i+1, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin/2.0+i*thickness, 0, kTRUE, buf, 0);
997 gGeoManager->Node(lead.Data(), i+1, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin+i*thickness+fThicknessTyvk+fThicknessLead/2.0, 0, kTRUE, buf, 0);
998 if (fThicknessTyvk>0.0)
999 {
1000 gGeoManager->Node(tyvek.Data(), 2*i+1, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin+i*thickness+1.5*fThicknessTyvk+fThicknessLead, 0, kTRUE, buf, 0);
1001 gGeoManager->Node(tyvek.Data(), 2*i+2, nm.Data(), 0.0, 0.0, -thickness*fNLayers/2.0+fThicknessScin+i*thickness+0.5*fThicknessTyvk, 0, kTRUE, buf, 0);
1002 }
1003 }
1004 fCells[type]=cellv;
1005}
void ConstructTileSimple(Int_t type, Int_t material)
Definition ecal.cxx:1195

◆ ConstructGeometry()

void ecal::ConstructGeometry ( )
virtual

Virtual method Construct geometry

Constructs the ECAL geometry

Initialize all media

Definition at line 703 of file ecal.cxx.

704{
705 FairGeoLoader*geoLoad = FairGeoLoader::Instance();
706 FairGeoInterface *geoFace = geoLoad->getGeoInterface();
707 FairGeoMedia *Media = geoFace->getMedia();
708 FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
709
710 TGeoVolume *top=gGeoManager->GetTopVolume();
711
712 // cout << top->GetName() << endl;
713 TGeoVolume *volume;
714 FairGeoMedium *CbmMedium;
715 TGeoPgon *spl;
716
717 Float_t *buf = 0;
718 Int_t i;
719 Double_t par[10];
720 Float_t y;
721 TString nm;
723 Double_t moduleth=thickness*fNLayers;
724// Float_t sumWeight;
725// Int_t i;
726
727 // create SensVacuum which is defined in the media file
728
730 InitMedia();
731 par[0]=fSemiX;
732 par[1]=fSemiY;
733 par[2]=moduleth/2.0+0.1;
734 volume=gGeoManager->Volume("Ecal", "BOX", gGeoManager->GetMedium("SensVacuum")->GetId(), par, 3);
735 gGeoManager->Node("Ecal", 1, top->GetName(), 0.0,0.0, fZEcal+par[2]-0.05, 0, kTRUE, buf, 0);
736 volume->SetVisLeaves(kTRUE);
737 volume->SetVisContainers(kFALSE);
738 volume->SetVisibility(kFALSE);
739 AddSensitiveVolume(volume);
740 fStructureId=volume->GetNumber();
741
742 for(i=1;i<cMaxModuleType;i++) {
743 if (fModulesWithType[i]>0) {
744 if (fSimpleGeo==0)
746 else
748 }
749 }
750
751 TGeoVolume* vol=new TGeoVolumeAssembly("EcalStructure");
752//To suppress warring
753 vol->SetMedium(gGeoManager->GetMedium("SensVacuum"));
754 for(i=0;i<fYSize;i++)
755 {
756// cout << i << " " << flush;
757 volume=ConstructRaw(i);
758 if (volume==NULL)
759 {
760// cout << endl;
761 continue;
762 }
763 nm=volume->GetName();
764 y=(i-fYSize/2.0+0.5)*fModuleSize;
765// cout << volume->GetName() << flush;
766 gGeoManager->Node(nm.Data(), i+1, "EcalStructure", 0.0, y, 0.0, 0, kTRUE, buf, 0);
767// cout << endl << flush;
768 }
769//TODO:
770//Should move the guarding volume, not structure itself
771 gGeoManager->Node("EcalStructure", 1, "Ecal", fDX, fDY, 0.0, 0, kTRUE, buf, 0);
772}
void InitMedia()
Definition ecal.cxx:1032
TGeoVolume * ConstructRaw(Int_t number)
Definition ecal.cxx:776
void ConstructModule(Int_t type)
Definition ecal.cxx:850
void ConstructModuleSimple(Int_t type)
Definition ecal.cxx:905

◆ ConstructModule()

void ecal::ConstructModule ( Int_t  type)
private

Construct a module with given type

Definition at line 850 of file ecal.cxx.

851{
852 if (fModules[type]!=NULL) return;
853 ConstructCell(type);
854
855 TString nm="EcalModule"; nm+=type;
856 TString nm1;
857 TString cellname="EcalCell"; cellname+=type;
858 Int_t i;
859 Int_t j;
860 Int_t n;
861 Float_t x;
862 Float_t y;
863 Float_t* buf=NULL;
865 Double_t moduleth=thickness*fNLayers;
866 Double_t par[3]={fModuleSize/2.0, fModuleSize/2.0, moduleth/2.0};
867 if (fSteelTapes[0]==NULL)
868 {
869 TGeoBBox* st1=new TGeoBBox(fThicknessSteel/2.0, fModuleSize/2.0-fThicknessSteel, moduleth/2.0);
870 nm1="EcalModuleSteelTape1_"; //nm1+=type;
871 fSteelTapes[0]=new TGeoVolume(nm1.Data(), st1, gGeoManager->GetMedium("ECALSteel"));
872 }
873 if (fSteelTapes[1]==NULL)
874 {
875 TGeoBBox* st2=new TGeoBBox(fModuleSize/2.0-fThicknessSteel, fThicknessSteel/2.0, moduleth/2.0);
876 nm1="EcalModuleSteelTape2_"; //nm1+=type;
877 fSteelTapes[1]=new TGeoVolume(nm1.Data(), st2, gGeoManager->GetMedium("ECALSteel"));
878 }
879
880
881// TGeoVolume* modulev=new TGeoVolumeAssembly(nm);
882 TGeoVolume* modulev=gGeoManager->Volume(nm.Data(), "BOX", gGeoManager->GetMedium("ECALAir")->GetId(), par, 3);
883 modulev->SetLineColor(kYellow);
884
885 //Adding cells into module
886 for(i=0;i<type;i++)
887 for(j=0;j<type;j++)
888 {
889 x=(i-type/2.0+0.5)*(fXCell[type]+2.0*fEdging);
890 y=(j-type/2.0+0.5)*(fYCell[type]+2.0*fEdging);
891 n=i+j*type+1;
892 gGeoManager->Node(cellname.Data(), n, nm.Data(), x, y, 0.0, 0, kTRUE, buf, 0);
893 }
894 nm1="EcalModuleSteelTape1_"; //nm1+=type;
895 gGeoManager->Node(nm1.Data(), 1, nm.Data(), -fThicknessSteel/2.0+fModuleSize/2.0, 0.0, 0.0, 0, kTRUE, buf, 0);
896 gGeoManager->Node(nm1.Data(), 2, nm.Data(), +fThicknessSteel/2.0-fModuleSize/2.0, 0.0, 0.0, 0, kTRUE, buf, 0);
897 nm1="EcalModuleSteelTape2_"; //nm1+=type;
898 gGeoManager->Node(nm1.Data(), 1, nm.Data(), 0.0, -fThicknessSteel/2.0+fModuleSize/2.0, 0.0, 0, kTRUE, buf, 0);
899 gGeoManager->Node(nm1.Data(), 2, nm.Data(), 0.0, +fThicknessSteel/2.0-fModuleSize/2.0, 0.0, 0, kTRUE, buf, 0);
900 fModuleLenght=moduleth;
901}
void ConstructCell(Int_t type)
Definition ecal.cxx:941

◆ ConstructModuleSimple()

void ecal::ConstructModuleSimple ( Int_t  type)
private

Next method for simplified geometry Construct a module with given type

Definition at line 905 of file ecal.cxx.

906{
907 if (fModules[type]!=NULL) return;
909
910 TString nm="EcalModule"; nm+=type;
911 TString nm1;
912 TString cellname="EcalCell"; cellname+=type;
913 Int_t i;
914 Int_t j;
915 Int_t n;
916 Float_t x;
917 Float_t y;
918 Float_t* buf=NULL;
920 Double_t moduleth=thickness*fNLayers;
921 Double_t par[3]={fModuleSize/2.0, fModuleSize/2.0, moduleth/2.0};
922
923// TGeoVolume* modulev=new TGeoVolumeAssembly(nm);
924 TGeoVolume* modulev=gGeoManager->Volume(nm.Data(), "BOX", gGeoManager->GetMedium("ECALAir")->GetId(), par, 3);
925 modulev->SetLineColor(kYellow);
926
927 //Adding cells into module
928 for(i=0;i<type;i++)
929 for(j=0;j<type;j++)
930 {
931 x=(i-type/2.0+0.5)*fModuleSize/type;
932 y=(j-type/2.0+0.5)*fModuleSize/type;
933 n=i+j*type+1;
934 gGeoManager->Node(cellname.Data(), n, nm.Data(), x, y, 0.0, 0, kTRUE, buf, 0);
935 }
936 fModuleLenght=moduleth;
937}
void ConstructCellSimple(Int_t type)
Definition ecal.cxx:975

◆ ConstructRaw()

TGeoVolume * ecal::ConstructRaw ( Int_t  number)
private

Construct a raw of modules

Definition at line 776 of file ecal.cxx.

777{
778 Int_t i;
779 list<pair<Int_t, TGeoVolume*> >::const_iterator p=fRawNumber.begin();
780 pair<Int_t, TGeoVolume*> out;
781 Float_t x;
782 Float_t* buf=NULL;
783 for(i=0;i<fXSize;i++)
784 if ((Int_t)fInf->GetType(i, num)!=0) break;
785 if (i==fXSize)
786 return NULL;
787 for(;p!=fRawNumber.end();++p)
788 {
789 for(i=0;i<fXSize;i++)
790 if (fInf->GetType(i, num)!=fInf->GetType(i, (*p).first))
791 break;
792 if (i==fXSize)
793 break;
794 }
795 if (p!=fRawNumber.end())
796 return (*p).second;
797 TString nm="ECALRaw"; nm+=num;
798 TString md;
799 TGeoVolume* vol=new TGeoVolumeAssembly(nm);
800//To suppress warring
801 vol->SetMedium(gGeoManager->GetMedium("SensVacuum"));
802 for(i=0;i<fXSize;i++)
803 {
804 x=(i-fXSize/2.0+0.5)*fModuleSize;
805 if (fInf->GetType(i, num)==0) continue;
806 md="EcalModule"; md+=(Int_t)fInf->GetType(i, num);
807 gGeoManager->Node(md.Data(),i+1, nm.Data(), x, 0.0, 0.0, 0, kTRUE, buf, 0);
808 }
809
810 out.first=num;
811 out.second=vol;
812 fRawNumber.push_back(out);
813 return out.second;
814}

◆ ConstructTile()

void ecal::ConstructTile ( Int_t  type,
Int_t  material 
)
private

Construct a tile with given type

Building tile

Adding edging to scintillator

Definition at line 1048 of file ecal.cxx.

1049{
1050 switch (material)
1051 {
1052 case 0: if (fScTiles[type]!=NULL) return; break;
1053 case 1: if (fPbTiles[type]!=NULL) return; break;
1054 case 2: if (fTvTiles[type]!=NULL) return; break;
1055 default: Error("ConstructTile", "Can't construct a tile of type %d.", material);
1056 }
1057 Double_t thickness;
1058 TGeoVolume* hole;
1059 TGeoVolume* fiber;
1060 TGeoTranslation** tr;
1061 TGeoTranslation* tm;
1062 Int_t nh=fNH[type];
1063 Int_t i;
1064 Int_t j;
1065 TString nm;
1066 TString nm1;
1067 TString nm2;
1068 TString medium;
1069 Double_t x;
1070 Double_t y;
1071 TGeoBBox* tile;
1072 TGeoVolume* tilev;
1073 TGeoBBox* edging;
1074 TGeoVolume* edgingv;
1075 Double_t* buf=NULL;
1076
1077 switch (material)
1078 {
1079 case 0: thickness=fThicknessScin/2.0; break;
1080 case 1: thickness=fThicknessLead/2.0; break;
1081 case 2: thickness=fThicknessTyvk/2.0; break;
1082 default: Error("ConstructTile", "Can't construct a tile of type %d.", material);
1083 }
1084
1085 if (thickness<=0.0) return;
1086 // Holes in the tiles
1087 if (fHoleRad>0)
1088 {
1089 nm1="ECALHole_"; nm1+=material;
1090 nm2="ECALFiber_"; nm2+=material;
1091 if (fHoleVol[material]==NULL)
1092 {
1093 TGeoTube* holetube=new TGeoTube(0, fHoleRad, thickness);
1094 fHoleVol[material]=new TGeoVolume(nm1.Data(), holetube, gGeoManager->GetMedium("ECALAir"));
1095 }
1096 hole=fHoleVol[material];
1097 // Fibers in holes
1098 if (fFiberRad>0)
1099 {
1100 if (fFiberVol[material]==NULL)
1101 {
1102 TGeoTube* fibertube=new TGeoTube(0, fFiberRad, thickness);
1103 fFiberVol[material]=new TGeoVolume(nm2.Data(), fibertube, gGeoManager->GetMedium("ECALFiber"));
1104 gGeoManager->Node(nm2.Data(), 1, nm1.Data(), 0.0, 0.0, 0.0, 0, kTRUE, buf, 0);
1105 }
1106 fiber=fFiberVol[material];
1107 // TODO: Cerenkoff !!!
1108 //AddSensitiveVolume(fiber);
1109 }
1110 }
1111/*
1112 if (fHolePos[type]==NULL)
1113 {
1114 tr=new TGeoTranslation*[nh*nh];
1115 for(i=0;i<nh;i++)
1116 for(j=0;j<nh;j++)
1117 {
1118 nm="sh"; nm+=type; nm+="_"; nm+=j*nh+i;
1119 x=(i-nh/2+0.5)*fXCell[type]/nh;
1120 y=(j-nh/2+0.5)*fYCell[type]/nh;
1121
1122
1123 tm=new TGeoTranslation(nm, x, y, 0);
1124 gGeoManager->AddTransformation(tm);
1125 tr[j*nh+i]=tm;
1126 }
1127 fHolePos[type]=tr;
1128 }
1129 tr=fHolePos[type];
1130*/
1132 switch (material)
1133 {
1134 case 0: nm="ScTile"; medium="Scintillator"; break;
1135 case 1: nm="LeadTile"; medium="Lead"; break;
1136 case 2: nm="TvTile"; medium="Tyvek"; break;
1137 default: Error("ConstructTile", "Can't construct a tile of type %d.", material);
1138 }
1139
1140 nm+=type;
1141 if (material==0)
1142 tile=new TGeoBBox(fXCell[type]/2.0, fYCell[type]/2.0, thickness);
1143 else
1144 tile=new TGeoBBox(fXCell[type]/2.0+fEdging, fYCell[type]/2.0+fEdging, thickness);
1145 tilev=new TGeoVolume(nm, tile, gGeoManager->GetMedium(medium));
1146 if (fHoleRad>0)
1147 {
1148 nm1="ECALHole_"; nm1+=material;
1149 for(i=0;i<nh;i++)
1150 for(j=0;j<nh;j++)
1151 {
1152 x=(i-nh/2+0.5)*fXCell[type]/nh;
1153 y=(j-nh/2+0.5)*fYCell[type]/nh;
1154 gGeoManager->Node(nm1.Data(), j*nh+i+1, nm.Data(), x, y, 0.0, 0, kTRUE, buf, 0);
1155 }
1156 // clear fiber
1157 if (nh%2==0&&fCF[type]!=0)
1158 gGeoManager->Node(nm1.Data(), j*nh+i+1, nm.Data(), 0.0, 0.0, 0.0, 0, kTRUE, buf, 0);
1159
1160 }
1161/*
1162 if (fHoleRad>0)
1163 {
1164 for(i=0;i<nh;i++)
1165 for(j=0;j<nh;j++)
1166 tilev->AddNode(hole, j*nh+i+1, tr[j*nh+i]);
1167 // Clear Fiber
1168 if (nh%2==0)
1169 tilev->AddNode(hole, j*nh+i+1);
1170 }
1171*/
1173 if (material==0)
1174 {
1175 AddSensitiveVolume(tilev);
1176 edging=new TGeoBBox(fXCell[type]/2.0+fEdging, fYCell[type]/2.0+fEdging, thickness);
1177
1178 edgingv=new TGeoVolume(nm+"_edging", edging, gGeoManager->GetMedium("ECALTileEdging"));
1179 edgingv->AddNode(tilev, 1);
1180 fScTiles[cMaxModuleType-1]=tilev;
1181 fTileEdging[cMaxModuleType-1]=edgingv;
1182 }
1183 else
1184 {
1185 if (material==1) //Lead
1186 fPbTiles[type]=tilev;
1187 else
1188 fTvTiles[type]=tilev;
1189 return;
1190 }
1191}

◆ ConstructTileSimple()

void ecal::ConstructTileSimple ( Int_t  type,
Int_t  material 
)
private

Construct a tile with given type

Building tile

Adding edging to scintillator

Definition at line 1195 of file ecal.cxx.

1196{
1197 switch (material)
1198 {
1199 case 0: if (fScTiles[type]!=NULL) return; break;
1200 case 1: if (fPbTiles[type]!=NULL) return; break;
1201 case 2: if (fTvTiles[type]!=NULL) return; break;
1202 default: Error("ConstructTileSimple", "Can't construct a tile of type %d.", material);
1203 }
1204 Double_t thickness;
1205 TGeoVolume* hole;
1206 TGeoVolume* fiber;
1207 TGeoTranslation** tr;
1208 TGeoTranslation* tm;
1209 Int_t nh=fNH[type];
1210 Int_t i;
1211 Int_t j;
1212 TString nm;
1213 TString nm1;
1214 TString nm2;
1215 TString medium;
1216 Double_t x;
1217 Double_t y;
1218 TGeoBBox* tile;
1219 TGeoVolume* tilev;
1220 TGeoBBox* edging;
1221 TGeoVolume* edgingv;
1222 Double_t* buf=NULL;
1223
1224 switch (material)
1225 {
1226 case 0: thickness=fThicknessScin/2.0; break;
1227 case 1: thickness=fThicknessLead/2.0; break;
1228 case 2: thickness=fThicknessTyvk/2.0; break;
1229 default: Error("ConstructTile", "Can't construct a tile of type %d.", material);
1230 }
1231
1232 if (thickness<=0.0) return;
1234 switch (material)
1235 {
1236 case 0: nm="ScTile"; medium="Scintillator"; break;
1237 case 1: nm="LeadTile"; medium="Lead"; break;
1238 case 2: nm="TvTile"; medium="Tyvek"; break;
1239 default: Error("ConstructTile", "Can't construct a tile of type %d.", material);
1240 }
1241
1242 nm+=type;
1243 tile=new TGeoBBox(fModuleSize/type/2.0, fModuleSize/type/2.0, thickness);
1244 tilev=new TGeoVolume(nm, tile, gGeoManager->GetMedium(medium));
1246 if (material==0)
1247 {
1248 AddSensitiveVolume(tilev);
1249 fScTiles[cMaxModuleType-1]=tilev;
1250 fTileEdging[cMaxModuleType-1]=tilev;
1251 }
1252 else
1253 {
1254 if (material==1) //Lead
1255 fPbTiles[type]=tilev;
1256 else
1257 fTvTiles[type]=tilev;
1258 return;
1259 }
1260}

◆ CopyClones()

void ecal::CopyClones ( TClonesArray *  cl1,
TClonesArray *  cl2,
Int_t  offset 
)
virtual

Definition at line 659 of file ecal.cxx.

660{
661 Int_t nEntries = cl1->GetEntriesFast();
662 Int_t i;
663 Int_t index;
664 cout << "-I- ecal: " << nEntries << " entries to add." << endl;
665 TClonesArray& clref = *cl2;
666 if (cl1->GetClass()==ecalPoint::Class()) {
667 ecalPoint* oldpoint = NULL;
668 for (i=0; i<nEntries; i++) {
669 oldpoint = (ecalPoint*) cl1->At(i);
670 index = oldpoint->GetTrackID()+offset;
671 oldpoint->SetTrackID(index);
672 new (clref[fPosIndex]) ecalPoint(*oldpoint);
673 fPosIndex++;
674 }
675 cout << "-I- ecal: " << cl2->GetEntriesFast() << " merged entries."
676 << endl;
677 }
678 else if (cl1->GetClass()==ecalPoint::Class()) {
679 ecalPoint* oldpoint = NULL;
680 for (i=0; i<nEntries; i++) {
681 oldpoint = (ecalPoint*) cl1->At(i);
682 index = oldpoint->GetTrackID()+offset;
683 oldpoint->SetTrackID(index);
684 new (clref[fPosIndex]) ecalPoint(*oldpoint);
685 fPosIndex++;
686 }
687 cout << "-I- ecal: " << cl2->GetEntriesFast() << " merged entries."
688 << endl;
689 }
690}

◆ EndOfEvent()

void ecal::EndOfEvent ( )
virtual

Definition at line 605 of file ecal.cxx.

605 {
606 if (fVerboseLevel) Print();
607 fEcalCollection->Clear();
608
609 fLiteCollection->Clear();
610 fPosIndex = 0;
611 fFirstNumber=0;
612}
virtual void Print() const
Definition ecal.cxx:635

◆ FillLitePoint()

Bool_t ecal::FillLitePoint ( Int_t  volnum)
private

Fill MC points inside the ECAL for non-zero deposited energy

Need to rewrite this part

Definition at line 564 of file ecal.cxx.

565{
568 //Search for input track
569
570 static Float_t zmin=fZEcal-0.0001;
571 static Float_t zmax=fZEcal+fEcalSize[2];
572 static Float_t xecal=fEcalSize[0]/2;
573 static Float_t yecal=fEcalSize[1]/2;
574 TParticle* part=gMC->GetStack()->GetCurrentTrack();
575 fTrackID=gMC->GetStack()->GetCurrentTrackNumber();
576
577// cout << zmin << " : " << zmax << " : " << xecal << ", " << yecal << endl;
578// cout << part->GetFirstMother() << " : " << part->Vx() << ", " << part->Vy() << ", " << part->Vz() << endl;
580 while (part->GetFirstMother()>=0&&part->Vz()>=zmin&&part->Vz()<=zmax&&TMath::Abs(part->Vx())<=xecal&&TMath::Abs(part->Vy())<=yecal)
581 {
582 fTrackID=part->GetFirstMother();
583 part =((ShipStack*)gMC->GetStack())->GetParticle(fTrackID);
584// cout << "-> " << part->GetFirstMother() << " : " << part->Vx() << ", " << part->Vy() << ", " << part->Vz() << endl;
585 }
586// if (part->Vz()>500)
587// cout << part->Vx() << ", " << part->Vy() << ", " << part->Vz() << endl;
588#ifdef _DECAL
589 if (fTrackID<0) cout<<"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!fTrackID="<<fTrackID<<endl;
590#endif
591 ecalPoint* oldHit;
592 ecalPoint* newHit;
593
594 if ((oldHit=FindHit(fVolumeID,fTrackID))!=NULL)
595 ChangeHit(oldHit);
596 else
597 // Create ecalPoint for scintillator volumes
599
600
601 return kTRUE;
602}
virtual void ChangeHit(ecalPoint *oldHit=NULL)
Definition ecal.cxx:344
ecalPoint * AddLiteHit(Int_t trackID, Int_t detID, Double32_t time, Double32_t eLoss)
Definition ecal.cxx:841
ecalPoint * FindHit(Int_t VolId, Int_t TrackId)
Definition ecal.cxx:553

◆ FillWallPoint()

void ecal::FillWallPoint ( )
private

Fill MC points on the ECAL front wall

Definition at line 527 of file ecal.cxx.

528{
531 gMC->TrackPosition(fPos);
532 gMC->TrackMomentum(fMom);
533 fVolumeID = -1;
534 Double_t mass = gMC->TrackMass();
535 // Calculate kinetic energy
536 Double_t ekin = TMath::Sqrt( fMom.Px()*fMom.Px() +
537 fMom.Py()*fMom.Py() +
538 fMom.Pz()*fMom.Pz() +
539 mass * mass ) - mass;
540 fELoss = ekin;
541 // Create ecalPoint at the entrance of calorimeter
542 // for particles with pz>0 coming through the front wall
543 if (fMom.Pz() > 0 && fPos.Z() < fZEcal+0.01)
544 {
545 TParticle* part=((ShipStack*)gMC->GetStack())->GetParticle(fTrackID);
546 AddHit(fTrackID, fVolumeID, TVector3(fPos.X(), fPos.Y(), fPos.Z()),
547 TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength,
548 fELoss, part->GetPdgCode());
549 }
550 fTrackID=gMC->GetStack()->GetCurrentTrackNumber();
551}
ecalPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgcode)
Definition ecal.cxx:829
mass(particle)
Definition hnl.py:47

◆ FindHit()

ecalPoint * ecal::FindHit ( Int_t  VolId,
Int_t  TrackId 
)
private

Definition at line 553 of file ecal.cxx.

554{
555 for(Int_t i=fFirstNumber;i<fLiteCollection->GetEntriesFast();i++)
556 {
557 ecalPoint* point=(ecalPoint*)fLiteCollection->At(i);
558 if (point->GetTrackID()==TrackId&&point->GetDetectorID()==VolId)
559 return point;
560 }
561 return NULL;
562}

◆ FinishPrimary()

void ecal::FinishPrimary ( )
virtual

Definition at line 338 of file ecal.cxx.

339{
340 fFirstNumber=fLiteCollection->GetEntriesFast();
341}

◆ GetCellCoord()

Bool_t ecal::GetCellCoord ( Int_t  fVolumeID,
Float_t &  x,
Float_t &  y,
Int_t &  tenergy 
)
static

Get cell coordinates according to parameter container

Definition at line 1299 of file ecal.cxx.

1300{
1301 return GetCellCoordInf(fVolID, x, y, tenergy);
1302}
static Bool_t GetCellCoordInf(Int_t fVolumeID, Float_t &x, Float_t &y, Int_t &tenergy)
Definition ecal.cxx:1264

◆ GetCellCoordForPy()

Bool_t ecal::GetCellCoordForPy ( Int_t  fVolID,
TVector3 &  all 
)
static

Definition at line 1304 of file ecal.cxx.

1305{
1306 Float_t x,y;
1307 Int_t tenergy;
1308 Bool_t rc = GetCellCoordInf(fVolID, x, y, tenergy);
1309 static ecalInf* inf=NULL;
1310 if (inf==NULL)
1311 {
1312 inf=ecalInf::GetInstance(NULL);
1313 if (inf==NULL)
1314 {
1315 cerr << "ecal::GetCellCoordInf(): Can't get geometry information." << endl;
1316 return kFALSE;
1317 }
1318 }
1319 all=TVector3(x,y,inf->GetZPos());
1320 return kTRUE;
1321}

◆ GetCellCoordInf()

Bool_t ecal::GetCellCoordInf ( Int_t  fVolumeID,
Float_t &  x,
Float_t &  y,
Int_t &  tenergy 
)
static

Get cell coordinates according to current ecalInf

Definition at line 1264 of file ecal.cxx.

1265{
1266 static ecalInf* inf=NULL;
1267 if (inf==NULL)
1268 {
1269 inf=ecalInf::GetInstance(NULL);
1270 if (inf==NULL)
1271 {
1272 cerr << "ecal::GetCellCoordInf(): Can't get geometry information." << endl;
1273 return kFALSE;
1274 }
1275 }
1276 Int_t volid=fVolID;
1277 Int_t cell=volid%100-1; volid=volid-cell-1; volid/=100;
1278 Int_t mx=volid%100; volid-=mx; volid/=100;
1279 Int_t my=volid%100; volid-=my; volid/=100;
1280 Int_t type=inf->GetType(mx, my);
1281 Int_t cx=cell%type;
1282 Int_t cy=cell/type;
1283// cout << "->" << mx << ", " << my << ", " << cell << endl;
1284 static Float_t modulesize=inf->GetVariableStrict("modulesize");
1285 static Float_t xcalosize=inf->GetEcalSize(0);
1286 static Float_t ycalosize=inf->GetEcalSize(1);
1287 static Float_t dx=inf->GetVariableStrict("xpos");
1288 static Float_t dy=inf->GetVariableStrict("ypos");
1289 x=mx*modulesize-xcalosize/2.0+cx*modulesize/type+1.0; x+=dx;
1290 y=my*modulesize-ycalosize/2.0+cy*modulesize/type+1.0; y+=dy;
1291 tenergy=0;
1292
1293// cerr << fVolID << " --- " << x << ", " << y << endl;
1294 return kFALSE;
1295}

◆ GetCollection()

TClonesArray * ecal::GetCollection ( Int_t  iColl) const
virtual

Accessor to the hit collection

Definition at line 616 of file ecal.cxx.

617{
618 if (iColl == 0) return fEcalCollection;
619 if (iColl == 1) return fLiteCollection;
620 else return NULL;
621}

◆ GetVolType()

Int_t ecal::GetVolType ( Int_t  volnum)
private

returns type of volume

Definition at line 516 of file ecal.cxx.

517{
518 Int_t i;
519 for(i=kN-1;i>-1;i--) {
520 if (fVolArr[i]==volnum) break;
521 }
522
523 return i;
524}

◆ Initialize()

void ecal::Initialize ( )
virtual

Definition at line 289 of file ecal.cxx.

290{
291 FairDetector::Initialize();
292/*
293 FairRun* sim = FairRun::Instance();
294 FairRuntimeDb* rtdb=sim->GetRuntimeDb();
295 CbmGeoEcalPar *par=new CbmGeoEcalPar();
296// fInf->FillGeoPar(par,0);
297 rtdb->addContainer(par);
298*/
299}

◆ InitMedia()

void ecal::InitMedia ( )
private

Initialize all calorimter media

Definition at line 1032 of file ecal.cxx.

1033{
1034 Info("InitMedia", "Initializing media.");
1035 InitMedium("SensVacuum");
1036 InitMedium("ECALVacuum");
1037 InitMedium("Lead");
1038 InitMedium("Scintillator");
1039 InitMedium("Tyvek");
1040 InitMedium("ECALAir");
1041 InitMedium("ECALFiber");
1042 InitMedium("ECALSteel");
1043 InitMedium("ECALTileEdging");
1044}
Int_t InitMedium(const char *name)
Definition ecal.cxx:1009

◆ InitMedium()

Int_t ecal::InitMedium ( const char *  name)
private

Initialize medium with given name

Definition at line 1009 of file ecal.cxx.

1010{
1011 static FairGeoLoader *geoLoad=FairGeoLoader::Instance();
1012 static FairGeoInterface *geoFace=geoLoad->getGeoInterface();
1013 static FairGeoMedia *media=geoFace->getMedia();
1014 static FairGeoBuilder *geoBuild=geoLoad->getGeoBuilder();
1015
1016 FairGeoMedium *CbmMedium=media->getMedium(name);
1017
1018 if (!CbmMedium)
1019 {
1020 Fatal("InitMedium","Material %s not defined in media file.", name);
1021 return -1111;
1022 }
1023 TGeoMedium* medium=gGeoManager->GetMedium(name);
1024 if (medium!=NULL)
1025 return CbmMedium->getMediumIndex();
1026
1027 return geoBuild->createMedium(CbmMedium);
1028}

◆ operator=()

ecal & ecal::operator= ( const ecal )
private

◆ Print()

void ecal::Print ( ) const
virtual

Definition at line 635 of file ecal.cxx.

636{
637 Int_t nHits = fEcalCollection->GetEntriesFast();
638 Int_t nLiteHits;
639 Int_t i;
640
641 cout << "-I- ecal: " << nHits << " points registered in this event.";
642 cout << endl;
643
644 nLiteHits=fLiteCollection->GetEntriesFast();
645 cout << "-I- ecal: " << nLiteHits << " lite points registered in this event.";
646 cout << endl;
647
648 if (fVerboseLevel>1)
649 {
650 for (i=0;i<nHits;i++)
651 (*fEcalCollection)[i]->Print();
652 for (i=0;i<nLiteHits;i++)
653 (*fLiteCollection)[i]->Print();
654 }
655}

◆ ProcessHits()

Bool_t ecal::ProcessHits ( FairVolume *  vol = NULL)
virtual

Virtual method ProcessHits

Defines the action to be taken when a step is inside the active volume. Creates ecal and adds them to the collection.

Parameters
volPointer to the active volume

Fill MC point for sensitive ECAL volumes

Definition at line 384 of file ecal.cxx.

385{
387 TString Ecal="Ecal";
388 fELoss = gMC->Edep();
389 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
390 fTime = gMC->TrackTime()*1.0e09;
391 fLength = gMC->TrackLength();
392 Double_t bx, by, bz;
393 TParticle* bp=gMC->GetStack()->GetCurrentTrack();
394 gMC->TrackPosition(bx, by, bz);
395 Int_t volID;
396 gMC->CurrentVolID(volID);
397 //cout <<"Ecal called "<<volID<<" "<<vol->getVolumeId()<<" "<<fStructureId<<" "<<fELoss*1e10<<" "<<gGeoManager->GetVolume(vol->getVolumeId())->GetName()<<" "<<gMC->CurrentVolName()<<" "<<bz<<endl;
398 //if (vol->getVolumeId()==fStructureId) {
399 if (Ecal.CompareTo(gMC->CurrentVolName())==0) {
400 if (gMC->IsTrackEntering()) {
402 //cout <<"fill wallpoint "<<vol->getVolumeId()<<" "<<fStructureId<<" "<<fELoss*1e10<<endl;
403 ((ShipStack*)gMC->GetStack())->AddPoint(kecal, fTrackID);
404
406
407 return kTRUE;
408 } else {
409 return kFALSE;
410 }
411 }
412
413 if (fELoss<=0) return kFALSE;
414
415 if (fELoss>0)
416 {
417 Int_t i;
418 TParticle* p=gMC->GetStack()->GetCurrentTrack();
419 Double_t x, y, z;
420 Double_t px;
421 Double_t py;
422 Double_t dx;
423 Int_t mx;
424 Int_t my;
425 Int_t cell;
426 Int_t type;
427 Int_t cx;
428 Int_t cy;
429 gMC->TrackPosition(x, y, z);
430// cout << "Id: " << p->GetPdgCode() << " (" << x << ", " << y << ", ";
431// cout << z << "): ";
432// cout << endl;
433/*
434 for(i=0;i<10;i++)
435 {
436 gMC->CurrentVolOffID(i, mx); cout << i << ":" << mx << ", ";
437 }
438 cout << endl;
439*/
440 if (fSimpleGeo==0)
441 {
442 gMC->CurrentVolOffID(3, mx); mx--;
443 gMC->CurrentVolOffID(4, my); my--;
444 gMC->CurrentVolOffID(2, cell); cell--;
445 }
446 else
447 {
448 gMC->CurrentVolOffID(2, mx); mx--;
449 gMC->CurrentVolOffID(3, my); my--;
450 gMC->CurrentVolOffID(1, cell); cell--;
451 }
452 Int_t id=(my*100+mx)*100+cell+1;
453 if (id<0){
454 if (Ecal.CompareTo(gMC->CurrentVolName())==0&&fELoss<1e-19)
455 return kTRUE;
456 cout << "neg id "<<mx<<" "<<my<<" "<<cell<<" "<<gMC->CurrentVolName()<<" "<<gMC->CurrentVolOffName(1)<<" "<<gMC->CurrentVolOffName(2)<<" "<<fELoss<<" "<<fELoss*1e10<<endl;
457 }
458/*
459 Float_t rx; Float_t ry; Int_t ten;
460 GetCellCoordInf(id, rx, ry, ten); rx--; ry--;
461 type=fInf->GetType(mx, my);
462 Float_t d=fInf->GetVariableStrict("modulesize")/type;
463 if (x>rx-0.001&&x<rx+d+0.001&&y>ry-0.001&&y<ry+d+0.001)
464 {
465// cout << "+++ ";
466 ;
467 }
468 else
469 {
470 cout << mx << ", " << my << ", " << cell << endl;
471 cout << "--- ";
472 cout << "(" << x << ", " << y << ") : (" << rx << ", " << ry << ")" << endl;
473 }
474*/
476 if (fSimpleGeo==0)
477 {
478 type=fInf->GetType(mx, my);
479 cx=cell%type;
480 cy=cell/type;
481 // An old version
482 // px=mx*fModuleSize-fEcalSize[0]/2.0+cx*fModuleSize/type;
483 // py=my*fModuleSize-fEcalSize[1]/2.0+cy*fModuleSize/type;
484 // With correction for steel tapes and edging
487
488 px=(x-px)/fXCell[type];
489 py=(y-py)/fYCell[type];
490 if (px>=0&&px<1&&py>=0&&py<1)
491 {
492 fELoss*=fLightMaps[type]->Data(px-0.5, py-0.5);
493 FillLitePoint(0);
494 }
495 }
496 else
497 FillLitePoint(0);
498// for(i=0;i<8;i++)
499// {
500// Int_t t;
501//
502// gMC->CurrentVolOffID(i, t);
503// cout << i << ": " << gMC->CurrentVolOffName(i) << " " << t << "; ";
504// }
505// cout << endl;
506 }
507 ((ShipStack*)gMC->GetStack())->AddPoint(kecal, fTrackID);
508
510
511 return kTRUE;
512
513}
Double_t Data(Double_t x, Double_t y)
Bool_t FillLitePoint(Int_t volnum)
Definition ecal.cxx:564
void FillWallPoint()
Definition ecal.cxx:527
void ResetParameters()
Definition ecal.h:257

◆ Register()

void ecal::Register ( )
virtual

Definition at line 694 of file ecal.cxx.

695{
696 FairRootManager::Instance()->Register("EcalPoint","Ecal",fEcalCollection,kTRUE);
697 FairRootManager::Instance()->Register("EcalPointLite","EcalLite",fLiteCollection,kTRUE);
698 ;
699}

◆ Reset()

void ecal::Reset ( )
virtual

Definition at line 625 of file ecal.cxx.

626{
627 fEcalCollection->Clear();
628 fLiteCollection->Clear();
630 fFirstNumber=0;
631}

◆ ResetParameters()

void ecal::ResetParameters ( )
inlineprivate

Private method ResetParameters

Resets the private members for the track parameters

Definition at line 257 of file ecal.h.

258{
259 fTrackID = fVolumeID = 0;
260 fPos.SetXYZM(0.0, 0.0, 0.0, 0.0);
261 fMom.SetXYZM(0.0, 0.0, 0.0, 0.0);
262 fTime = fLength = fELoss = 0;
263 fPosIndex = 0;
264};

◆ SetEcalCuts()

void ecal::SetEcalCuts ( Int_t  medium)
private

Set GEANT3 tracking energy cuts for selected medium

Definition at line 318 of file ecal.cxx.

319{
321 if (fInf->GetElectronCut() > 0) {
322 gMC->Gstpar(medium,"CUTGAM",fInf->GetElectronCut());
323 gMC->Gstpar(medium,"CUTELE",fInf->GetElectronCut());
324 gMC->Gstpar(medium,"BCUTE" ,fInf->GetElectronCut());
325 gMC->Gstpar(medium,"BCUTM" ,fInf->GetElectronCut());
326 }
327
328 if (fInf->GetHadronCut() > 0) {
329 gMC->Gstpar(medium,"CUTNEU",fInf->GetHadronCut());
330 gMC->Gstpar(medium,"CUTHAD",fInf->GetHadronCut());
331 gMC->Gstpar(medium,"CUTMUO",fInf->GetHadronCut());
332 gMC->Gstpar(medium,"PPCUTM",fInf->GetHadronCut());
333 }
334 ;
335}
Double_t GetHadronCut() const
Definition ecalInf.h:52
Double_t GetElectronCut() const
Definition ecalInf.h:51

◆ SetSpecialPhysicsCuts()

void ecal::SetSpecialPhysicsCuts ( )
virtual

Change the special tracking cuts for two ECAL media, Scintillator and Lead

Definition at line 355 of file ecal.cxx.

356{
360 FairRun* fRun = FairRun::Instance();
361// if (strcmp(fRun->GetName(),"TGeant3") == 0)
362 {
363 Int_t mediumID;
364 mediumID = gGeoManager->GetMedium("Scintillator")->GetId();
365 SetEcalCuts(mediumID);
366 mediumID = gGeoManager->GetMedium("Lead")->GetId();
367 SetEcalCuts(mediumID);
368 mediumID = gGeoManager->GetMedium("Tyvek")->GetId();
369 SetEcalCuts(mediumID);
370 mediumID = gGeoManager->GetMedium("SensVacuum")->GetId();
371 SetEcalCuts(mediumID);
372 mediumID = gGeoManager->GetMedium("ECALAir")->GetId();
373 SetEcalCuts(mediumID);
374 mediumID = gGeoManager->GetMedium("ECALFiber")->GetId();
375 SetEcalCuts(mediumID);
376 mediumID = gGeoManager->GetMedium("ECALTileEdging")->GetId();
377 SetEcalCuts(mediumID);
378 mediumID = gGeoManager->GetMedium("ECALSteel")->GetId();
379 SetEcalCuts(mediumID);
380 }
381}
void SetEcalCuts(Int_t medium)
Definition ecal.cxx:318

Member Data Documentation

◆ fCells

TGeoVolume* ecal::fCells[cMaxModuleType]
private

Calorimeter Modules.

Definition at line 231 of file ecal.h.

◆ fCF

Int_t ecal::fCF[cMaxModuleType]
private

Definition at line 178 of file ecal.h.

◆ fDebug

Option_t* ecal::fDebug
private

Definition at line 111 of file ecal.h.

◆ fDX

Float_t ecal::fDX
private

Position of calorimeter center

Definition at line 148 of file ecal.h.

◆ fDY

Float_t ecal::fDY
private

Definition at line 149 of file ecal.h.

◆ fEcalCollection

TClonesArray* ecal::fEcalCollection
private

MC point collection on ECAL wall

Definition at line 135 of file ecal.h.

◆ fEcalSize

Float_t ecal::fEcalSize[3]
private

ECAL geometry parameters x,y,z size of outer ECAL box [cm]

Definition at line 140 of file ecal.h.

◆ fEdging

Float_t ecal::fEdging
private

Thickness of tile edging [cm]

Definition at line 168 of file ecal.h.

◆ fELoss

Double32_t ecal::fELoss
private

energy loss

Definition at line 130 of file ecal.h.

◆ fFiberRad

Float_t ecal::fFiberRad
private

Radius of fibers in calorimeter [cm]

Definition at line 172 of file ecal.h.

◆ fFiberVol

TGeoVolume* ecal::fFiberVol[3]
private

Hole volume.

Definition at line 237 of file ecal.h.

◆ fFirstNumber

Int_t ecal::fFirstNumber
private

Number of first hit for current primary

Definition at line 204 of file ecal.h.

◆ fGeoScale

Float_t ecal::fGeoScale
private

scall factor for fCellSize and fThicknessLayer

Definition at line 188 of file ecal.h.

◆ fHolePos

TGeoTranslation** ecal::fHolePos[cMaxModuleType]
private

Steel tapes.

Definition at line 239 of file ecal.h.

◆ fHoleRad

Float_t ecal::fHoleRad
private

Radius of holes in the calorimeter [cm]

Definition at line 170 of file ecal.h.

◆ fHoleVol

TGeoVolume* ecal::fHoleVol[3]
private

Tyvek sheets.

Definition at line 236 of file ecal.h.

◆ fInf

ecalInf* ecal::fInf
private

Definition at line 110 of file ecal.h.

◆ fLength

Double32_t ecal::fLength
private

length

Definition at line 128 of file ecal.h.

◆ fLightMapNames

TString ecal::fLightMapNames[cMaxModuleType]
private

Names of light maps

Definition at line 180 of file ecal.h.

◆ fLightMaps

ecalLightMap* ecal::fLightMaps[cMaxModuleType]
private

Light maps

Definition at line 182 of file ecal.h.

◆ fLiteCollection

TClonesArray* ecal::fLiteCollection
private

MC point collection inside ECAL

Definition at line 137 of file ecal.h.

◆ fModuleLenght

Float_t ecal::fModuleLenght
private

Lenght of calorimeter module

Definition at line 186 of file ecal.h.

◆ fModules

TGeoVolume* ecal::fModules[cMaxModuleType]
private

Definition at line 230 of file ecal.h.

◆ fModuleSize

Float_t ecal::fModuleSize
private

Size of calorimeter module [cm]

Definition at line 151 of file ecal.h.

◆ fModulesWithType

Int_t ecal::fModulesWithType[cMaxModuleType]
private

Positions of holes.

Definition at line 240 of file ecal.h.

◆ fMom

TLorentzVector ecal::fMom
private

momentum

Definition at line 124 of file ecal.h.

◆ fNColumns

Int_t ecal::fNColumns
private

max number of columns in ECAL1 or ECAL2

Definition at line 198 of file ecal.h.

◆ fNColumns1

Int_t ecal::fNColumns1
private

Number of columns in ECAL1

Definition at line 190 of file ecal.h.

◆ fNColumns2

Int_t ecal::fNColumns2
private

Number of columns in ECAL2

Definition at line 194 of file ecal.h.

◆ fNH

Int_t ecal::fNH[cMaxModuleType]
private

Number of holes in modules

Definition at line 177 of file ecal.h.

◆ fNLayers

Int_t ecal::fNLayers
private

number of layers per cell

Definition at line 184 of file ecal.h.

◆ fNRows

Int_t ecal::fNRows
private

max number of rows in ECAL1 or ECAL2

Definition at line 200 of file ecal.h.

◆ fNRows1

Int_t ecal::fNRows1
private

Number of rows in ECAL1

Definition at line 192 of file ecal.h.

◆ fNRows2

Int_t ecal::fNRows2
private

Number of rows in ECAL2

Definition at line 196 of file ecal.h.

◆ fPbTiles

TGeoVolume* ecal::fPbTiles[cMaxModuleType]
private

Edging of scintillator tiles.

Definition at line 234 of file ecal.h.

◆ fPos

TLorentzVector ecal::fPos
private

position

Definition at line 122 of file ecal.h.

◆ fPosIndex

Int_t ecal::fPosIndex
private

Definition at line 132 of file ecal.h.

◆ fRawNumber

std::list<std::pair<Int_t, TGeoVolume*> > ecal::fRawNumber
private

Number of mudules with type.

Definition at line 241 of file ecal.h.

◆ fScTiles

TGeoVolume* ecal::fScTiles[cMaxModuleType]
private

Calorimeter Cells.

Definition at line 232 of file ecal.h.

◆ fSemiX

Float_t ecal::fSemiX
private

Semiaxises of keeping volume for ecal

Definition at line 155 of file ecal.h.

◆ fSemiY

Float_t ecal::fSemiY
private

Definition at line 156 of file ecal.h.

◆ fSimpleGeo

Int_t ecal::fSimpleGeo
private

Use simple geometry. Try to be as compatible to ecal in physics as possible

Definition at line 143 of file ecal.h.

◆ fSteelTapes

TGeoVolume* ecal::fSteelTapes[2]
private

Fiber volume.

Definition at line 238 of file ecal.h.

◆ fStructureId

Int_t ecal::fStructureId
private

List of constructed raws.

Volume ID of calorimeter structure

Definition at line 244 of file ecal.h.

◆ fThicknessLayer

Float_t ecal::fThicknessLayer
private

total thickness of one layer [cm]

Definition at line 164 of file ecal.h.

◆ fThicknessLead

Float_t ecal::fThicknessLead
private

thickness of one lead layer [cm]

Definition at line 158 of file ecal.h.

◆ fThicknessScin

Float_t ecal::fThicknessScin
private

thickness of one scintillator layer [cm]

Definition at line 160 of file ecal.h.

◆ fThicknessSteel

Float_t ecal::fThicknessSteel
private

total thickness of steel layer [cm]

Definition at line 166 of file ecal.h.

◆ fThicknessTyvk

Float_t ecal::fThicknessTyvk
private

thickness of one tyvek layer [cm]

Definition at line 162 of file ecal.h.

◆ fTileEdging

TGeoVolume* ecal::fTileEdging[cMaxModuleType]
private

Pb tiles.

Definition at line 233 of file ecal.h.

◆ fTime

Double32_t ecal::fTime
private

time

Definition at line 126 of file ecal.h.

◆ fTrackID

Int_t ecal::fTrackID
private

Track information to be stored until the track leaves the active volume. track index

Definition at line 118 of file ecal.h.

◆ fTvTiles

TGeoVolume* ecal::fTvTiles[cMaxModuleType]
private

Scintillator tiles.

Definition at line 235 of file ecal.h.

◆ fVolArr

Int_t ecal::fVolArr[kNumberOfECALSensitiveVolumes]
private

Map of volumes in ECAL fVolArr[0]==code of sensivite wall fVolArr[1]==code of PS Lead fVolArr[2]==code of PS Scin fVolArr[4]==code of Lead fVolArr[3]==code of Tyveec fVolArr[5]==code of scintillator

Definition at line 213 of file ecal.h.

◆ fVolIdMax

Int_t ecal::fVolIdMax
private

Max number of ECAL cells

Definition at line 202 of file ecal.h.

◆ fVolumeID

Int_t ecal::fVolumeID
private

volume id

Definition at line 120 of file ecal.h.

◆ fXCell

Float_t ecal::fXCell[cMaxModuleType]
private

XY Size of cell

Definition at line 174 of file ecal.h.

◆ fXSize

Int_t ecal::fXSize
private

Size of the ECAL in modules

Definition at line 145 of file ecal.h.

◆ fYCell

Float_t ecal::fYCell[cMaxModuleType]
private

Definition at line 175 of file ecal.h.

◆ fYSize

Int_t ecal::fYSize
private

Definition at line 146 of file ecal.h.

◆ fZEcal

Float_t ecal::fZEcal
private

Z-position of ECAL from the target [cm]

Definition at line 153 of file ecal.h.


The documentation for this class was generated from the following files: