FairRoot/PandaRoot
Functions | Variables
sim_hit_emc.C File Reference

Go to the source code of this file.

Functions

timer Start ()
 
fRun SetName ("TGeant3")
 
fRun SetOutputFile ("sim_hit_emc.root")
 
fRun SetMaterials ("media_pnd.geo")
 
Cave SetGeometryFileName ("pndcave.geo")
 
fRun AddModule (Cave)
 
Magnet SetGeometryFileName ("FullSolenoid.root")
 
fRun AddModule (Magnet)
 
Dipole SetGeometryFileName ("dipole.geo")
 
fRun AddModule (Dipole)
 
fRun AddModule (Pipe)
 
Stt SetGeometryFileName ("straws_skewed_blocks_35cm_pipe.geo")
 
fRun AddModule (Stt)
 
Mvd SetGeometryFileName ("MVD_v1.0_woPassiveTraps.root")
 
fRun AddModule (Mvd)
 
Emc SetGeometryFileNameTriple ("emc_module125.dat","emc_module3new.root","emc_module4_StraightGeo24.4.root")
 
fRun AddModule (Emc)
 
Tof SetGeometryFileName ("tofbarrel.geo")
 
fRun AddModule (Tof)
 
Muo SetBarrel ("torino")
 
Muo SetEndcap ("torino")
 
Muo SetMuonFilter ("torino")
 
Muo SetMdtMagnet (kTRUE)
 
Muo SetMdtMFIron (kTRUE)
 
fRun AddModule (Muo)
 
Drc SetRunCherenkov (kFALSE)
 
fRun AddModule (Drc)
 
fRun SetGenerator (primGen)
 
boxGen SetPRange (1., 1.)
 
boxGen SetPhiRange (0., 360.)
 
boxGen SetThetaRange (0., 180.)
 
boxGen SetXYZ (0., 0., 0.)
 
primGen AddGenerator (boxGen)
 
fRun SetBeamMom (15)
 
fField AddField (map_t)
 
fField AddField (map_d1)
 
fField AddField (map_d2)
 
fField AddField (map_s1)
 
fField AddField (map_s2)
 
fField AddField (map_s3)
 
fField AddField (map_s4)
 
fRun SetField (fField)
 
parIo1 open (emcDigiFile.Data(),"in")
 
rtdb setFirstInput (parIo1)
 
output open ("simparams.root")
 
rtdb setOutput (output)
 
fRun AddTask (emcHitProd)
 
fRun Init ()
 
 if (fField)
 
Par setInputVersion (fRun->GetRunId(), 1)
 
Par setChanged ()
 
rtdb saveOutput ()
 
fRun Run (nEvents)
 
