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

#include <MagneticSpectrometer.h>

Inheritance diagram for MagneticSpectrometer:
Collaboration diagram for MagneticSpectrometer:

Public Member Functions

 MagneticSpectrometer (const char *name, const Double_t Zcenter, Bool_t Active, const char *Title="MagneticSpectrometer")
 
 MagneticSpectrometer ()
 
virtual ~MagneticSpectrometer ()
 
void SetDesign (Int_t Design)
 
void SetTotDimensions (Double_t X, Double_t Y, Double_t Z)
 
void SetFeDimensions (Double_t X, Double_t Y, Double_t Z)
 
void SetRpcDimensions (Double_t X, Double_t Y, Double_t Z)
 
void SetRpcStripDimensions (Double_t X, Double_t Y, Double_t Z)
 
void SetRpcGasDimensions (Double_t X, Double_t Y, Double_t Z)
 
void SetRpcElectrodeDimensions (Double_t X, Double_t Y, Double_t Z)
 
void SetRpcPETDimensions (Double_t X, Double_t Y, Double_t Z)
 
void SetNFeInArm (Int_t N)
 
void SetNRpcInArm (Int_t N)
 
void SetZDimensionArm (Double_t Z)
 
void SetGapDownstream (Double_t Gap)
 
void SetGapMiddle (Double_t Gap)
 
void SetMagneticField (Double_t B)
 
void SetReturnYokeDimensions (Double_t X, Double_t Y, Double_t Z)
 
void SetSmallerYokeDimensions (Double_t X, Double_t Y, Double_t Z)
 
void SetCoilParameters (Double_t CoilH, Double_t CoilW, Int_t N, Double_t CoilG)
 
void SetPillarDimensions (Double_t X, Double_t Y, Double_t Z)
 
void ConstructGeometry ()
 
virtual void Initialize ()
 
virtual Bool_t ProcessHits (FairVolume *v=0)
 
virtual void Register ()
 
virtual TClonesArray * GetCollection (Int_t iColl) const
 
virtual void Reset ()
 
ShipRpcPointAddHit (Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
 
virtual void CopyClones (TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
 
virtual void SetSpecialPhysicsCuts ()
 
virtual void EndOfEvent ()
 
virtual void FinishPrimary ()
 
virtual void FinishRun ()
 
virtual void BeginPrimary ()
 
virtual void PostTrack ()
 
virtual void PreTrack ()
 
virtual void BeginEvent ()
 
void DecodeVolumeID (Int_t detID, int &nARM, int &nRPC)
 

Protected Member Functions

 MagneticSpectrometer (const MagneticSpectrometer &)
 
MagneticSpectrometeroperator= (const MagneticSpectrometer &)
 

Protected Attributes

Int_t fDesign
 
Double_t fZcenter
 
Double_t fXtot
 
Double_t fYtot
 
Double_t fZtot
 
Int_t fNFe
 
Int_t fNRpc
 
Double_t fXFe
 
Double_t fXRpc
 
Double_t fYFe
 
Double_t fYRpc
 
Double_t fZFe
 
Double_t fZRpc
 
Double_t fZArm
 
Double_t fGapDown
 
Double_t fGapMiddle
 
Double_t fField
 
Double_t fXRyoke
 
Double_t fYRyoke
 
Double_t fZRyoke
 
Double_t fXRyoke_s
 
Double_t fYRyoke_s
 
Double_t fZRyoke_s
 
Double_t fCoilGap
 
Double_t fCoilH
 
Double_t fCoilW
 
Int_t fNCoil
 
Double_t fXStrip
 
Double_t fYStrip
 
Double_t fZStrip
 
Double_t fXPet
 
Double_t fYPet
 
Double_t fZPet
 
Double_t fXEle
 
Double_t fYEle
 
Double_t fZEle
 
Double_t fXGas
 
Double_t fYGas
 
Double_t fZGas
 
Double_t fPillarX
 
Double_t fPillarY
 
Double_t fPillarZ
 

Private Member Functions

Int_t InitMedium (const char *name)
 

Private Attributes

Int_t fTrackID
 
Int_t fPdgCode
 track index
 
Int_t fVolumeID
 pdg code
 
TLorentzVector fPos
 volume id
 
TLorentzVector fMom
 position at entrance
 
Double32_t fTime
 momentum at entrance
 
Double32_t fLength
 time
 
Double32_t fELoss
 length
 
TClonesArray * fShipRpcPointCollection
 energy loss
 

Detailed Description

Definition at line 18 of file MagneticSpectrometer.h.

Constructor & Destructor Documentation

◆ MagneticSpectrometer() [1/3]

MagneticSpectrometer::MagneticSpectrometer ( const char *  name,
const Double_t  Zcenter,
Bool_t  Active,
const char *  Title = "MagneticSpectrometer" 
)

Definition at line 59 of file MagneticSpectrometer.cxx.

60 : FairDetector(name, Active, ktauRpc),
61 fTrackID(-1),
62 fPdgCode(),
63 fVolumeID(-1),
64 fPos(),
65 fMom(),
66 fTime(-1.),
67 fLength(-1.),
68 fELoss(-1),
69 fShipRpcPointCollection(new TClonesArray("ShipRpcPoint"))
70{
71 fZcenter = Zcenter;
72}
@ ktauRpc
TClonesArray * fShipRpcPointCollection
energy loss
TLorentzVector fMom
position at entrance
TLorentzVector fPos
volume id
Double32_t fTime
momentum at entrance

◆ MagneticSpectrometer() [2/3]

MagneticSpectrometer::MagneticSpectrometer ( )

Definition at line 45 of file MagneticSpectrometer.cxx.

46 : FairDetector("MagneticSpectrometer",kTRUE, ktauRpc),
47 fTrackID(-1),
48 fPdgCode(),
49 fVolumeID(-1),
50 fPos(),
51 fMom(),
52 fTime(-1.),
53 fLength(-1.),
54 fELoss(-1),
55 fShipRpcPointCollection(new TClonesArray("ShipRpcPoint"))
56{
57}

◆ ~MagneticSpectrometer()

MagneticSpectrometer::~MagneticSpectrometer ( )
virtual

Definition at line 190 of file MagneticSpectrometer.cxx.

191{
193 fShipRpcPointCollection->Delete();
195 }
196}

◆ MagneticSpectrometer() [3/3]

MagneticSpectrometer::MagneticSpectrometer ( const MagneticSpectrometer )
protected

Member Function Documentation

◆ AddHit()

ShipRpcPoint * MagneticSpectrometer::AddHit ( Int_t  trackID,
Int_t  detID,
TVector3  pos,
TVector3  mom,
Double_t  time,
Double_t  length,
Double_t  eLoss,
Int_t  pdgCode 
)

This method is an example of how to add your own point of type muonPoint to the clones array

Definition at line 597 of file MagneticSpectrometer.cxx.

602{
603 TClonesArray& clref = *fShipRpcPointCollection;
604 Int_t size = clref.GetEntriesFast();
605 //cout << "ShipRpctau hit called"<< pos.z()<<endl;
606 // return new(clref[size]) ShipRpcPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode,NArm, NRpc, NHpt);
607 return new(clref[size]) ShipRpcPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode);
608}