timer Stop ()
 
 printf ("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
 

Variables

 gDebug =0
 
FairRunSim * fRun = new FairRunSim()
 
TString digiFile = "emc.par"
 
TString parFile = "simparams.root"
 
Int_t nEvents = 10
 
FairModule * Cave = new PndCave("CAVE")
 
FairModule * Magnet = new PndMagnet("MAGNET")
 
FairModule * Dipole = new PndMagnet("MAGNET")
 
FairModule * Pipe = new PndPipe("PIPE")
 
FairDetector * Stt = new PndStt("STT", kTRUE)
 
FairDetector * Mvd = new PndMvdDetector("MVD", kTRUE)
 
PndEmcEmc = new PndEmc("EMC",kTRUE)
 
FairDetector * Tof = new PndTof("TOF",kTRUE)
 
PndMdtMuo = new PndMdt("MDT",kTRUE)
 
PndDrcDrc = new PndDrc("DIRC", kTRUE)
 
FairPrimaryGenerator * primGen = new FairPrimaryGenerator()
 
FairBoxGenerator * boxGen = new FairBoxGenerator(22, 5)
 
PndMultiFieldfField = new PndMultiField()
 
PndTransMapmap_t = new PndTransMap("TransMap", "R")
 
PndDipoleMapmap_d1 = new PndDipoleMap("DipoleMap1", "R")
 
PndDipoleMapmap_d2 = new PndDipoleMap("DipoleMap2", "R")
 
PndSolenoidMapmap_s1 = new PndSolenoidMap("SolenoidMap1", "R")
 
PndSolenoidMapmap_s2 = new PndSolenoidMap("SolenoidMap2", "R")
 
PndSolenoidMapmap_s3 = new PndSolenoidMap("SolenoidMap3", "R")
 
PndSolenoidMapmap_s4 = new PndSolenoidMap("SolenoidMap4", "R")
 
TString emcDigiFile = gSystem->Getenv("VMCWORKDIR")
 
FairRuntimeDb * rtdb = fRun->GetRuntimeDb()
 
FairParAsciiFileIo * parIo1 = new FairParAsciiFileIo()
 
Bool_t kParameterMerged =kTRUE
 
FairParRootFileIo * output =new FairParRootFileIo(kParameterMerged)
 
PndEmcHitProduceremcHitProd = new PndEmcHitProducer()
 
PndMultiFieldParPar = (PndMultiFieldPar*) rtdb->getContainer("PndMultiFieldPar")
 
Double_t rtime = timer.RealTime()
 
Double_t ctime = timer.CpuTime()
 

Function Documentation

fField AddField ( map_t  )
fField AddField ( map_d1  )
fField AddField ( map_d2  )
fField AddField ( map_s1  )
fField AddField ( map_s2  )
fField AddField ( map_s3  )
fField AddField ( map_s4  )
primGen AddGenerator ( boxGen  )
fRun AddModule ( Cave  )
fRun AddModule ( Magnet  )
fRun AddModule ( Dipole  )
fRun AddModule ( Pipe  )
fRun AddModule ( Stt  )
fRun AddModule ( Mvd  )
fRun AddModule ( Emc  )
fRun AddModule ( Tof  )
fRun AddModule ( Muo  )
fRun AddModule ( Drc  )
fRun AddTask ( emcHitProd  )
if ( fField  )

Definition at line 163 of file sim_hit_emc.C.

References PndMultiFieldPar::SetParameters().

163 { Par->SetParameters(fField); }
PndMultiField * fField
Definition: sim_emc_apd.C:97
void SetParameters(FairField *field)
PndMultiFieldPar * Par
Definition: sim_emc_apd.C:115
fRun Init ( )

Initialize the session

Definition at line 20 of file NHitsPerEvent.C.

21 {
22  TFile* f = new TFile("2014-10-27-00-06-02_50_MHz_Filtered_PosCorrected_Event.root", "READ");
23  t = (TTree*)f->Get("pndsim");
24 // t->AddFriend("pndsim", "2014-10-27-00-06-02_50_MHz_Filtered_PosCorrected_Residuals.root");
25 // t->AddFriend("pndsim", "2014-10-27-00-06-02_50_MHz_Filtered_PosCorrected_Track.root");
26 // t->AddFriend("pndsim", "2014-10-27-00-06-02_50_MHz_Filtered_TimeCorrectedSorted_Event.root");
27  t->StartViewer();
28 
29  t->SetBranchAddress("MVDHitsPixelPosCorrected", &mvdHitArray);
30 // t->SetBranchAddress("MvdProjectedHit", &mvdProjectedArray);
31 // t->SetBranchAddress("MvdTrack", &trackArray);
32 
33  gHitPoints->SetLineColor(kRed);
34  gHitPoints->SetMarkerStyle(2);
35  gHitPoints->SetMarkerColor(kRed);
36 
37  gProjections->SetLineColor(kBlue);
38  gProjections->SetMarkerStyle(5);
39  gProjections->SetMarkerColor(kBlue);
40 
41 
42 // mg->Add(gProjections, "Projected");
43  mg->Add(gHitPoints, "Hits");
44  t->GetEntry(0);
45 }
TMultiGraph * mg
Definition: NHitsPerEvent.C:17
TGraph * gHitPoints
Definition: NHitsPerEvent.C:15
TClonesArray * mvdHitArray
Definition: NHitsPerEvent.C:12
TFile * f
Definition: bump_analys.C:12
TTree * t
Definition: bump_analys.C:13
TGraph * gProjections
Definition: NHitsPerEvent.C:16
parIo1 open ( emcDigiFile.  Data(),
"in"   
)
output open ( "simparams.root"  )
printf ( RealTime = %f seconds)
fRun Run ( nEvents  )
rtdb saveOutput ( )

All parameters are initialized and ready to be saved

Muo SetBarrel ( "torino"  )
fRun SetBeamMom ( 15  )
Par setChanged ( )
Muo SetEndcap ( "torino"  )
fRun SetField ( fField  )
rtdb setFirstInput ( parIo1  )
fRun SetGenerator ( primGen  )
Cave SetGeometryFileName ( "pndcave.geo"  )
Magnet SetGeometryFileName ( "FullSolenoid.root"  )
Dipole SetGeometryFileName ( "dipole.geo"  )
Stt SetGeometryFileName ( "straws_skewed_blocks_35cm_pipe.geo"  )
Mvd SetGeometryFileName ( "MVD_v1.0_woPassiveTraps.root"  )
Tof SetGeometryFileName ( "tofbarrel.geo"  )
Emc SetGeometryFileNameTriple ( "emc_module125.dat"  ,
"emc_module3new.root"  ,
"emc_module4_StraightGeo24.4.root"   
)
Par setInputVersion ( fRun->  GetRunId(),
 
)
fRun SetMaterials ( "media_pnd.geo"  )
Muo SetMdtMagnet ( kTRUE  )
Muo SetMdtMFIron ( kTRUE  )
Muo SetMuonFilter ( "torino"  )
fRun SetName ( "TGeant3"  )
rtdb setOutput ( output  )
fRun SetOutputFile ( "sim_hit_emc.root"  )
boxGen SetPhiRange ( 0.  ,
360.   
)
boxGen SetPRange ( 1.  ,
1.   
)
Drc SetRunCherenkov ( kFALSE  )
boxGen7 SetThetaRange ( 0.  ,
180.   
)
boxGen SetXYZ ( 0.  ,
0.  ,
0.   
)
timer Start ( )

Modified 17.12.08 by M. Al-Turany The hit producing is added to the simulation session, so that the EmcHits are produced on the fly during the simulation

timer Stop ( )

Variable Documentation

FairBoxGenerator* boxGen = new FairBoxGenerator(22, 5)

Definition at line 94 of file sim_hit_emc.C.

FairModule* Cave = new PndCave("CAVE")

Definition at line 43 of file sim_hit_emc.C.

Double_t ctime = timer.CpuTime()

Definition at line 178 of file sim_hit_emc.C.

TString digiFile = "emc.par"

Definition at line 22 of file sim_hit_emc.C.

FairModule* Dipole = new PndMagnet("MAGNET")

Definition at line 51 of file sim_hit_emc.C.

PndDrc* Drc = new PndDrc("DIRC", kTRUE)

Definition at line 83 of file sim_hit_emc.C.

PndEmc* Emc = new PndEmc("EMC",kTRUE)

Definition at line 66 of file sim_hit_emc.C.

emcDigiFile = gSystem->Getenv("VMCWORKDIR")

Set the digitization parameters

Definition at line 130 of file sim_hit_emc.C.

PndEmcHitProducer* emcHitProd = new PndEmcHitProducer()

Add Hit producer task to the simulation

Definition at line 150 of file sim_hit_emc.C.

PndMultiField* fField = new PndMultiField()

Definition at line 107 of file sim_hit_emc.C.

FairRunSim* fRun = new FairRunSim()

Definition at line 20 of file sim_hit_emc.C.

gDebug =0

Definition at line 12 of file sim_hit_emc.C.

Bool_t kParameterMerged =kTRUE

Definition at line 138 of file sim_hit_emc.C.

FairModule* Magnet = new PndMagnet("MAGNET")

Definition at line 47 of file sim_hit_emc.C.

PndDipoleMap* map_d1 = new PndDipoleMap("DipoleMap1", "R")
PndDipoleMap* map_d2 = new PndDipoleMap("DipoleMap2", "R")
PndSolenoidMap* map_s1 = new PndSolenoidMap("SolenoidMap1", "R")
PndSolenoidMap* map_s2 = new PndSolenoidMap("SolenoidMap2", "R")
PndSolenoidMap* map_s3 = new PndSolenoidMap("SolenoidMap3", "R")
PndSolenoidMap* map_s4 = new PndSolenoidMap("SolenoidMap4", "R")
PndTransMap* map_t = new PndTransMap("TransMap", "R")
PndMdt* Muo = new PndMdt("MDT",kTRUE)

Definition at line 75 of file sim_hit_emc.C.

FairDetector* Mvd = new PndMvdDetector("MVD", kTRUE)

Definition at line 62 of file sim_hit_emc.C.

Int_t nEvents = 10

Definition at line 27 of file sim_hit_emc.C.

FairParRootFileIo* output =new FairParRootFileIo(kParameterMerged)

Parameters created for this simulation goes to the out put

Definition at line 141 of file sim_hit_emc.C.

PndMultiFieldPar* Par = (PndMultiFieldPar*) rtdb->getContainer("PndMultiFieldPar")

After initialization now we can save the field parameters

Definition at line 162 of file sim_hit_emc.C.

TString parFile = "simparams.root"

Definition at line 24 of file sim_hit_emc.C.

FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo()

Definition at line 135 of file sim_hit_emc.C.

FairModule* Pipe = new PndPipe("PIPE")

Definition at line 55 of file sim_hit_emc.C.

FairPrimaryGenerator* primGen = new FairPrimaryGenerator()

Definition at line 90 of file sim_hit_emc.C.

FairRuntimeDb* rtdb = fRun->GetRuntimeDb()

Get the run time data base for this session and set the needed input

Definition at line 134 of file sim_hit_emc.C.

Double_t rtime = timer.RealTime()

Definition at line 177 of file sim_hit_emc.C.

FairDetector* Stt = new PndStt("STT", kTRUE)

Definition at line 58 of file sim_hit_emc.C.

FairDetector* Tof = new PndTof("TOF",kTRUE)

Definition at line 71 of file sim_hit_emc.C.