◆ BeginEvent()

virtual void MagneticSpectrometer::BeginEvent ( )
inlinevirtual

Definition at line 85 of file MagneticSpectrometer.h.

85{;}

◆ BeginPrimary()

virtual void MagneticSpectrometer::BeginPrimary ( )
inlinevirtual

Definition at line 82 of file MagneticSpectrometer.h.

82{;}

◆ ConstructGeometry()

void MagneticSpectrometer::ConstructGeometry ( )

Definition at line 224 of file MagneticSpectrometer.cxx.

225{
226 TGeoVolume *top = gGeoManager->GetTopVolume();
227 TGeoVolumeAssembly *tTauNuDet = new TGeoVolumeAssembly("tTauNuDet");
228 top->AddNode(tTauNuDet, 1, new TGeoTranslation(0, 0, 0));
229
230 InitMedium("RPCgas");
231 TGeoMedium *RPCmat =gGeoManager->GetMedium("RPCgas");
232
233 InitMedium("vacuum");
234 TGeoMedium *vacuum =gGeoManager->GetMedium("vacuum");
235
236 InitMedium("Bakelite");
237 TGeoMedium *bakelite =gGeoManager->GetMedium("Bakelite");
238
239 InitMedium("iron");
240 TGeoMedium *Iron =gGeoManager->GetMedium("iron");
241
242 InitMedium("steel");
243 TGeoMedium *Steel =gGeoManager->GetMedium("steel");
244
245 InitMedium("copper");
246 TGeoMedium *Cu =gGeoManager->GetMedium("copper");
247
248 InitMedium("Concrete");
249 TGeoMedium *Conc =gGeoManager->GetMedium("Concrete");
250
251 TGeoUniformMagField *retFieldU = new TGeoUniformMagField(0.,0.,-fField); //magnetic field up return yoke
252 TGeoUniformMagField *retFieldL = new TGeoUniformMagField(0.,0.,fField); //magnetic field low return yoke
253
254 Double_t d = 0;
255
256 if(fDesign!=3)
257 {
258 TGeoBBox *MSBox = new TGeoBBox("MagneticSpectrometerBox", fXRyoke/2, fYtot/2, fZtot/2);
259 TGeoVolume *volMSBox = new TGeoVolume("volMagneticSpectrometer", MSBox, vacuum);
260 tTauNuDet->AddNode(volMSBox, 1, new TGeoTranslation(0,10*cm,fZcenter));
261
262
263 TGeoBBox *UpYokeBox = new TGeoBBox("UpYokeBox", fXRyoke/2, fYRyoke/2, fZRyoke/2);
264 TGeoVolume *volUpYoke = new TGeoVolume("volUpYoke",UpYokeBox,vacuum);
265 volMSBox->AddNode(volUpYoke,1,new TGeoTranslation(0,fYtot/2 - fYRyoke/2,0));
266 volUpYoke->SetField(retFieldU);
267
268
269 TGeoBBox *FeYoke = new TGeoBBox("FeYoke",fXtot/2, fYRyoke/2, fZArm/2);
270 TGeoVolume *volFeYoke = new TGeoVolume("volFeYoke",FeYoke,Iron);
271 volFeYoke->SetLineColor(kGray+1);
272
273 TGeoBBox *FeYoke1 = new TGeoBBox("FeYoke1",fXtot/2, fYRyoke_s/2, fZRyoke_s/2);
274 TGeoVolume *volFeYoke1 = new TGeoVolume("volFeYoke1",FeYoke1,Iron);
275 volFeYoke1->SetLineColor(kGray+1);
276
277 TGeoBBox *CoilContainer = new TGeoBBox("CoilContainer",fXtot/2, fCoilH/2, 40*cm);
278 TGeoVolume *volCoilContainer = new TGeoVolume("volCoilContainer",CoilContainer,vacuum);
279
280 TGeoBBox *Coil = new TGeoBBox("Coil",fXtot/2, fCoilH/2, fCoilW/2);
281 TGeoVolume *volCoil = new TGeoVolume("volCoil",Coil,Cu);
282 volCoil->SetLineColor(kOrange -5);
283 for(int i = 0; i < fNCoil; i++)
284 {
285 volCoilContainer->AddNode(volCoil, i, new TGeoTranslation(0,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
286 }
287
288 //vertical coils
289 TGeoBBox *CoilV = new TGeoBBox("CoilV",fCoilH/2, fYRyoke/2 , fCoilW/2);
290 TGeoVolume *volCoilV = new TGeoVolume("volCoilV",CoilV,Cu);
291 volCoilV->SetLineColor(kOrange -5);
292 for(int i = 0; i < fNCoil; i++)
293 {
294 volUpYoke->AddNode(volCoilV, i, new TGeoTranslation(fXRyoke/2 - fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
295 }
296 for(int i = 0; i < fNCoil; i++)
297 {
298 volUpYoke->AddNode(volCoilV, i, new TGeoTranslation(-fXRyoke/2 + fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
299 }
300
301 //cout <<"fZArm: " << fZArm<< endl;
302
303 volUpYoke->AddNode(volFeYoke,1, new TGeoTranslation(0,0,- (fZArm + fGapMiddle)/2));
304 volUpYoke->AddNode(volFeYoke,2, new TGeoTranslation(0,0,(fZArm + fGapMiddle)/2));
305 volUpYoke->AddNode(volFeYoke1,1,new TGeoTranslation(0,0,0));
306 volUpYoke->AddNode(volCoilContainer,1,new TGeoTranslation(0,fYRyoke/2 - fCoilH/2,0)); //up
307 volUpYoke->AddNode(volCoilContainer,2,new TGeoTranslation(0,-fYRyoke/2 + fCoilH/2,0)); //low
308
309 TGeoBBox *LowYokeBox = new TGeoBBox("LowYokeBox", fXRyoke/2, fYRyoke/2, fZRyoke/2);
310 TGeoVolume *volLowYoke = new TGeoVolume("volLowYoke",LowYokeBox,vacuum);
311 volMSBox->AddNode(volLowYoke,1,new TGeoTranslation(0,-fYtot/2 + fYRyoke/2,0));
312 volLowYoke->SetField(retFieldL);
313
314 //vertical coils
315 for(int i = 0; i < fNCoil; i++)
316 {
317 volLowYoke->AddNode(volCoilV, i, new TGeoTranslation(fXRyoke/2 - fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
318 }
319 for(int i = 0; i < fNCoil; i++)
320 {
321 volLowYoke->AddNode(volCoilV, i, new TGeoTranslation(-fXRyoke/2 + fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
322 }
323
324 volLowYoke->AddNode(volFeYoke,3, new TGeoTranslation(0,0,- (fZArm + fGapMiddle)/2));
325 volLowYoke->AddNode(volFeYoke,4, new TGeoTranslation(0,0,(fZArm + fGapMiddle)/2));
326 volLowYoke->AddNode(volFeYoke1,1,new TGeoTranslation(0,0,0));
327 volLowYoke->AddNode(volCoilContainer,3,new TGeoTranslation(0,fYRyoke/2- fCoilH/2,0)); //up
328 volLowYoke->AddNode(volCoilContainer,4,new TGeoTranslation(0,-fYRyoke/2 + fCoilH/2,0)); //low
329
330 Int_t ArmNumber = 1;
331 TGeoBBox *Arm1Box = new TGeoBBox("Arm1MSBox", fXFe/2, fYFe/2, fZArm/2);
332 TGeoVolume *volArm1 = new TGeoVolume("volArm1MS", Arm1Box,vacuum);
333 TGeoUniformMagField *magField1 = new TGeoUniformMagField(0.,-fField,0.); //magnetic field arm1
334 volArm1->SetField(magField1);
335 volMSBox ->AddNode(volArm1,ArmNumber,new TGeoTranslation(0,0,-(fGapMiddle+fZArm)/2));
336
337 Int_t nr = ArmNumber*1E4;
338
339 TGeoBBox *IronLayer = new TGeoBBox("Iron",fXFe/2, fYFe/2, fZFe/2);
340 TGeoVolume *volIron = new TGeoVolume("volIron",IronLayer,Iron);
341 //volIron->SetField(magField1);
342
343 for(Int_t i = 0; i < fNFe; i++)
344 {
345 volArm1->AddNode(volIron,nr + 100 + i, new TGeoTranslation(0, 0, -fZArm/2+i*(fZFe +fZRpc) +fZFe/2));
346 }
347
348 TGeoBBox *RpcContainer = new TGeoBBox("RpcContainer", fXRpc/2, fYRpc/2, fZRpc/2);
349 TGeoVolume *volRpcContainer = new TGeoVolume("volRpcContainer",RpcContainer,vacuum);
350
351 TGeoBBox *Strip = new TGeoBBox("Strip",fXStrip/2, fYStrip/2, fZStrip/2);
352 TGeoVolume *volStrip = new TGeoVolume("volStrip",Strip,Cu);
353 volStrip->SetLineColor(kRed);
354 volRpcContainer->AddNode(volStrip,1,new TGeoTranslation (0,0,-3.25*mm));
355 volRpcContainer->AddNode(volStrip,2,new TGeoTranslation (0,0,3.25*mm));
356 TGeoBBox *PETinsulator = new TGeoBBox("PETinsulator", fXPet/2, fYPet/2, fZPet/2);
357 TGeoVolume *volPETinsulator = new TGeoVolume("volPETinsulator", PETinsulator, bakelite);
358 volPETinsulator->SetLineColor(kYellow);
359 volRpcContainer->AddNode(volPETinsulator,1,new TGeoTranslation(0,0,-3.1*mm));
360 volRpcContainer->AddNode(volPETinsulator,2,new TGeoTranslation(0,0, 3.1*mm));
361 TGeoBBox *Electrode = new TGeoBBox("Electrode",fXEle/2, fYEle/2, fZEle/2);
362 TGeoVolume *volElectrode = new TGeoVolume("volElectrode",Electrode,bakelite);
363 volElectrode->SetLineColor(kGreen);
364 volRpcContainer->AddNode(volElectrode,1,new TGeoTranslation(0,0,-2*mm));
365 volRpcContainer->AddNode(volElectrode,2,new TGeoTranslation(0,0, 2*mm));
366 TGeoBBox *RpcGas = new TGeoBBox("RpcGas", fXGas/2, fYGas/2, fZGas/2);
367 TGeoVolume *volRpc = new TGeoVolume("volRpc",RpcGas,RPCmat);
368 volRpc->SetLineColor(kCyan);
369 volRpcContainer->AddNode(volRpc,1,new TGeoTranslation(0,0,0));
370
371 AddSensitiveVolume(volRpc);
372
373 for(Int_t i = 0; i < fNRpc; i++)
374 {
375 volArm1->AddNode(volRpcContainer,nr + i,new TGeoTranslation(0, -fYFe/2 + fYRpc/2, -fZArm/2+(i+1)*fZFe + i*fZRpc +fZRpc/2));
376 }
377
378 ArmNumber = 2;
379 nr = ArmNumber*1E4;
380
381 TGeoBBox *Arm2Box = new TGeoBBox("Arm2MSBox",fXFe/2, fYFe/2, fZArm/2);
382 TGeoVolume *volArm2 = new TGeoVolume("volArm2MS", Arm2Box,vacuum);
383 TGeoUniformMagField *magField2 = new TGeoUniformMagField(0.,fField,0.); //magnetic field arm2
384 volArm2->SetField(magField2);
385 volMSBox ->AddNode(volArm2,1,new TGeoTranslation(0,0,(fGapMiddle+fZArm)/2));
386 TGeoVolume *volIron2 = new TGeoVolume("volIron2",IronLayer,Iron);
387
388 //different volumes for second arm
389
390 TGeoVolume *volRpcContainer2 = new TGeoVolume("volRpcContainer2",RpcContainer,vacuum);
391 TGeoVolume *volStrip2 = new TGeoVolume("volStrip2",Strip,Cu);
392
393 volStrip2->SetLineColor(kRed);
394 volRpcContainer2->AddNode(volStrip2,1,new TGeoTranslation (0,0,-3.25*mm));
395 volRpcContainer2->AddNode(volStrip2,2,new TGeoTranslation (0,0,3.25*mm));
396
397 TGeoVolume *volPETinsulator2 = new TGeoVolume("volPETinsulator2", PETinsulator, bakelite);
398 volPETinsulator2->SetLineColor(kYellow);
399 volRpcContainer2->AddNode(volPETinsulator2,1,new TGeoTranslation(0,0,-3.1*mm));
400 volRpcContainer2->AddNode(volPETinsulator2,2,new TGeoTranslation(0,0, 3.1*mm));
401
402 TGeoVolume *volElectrode2 = new TGeoVolume("volElectrode2",Electrode,bakelite);
403 volElectrode2->SetLineColor(kGreen);
404 volRpcContainer2->AddNode(volElectrode2,1,new TGeoTranslation(0,0,-2*mm));
405 volRpcContainer2->AddNode(volElectrode2,2,new TGeoTranslation(0,0, 2*mm));
406
407 TGeoVolume *volRpc2 = new TGeoVolume("volRpc2",RpcGas,RPCmat);
408 volRpc2->SetLineColor(kCyan);
409 volRpcContainer2->AddNode(volRpc2,1,new TGeoTranslation(0,0,0));
410 AddSensitiveVolume(volRpc2);
411
412 for(Int_t i = 0; i < fNFe; i++)
413 {
414 volArm2->AddNode(volIron2,nr + 100 + i,new TGeoTranslation(0, 0, -fZArm/2+i*(fZFe +fZRpc) +fZFe/2));
415 }
416
417 for(Int_t i = 0; i < fNRpc; i++)
418 {
419 volArm2->AddNode(volRpcContainer2, nr + i,new TGeoTranslation(0, -fYFe/2 + fYRpc/2, -fZArm/2+(i+1)*fZFe + i*fZRpc +fZRpc/2));
420 }
421
422 //10 cm of Concrete on which the whole Magnetic Spectrometer volume (HPT included) will be placed
423 TGeoBBox *Base = new TGeoBBox("Base", fXtot/2, 10*cm/2, fZtot/2);
424 TGeoVolume *volBase = new TGeoVolume("volBase",Base,Conc);
425 volBase->SetLineColor(kYellow-3);
426
427 tTauNuDet->AddNode(volBase,1, new TGeoTranslation(0,-fYtot/2 + 10*cm/2,fZcenter));
428
429
430 TGeoBBox *Pillar1Box = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
431 TGeoVolume *Pillar1Vol = new TGeoVolume("Pillar1Vol",Pillar1Box,Steel);
432 Pillar1Vol->SetLineColor(kGreen+3);
433
434 tTauNuDet->AddNode(Pillar1Vol,1, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZArm/2 - fGapMiddle/2 +fPillarZ/2));
435 tTauNuDet->AddNode(Pillar1Vol,2, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZArm/2 - fGapMiddle/2 +fPillarZ/2));
436 tTauNuDet->AddNode(Pillar1Vol,3, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZArm/2+fGapMiddle/2-fPillarZ/2));
437 tTauNuDet->AddNode(Pillar1Vol,4, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZArm/2+fGapMiddle/2-fPillarZ/2));
438 }
439 if(fDesign==3)
440 {
441 Int_t nr = 1E4;
442
443 TGeoBBox *MSBox = new TGeoBBox("MagneticSpectrometerBox", fXtot/2, fYtot/2, fZtot/2);
444 TGeoVolume *volMSBox = new TGeoVolume("volMagneticSpectrometer", MSBox, vacuum);
445 tTauNuDet->AddNode(volMSBox, 1, new TGeoTranslation(0,0,fZcenter));
446
447 TGeoBBox *IronLayer = new TGeoBBox("Iron",fXFe/2, fYFe/2, fZFe/2);
448 TGeoVolume *volIron = new TGeoVolume("volIron",IronLayer,Iron);
449 //volIron->SetField(magField1);
450
451 for(Int_t i = 0; i < fNFe; i++)
452 {
453 volMSBox->AddNode(volIron,nr + 100 + i, new TGeoTranslation(0, 0,-fZtot/2+i*fZFe+fZFe/2+i*fZRpc));
454 }
455
456 TGeoBBox *RpcContainer = new TGeoBBox("RpcContainer", fXRpc/2, fYRpc/2, fZRpc/2);
457 TGeoVolume *volRpcContainer = new TGeoVolume("volRpcContainer",RpcContainer,vacuum);
458
459 TGeoBBox *Strip = new TGeoBBox("Strip",fXStrip/2, fYStrip/2, fZStrip/2);
460 TGeoVolume *volStrip = new TGeoVolume("volStrip",Strip,Cu);
461 volStrip->SetLineColor(kRed);
462 volRpcContainer->AddNode(volStrip,1,new TGeoTranslation (0,0,-3.25*mm));
463 volRpcContainer->AddNode(volStrip,2,new TGeoTranslation (0,0,3.25*mm));
464 TGeoBBox *PETinsulator = new TGeoBBox("PETinsulator", fXPet/2, fYPet/2, fZPet/2);
465 TGeoVolume *volPETinsulator = new TGeoVolume("volPETinsulator", PETinsulator, bakelite);
466 volPETinsulator->SetLineColor(kYellow);
467 volRpcContainer->AddNode(volPETinsulator,1,new TGeoTranslation(0,0,-3.1*mm));
468 volRpcContainer->AddNode(volPETinsulator,2,new TGeoTranslation(0,0, 3.1*mm));
469 TGeoBBox *Electrode = new TGeoBBox("Electrode",fXEle/2, fYEle/2, fZEle/2);
470 TGeoVolume *volElectrode = new TGeoVolume("volElectrode",Electrode,bakelite);
471 volElectrode->SetLineColor(kGreen);
472 volRpcContainer->AddNode(volElectrode,1,new TGeoTranslation(0,0,-2*mm));
473 volRpcContainer->AddNode(volElectrode,2,new TGeoTranslation(0,0, 2*mm));
474 TGeoBBox *RpcGas = new TGeoBBox("RpcGas", fXGas/2, fYGas/2, fZGas/2);
475 TGeoVolume *volRpc = new TGeoVolume("volRpc",RpcGas,RPCmat);
476 volRpc->SetLineColor(kCyan);
477 volRpcContainer->AddNode(volRpc,1,new TGeoTranslation(0,0,0));
478
479 AddSensitiveVolume(volRpc);
480
481 for(Int_t i = 0; i < fNRpc; i++)
482 {
483 volMSBox->AddNode(volRpcContainer,nr + i,new TGeoTranslation(0, 0, -fZtot/2+(i+1)*fZFe + i*fZRpc +fZRpc/2));
484 }
485
486 TGeoBBox *Pillar1Box = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
487 TGeoVolume *Pillar1Vol = new TGeoVolume("Pillar1Vol",Pillar1Box,Steel);
488 Pillar1Vol->SetLineColor(kGreen+3);
489
490 tTauNuDet->AddNode(Pillar1Vol,1, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZtot/2+fPillarZ/2));
491 tTauNuDet->AddNode(Pillar1Vol,2, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZtot/2 +fPillarZ/2));
492 // tTauNuDet->AddNode(Pillar1Vol,3, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZtot/2-fPillarZ/2));
493 //tTauNuDet->AddNode(Pillar1Vol,4, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZtot/2-fPillarZ/2));
494 }
495
496}
Double_t cm
Double_t mm
Int_t InitMedium(const char *name)
int i
Definition ShipAna.py:86

◆ CopyClones()

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

The following methods can be implemented if you need to make any optional action in your detector during the transport.

Definition at line 76 of file MagneticSpectrometer.h.

77 {;}

◆ DecodeVolumeID()

void MagneticSpectrometer::DecodeVolumeID ( Int_t  detID,
int &  nARM,
int &  nRPC 
)

Definition at line 579 of file MagneticSpectrometer.cxx.

580{
581 nARM = detID/1E4;
582 nRPC = detID - nARM*1E4;
583}

◆ EndOfEvent()

void MagneticSpectrometer::EndOfEvent ( )
virtual

Definition at line 558 of file MagneticSpectrometer.cxx.

559{
561}

◆ FinishPrimary()

virtual void MagneticSpectrometer::FinishPrimary ( )
inlinevirtual

Definition at line 80 of file MagneticSpectrometer.h.

80{;}

◆ FinishRun()

virtual void MagneticSpectrometer::FinishRun ( )
inlinevirtual

Definition at line 81 of file MagneticSpectrometer.h.

81{;}

◆ GetCollection()

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

Gets the produced collections

Definition at line 585 of file MagneticSpectrometer.cxx.

586{
587 if (iColl == 0) { return fShipRpcPointCollection; }
588 else { return NULL; }
589}

◆ Initialize()

void MagneticSpectrometer::Initialize ( )
virtual

Initialization of the detector is done here

Definition at line 198 of file MagneticSpectrometer.cxx.

199{
200 FairDetector::Initialize();
201}

◆ InitMedium()

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

Definition at line 204 of file MagneticSpectrometer.cxx.

205{
206 static FairGeoLoader *geoLoad=FairGeoLoader::Instance();
207 static FairGeoInterface *geoFace=geoLoad->getGeoInterface();
208 static FairGeoMedia *media=geoFace->getMedia();
209 static FairGeoBuilder *geoBuild=geoLoad->getGeoBuilder();
210
211 FairGeoMedium *ShipMedium=media->getMedium(name);
212
213 if (!ShipMedium)
214 {
215 Fatal("InitMedium","Material %s not defined in media file.", name);
216 return -1111;
217 }
218 TGeoMedium* medium=gGeoManager->GetMedium(name);
219 if (medium!=NULL)
220 return ShipMedium->getMediumIndex();
221 return geoBuild->createMedium(ShipMedium);
222}

◆ operator=()

MagneticSpectrometer & MagneticSpectrometer::operator= ( const MagneticSpectrometer )
protected

◆ PostTrack()

virtual void MagneticSpectrometer::PostTrack ( )
inlinevirtual

Definition at line 83 of file MagneticSpectrometer.h.

83{;}

◆ PreTrack()

virtual void MagneticSpectrometer::PreTrack ( )
inlinevirtual

Definition at line 84 of file MagneticSpectrometer.h.

84{;}

◆ ProcessHits()

Bool_t MagneticSpectrometer::ProcessHits ( FairVolume *  v = 0)
virtual

this method is called for each step during simulation (see FairMCApplication::Stepping())

This method is called from the MC stepping

Definition at line 499 of file MagneticSpectrometer.cxx.

500{
502 //Set parameters at entrance of volume. Reset ELoss.
503 if ( gMC->IsTrackEntering() ) {
504 fELoss = 0.;
505 fTime = gMC->TrackTime() * 1.0e09;
506 fLength = gMC->TrackLength();
507 gMC->TrackPosition(fPos);
508 gMC->TrackMomentum(fMom);
509 }
510 // Sum energy loss for all steps in the active volume
511 fELoss += gMC->Edep();
512
513 // Create muonPoint at exit of active volume
514 if ( gMC->IsTrackExiting() ||
515 gMC->IsTrackStop() ||
516 gMC->IsTrackDisappeared() ) {
517 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
518 fVolumeID = vol->getMCid();
519 if (fELoss == 0. ) { return kFALSE; }
520 TParticle* p=gMC->GetStack()->GetCurrentTrack();
521 Int_t pdgCode = p->GetPdgCode();
522 Int_t detID=0;
523 gMC->CurrentVolID(detID);
524
525 // cout<< "detID = " << detID << endl;
526 Int_t MaxLevel = gGeoManager->GetLevel();
527 const Int_t MaxL = MaxLevel;
528 //cout << "MaxLevel = " << MaxL << endl;
529 //cout << gMC->CurrentVolPath()<< endl;
530 Int_t NRpc =0;
531 const char *name;
532 name = gMC->CurrentVolName();
533 //cout << name << endl;
534 Int_t motherID = gGeoManager->GetMother(0)->GetNumber();
535 const char *mumname = gMC->CurrentVolOffName(0);
536 //cout<<mumname<<" "<< motherID<<endl;
537 detID = motherID;
538 //cout<< "detID = " << detID << endl;
539 //cout<<endl;
540 fVolumeID = detID;
541
542 TLorentzVector Pos;
543 gMC->TrackPosition(Pos);
544 Double_t xmean = (fPos.X()+Pos.X())/2. ;
545 Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
546 Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
547
548 AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean), TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength,fELoss, pdgCode);
549
550 // Increment number of muon det points in TParticle
551 ShipStack* stack = (ShipStack*) gMC->GetStack();
552 stack->AddPoint(ktauRpc);
553 }
554
555 return kTRUE;
556}
ShipRpcPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)

◆ Register()

void MagneticSpectrometer::Register ( )
virtual

Registers the produced collections in FAIRRootManager.

This will create a branch in the output tree called ShipRpcPoint, setting the last parameter to kFALSE means: this collection will not be written to the file, it will exist only during the simulation.

Definition at line 564 of file MagneticSpectrometer.cxx.

565{
566
573 FairRootManager::Instance()->Register("ShipRpcPoint", "MagneticSpectrometer",
575}

◆ Reset()

void MagneticSpectrometer::Reset ( )
virtual

has to be called after each event to reset the containers

Definition at line 591 of file MagneticSpectrometer.cxx.

592{
594}

◆ SetCoilParameters()

void MagneticSpectrometer::SetCoilParameters ( Double_t  CoilH,
Double_t  CoilW,
Int_t  N,
Double_t  CoilG 
)

◆ SetDesign()

void MagneticSpectrometer::SetDesign ( Int_t  Design)

Definition at line 74 of file MagneticSpectrometer.cxx.

75{
77 cout <<" Mag Spectro Design "<< fDesign<<endl;
78}

◆ SetFeDimensions()

void MagneticSpectrometer::SetFeDimensions ( Double_t  X,
Double_t  Y,
Double_t  Z 
)

◆ SetGapDownstream()

void MagneticSpectrometer::SetGapDownstream ( Double_t  Gap)

Definition at line 148 of file MagneticSpectrometer.cxx.

149{
150 fGapDown = Gap;
151}

◆ SetGapMiddle()

void MagneticSpectrometer::SetGapMiddle ( Double_t  Gap)

Definition at line 153 of file MagneticSpectrometer.cxx.

154{
155 fGapMiddle = Gap;
156}

◆ SetMagneticField()

void MagneticSpectrometer::SetMagneticField ( Double_t  B)

Definition at line 143 of file MagneticSpectrometer.cxx.

144{
145 fField =B;
146}

◆ SetNFeInArm()

void MagneticSpectrometer::SetNFeInArm ( Int_t  N)

Definition at line 163 of file MagneticSpectrometer.cxx.

164{
165 fNFe = N;
166}

◆ SetNRpcInArm()

void MagneticSpectrometer::SetNRpcInArm ( Int_t  N)

Definition at line 168 of file MagneticSpectrometer.cxx.

169{
170 fNRpc = N;
171}

◆ SetPillarDimensions()

void MagneticSpectrometer::SetPillarDimensions ( Double_t  X,
Double_t  Y,
Double_t  Z 
)

Definition at line 182 of file MagneticSpectrometer.cxx.

183{
184 fPillarX = X;
185 fPillarY = Y;
186 fPillarZ = Z;
187}

◆ SetReturnYokeDimensions()

void MagneticSpectrometer::SetReturnYokeDimensions ( Double_t  X,
Double_t  Y,
Double_t  Z 
)

Definition at line 129 of file MagneticSpectrometer.cxx.

130{
131 fXRyoke = X;
132 fYRyoke = Y;
133 fZRyoke = Z;
134}

◆ SetRpcDimensions()

void MagneticSpectrometer::SetRpcDimensions ( Double_t  X,
Double_t  Y,
Double_t  Z 
)

Definition at line 94 of file MagneticSpectrometer.cxx.

95{
96 fXRpc = X;
97 fYRpc = Y;
98 fZRpc = Z;
99}

◆ SetRpcElectrodeDimensions()

void MagneticSpectrometer::SetRpcElectrodeDimensions ( Double_t  X,
Double_t  Y,
Double_t  Z 
)

Definition at line 115 of file MagneticSpectrometer.cxx.

116{
117 fXEle = X;
118 fYEle = Y;
119 fZEle = Z;
120}

◆ SetRpcGasDimensions()

void MagneticSpectrometer::SetRpcGasDimensions ( Double_t  X,
Double_t  Y,
Double_t  Z 
)

Definition at line 101 of file MagneticSpectrometer.cxx.

102{
103 fXGas = X;
104 fYGas = Y;
105 fZGas = Z;
106}

◆ SetRpcPETDimensions()

void MagneticSpectrometer::SetRpcPETDimensions ( Double_t  X,
Double_t  Y,
Double_t  Z 
)

Definition at line 108 of file MagneticSpectrometer.cxx.

109{
110 fXPet = X;
111 fYPet = Y;
112 fZPet = Z;
113}

◆ SetRpcStripDimensions()

void MagneticSpectrometer::SetRpcStripDimensions ( Double_t  X,
Double_t  Y,
Double_t  Z 
)

Definition at line 122 of file MagneticSpectrometer.cxx.

123{
124 fXStrip = X;
125 fYStrip = Y;
126 fZStrip = Z;
127}

◆ SetSmallerYokeDimensions()

void MagneticSpectrometer::SetSmallerYokeDimensions ( Double_t  X,
Double_t  Y,
Double_t  Z 
)

Definition at line 136 of file MagneticSpectrometer.cxx.

137{
138 fXRyoke_s = X;
139 fYRyoke_s = Y;
140 fZRyoke_s = Z;
141}

◆ SetSpecialPhysicsCuts()

virtual void MagneticSpectrometer::SetSpecialPhysicsCuts ( )
inlinevirtual

Definition at line 78 of file MagneticSpectrometer.h.

78{;}

◆ SetTotDimensions()

void MagneticSpectrometer::SetTotDimensions ( Double_t  X,
Double_t  Y,
Double_t  Z 
)

Definition at line 80 of file MagneticSpectrometer.cxx.

81{
82 fXtot = X;
83 fYtot = Y;
84 fZtot = Z;
85}

◆ SetZDimensionArm()

void MagneticSpectrometer::SetZDimensionArm ( Double_t  Z)

Definition at line 158 of file MagneticSpectrometer.cxx.

159{
160 fZArm = Z;
161}

Member Data Documentation

◆ fCoilGap

Double_t MagneticSpectrometer::fCoilGap
protected

Definition at line 138 of file MagneticSpectrometer.h.

◆ fCoilH

Double_t MagneticSpectrometer::fCoilH
protected

Definition at line 139 of file MagneticSpectrometer.h.

◆ fCoilW

Double_t MagneticSpectrometer::fCoilW
protected

Definition at line 140 of file MagneticSpectrometer.h.

◆ fDesign

Int_t MagneticSpectrometer::fDesign
protected

Definition at line 112 of file MagneticSpectrometer.h.

◆ fELoss

Double32_t MagneticSpectrometer::fELoss
private

length

Definition at line 101 of file MagneticSpectrometer.h.

◆ fField

Double_t MagneticSpectrometer::fField
protected

Definition at line 128 of file MagneticSpectrometer.h.

◆ fGapDown

Double_t MagneticSpectrometer::fGapDown
protected

Definition at line 126 of file MagneticSpectrometer.h.

◆ fGapMiddle

Double_t MagneticSpectrometer::fGapMiddle
protected

Definition at line 127 of file MagneticSpectrometer.h.

◆ fLength

Double32_t MagneticSpectrometer::fLength
private

time

Definition at line 100 of file MagneticSpectrometer.h.

◆ fMom

TLorentzVector MagneticSpectrometer::fMom
private

position at entrance

Definition at line 98 of file MagneticSpectrometer.h.

◆ fNCoil

Int_t MagneticSpectrometer::fNCoil
protected

Definition at line 141 of file MagneticSpectrometer.h.

◆ fNFe

Int_t MagneticSpectrometer::fNFe
protected

Definition at line 117 of file MagneticSpectrometer.h.

◆ fNRpc

Int_t MagneticSpectrometer::fNRpc
protected

Definition at line 118 of file MagneticSpectrometer.h.

◆ fPdgCode

Int_t MagneticSpectrometer::fPdgCode
private

track index

Definition at line 95 of file MagneticSpectrometer.h.

◆ fPillarX

Double_t MagneticSpectrometer::fPillarX
protected

Definition at line 158 of file MagneticSpectrometer.h.

◆ fPillarY

Double_t MagneticSpectrometer::fPillarY
protected

Definition at line 159 of file MagneticSpectrometer.h.

◆ fPillarZ

Double_t MagneticSpectrometer::fPillarZ
protected

Definition at line 160 of file MagneticSpectrometer.h.

◆ fPos

TLorentzVector MagneticSpectrometer::fPos
private

volume id

Definition at line 97 of file MagneticSpectrometer.h.

◆ fShipRpcPointCollection

TClonesArray* MagneticSpectrometer::fShipRpcPointCollection
private

energy loss

container for data points

Definition at line 104 of file MagneticSpectrometer.h.

◆ fTime

Double32_t MagneticSpectrometer::fTime
private

momentum at entrance

Definition at line 99 of file MagneticSpectrometer.h.

◆ fTrackID

Int_t MagneticSpectrometer::fTrackID
private

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

Definition at line 94 of file MagneticSpectrometer.h.

◆ fVolumeID

Int_t MagneticSpectrometer::fVolumeID
private

pdg code

Definition at line 96 of file MagneticSpectrometer.h.

◆ fXEle

Double_t MagneticSpectrometer::fXEle
protected

Definition at line 150 of file MagneticSpectrometer.h.

◆ fXFe

Double_t MagneticSpectrometer::fXFe
protected

Definition at line 119 of file MagneticSpectrometer.h.

◆ fXGas

Double_t MagneticSpectrometer::fXGas
protected

Definition at line 153 of file MagneticSpectrometer.h.

◆ fXPet

Double_t MagneticSpectrometer::fXPet
protected

Definition at line 147 of file MagneticSpectrometer.h.

◆ fXRpc

Double_t MagneticSpectrometer::fXRpc
protected

Definition at line 120 of file MagneticSpectrometer.h.

◆ fXRyoke

Double_t MagneticSpectrometer::fXRyoke
protected

Definition at line 129 of file MagneticSpectrometer.h.

◆ fXRyoke_s

Double_t MagneticSpectrometer::fXRyoke_s
protected

Definition at line 134 of file MagneticSpectrometer.h.

◆ fXStrip

Double_t MagneticSpectrometer::fXStrip
protected

Definition at line 144 of file MagneticSpectrometer.h.

◆ fXtot

Double_t MagneticSpectrometer::fXtot
protected

Definition at line 114 of file MagneticSpectrometer.h.

◆ fYEle

Double_t MagneticSpectrometer::fYEle
protected

Definition at line 151 of file MagneticSpectrometer.h.

◆ fYFe

Double_t MagneticSpectrometer::fYFe
protected

Definition at line 121 of file MagneticSpectrometer.h.

◆ fYGas

Double_t MagneticSpectrometer::fYGas
protected

Definition at line 154 of file MagneticSpectrometer.h.

◆ fYPet

Double_t MagneticSpectrometer::fYPet
protected

Definition at line 148 of file MagneticSpectrometer.h.

◆ fYRpc

Double_t MagneticSpectrometer::fYRpc
protected

Definition at line 122 of file MagneticSpectrometer.h.

◆ fYRyoke

Double_t MagneticSpectrometer::fYRyoke
protected

Definition at line 130 of file MagneticSpectrometer.h.

◆ fYRyoke_s

Double_t MagneticSpectrometer::fYRyoke_s
protected

Definition at line 135 of file MagneticSpectrometer.h.

◆ fYStrip

Double_t MagneticSpectrometer::fYStrip
protected

Definition at line 145 of file MagneticSpectrometer.h.

◆ fYtot

Double_t MagneticSpectrometer::fYtot
protected

Definition at line 115 of file MagneticSpectrometer.h.

◆ fZArm

Double_t MagneticSpectrometer::fZArm
protected

Definition at line 125 of file MagneticSpectrometer.h.

◆ fZcenter

Double_t MagneticSpectrometer::fZcenter
protected

Definition at line 113 of file MagneticSpectrometer.h.

◆ fZEle

Double_t MagneticSpectrometer::fZEle
protected

Definition at line 152 of file MagneticSpectrometer.h.

◆ fZFe

Double_t MagneticSpectrometer::fZFe
protected

Definition at line 123 of file MagneticSpectrometer.h.

◆ fZGas

Double_t MagneticSpectrometer::fZGas
protected

Definition at line 155 of file MagneticSpectrometer.h.

◆ fZPet

Double_t MagneticSpectrometer::fZPet
protected

Definition at line 149 of file MagneticSpectrometer.h.

◆ fZRpc

Double_t MagneticSpectrometer::fZRpc
protected

Definition at line 124 of file MagneticSpectrometer.h.

◆ fZRyoke

Double_t MagneticSpectrometer::fZRyoke
protected

Definition at line 131 of file MagneticSpectrometer.h.

◆ fZRyoke_s

Double_t MagneticSpectrometer::fZRyoke_s
protected

Definition at line 136 of file MagneticSpectrometer.h.

◆ fZStrip

Double_t MagneticSpectrometer::fZStrip
protected

Definition at line 146 of file MagneticSpectrometer.h.

◆ fZtot

Double_t MagneticSpectrometer::fZtot
protected

Definition at line 116 of file MagneticSpectrometer.h.


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