EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
digitization.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file digitization.C
1 
2 //
3 // Converts MC points to hits in calorimeter cells; allows to account
4 // for light output per GeV of deposited energy, noise, attenuation length, etc.;
5 //
6 
8 {
9  // Create generic analysis run manager; configure it for digitization;
10  auto fRun = new EicRunAna();
11  fRun->SetInputFile ("simulation.root");
12  fRun->SetOutputFile("digitization.root");
13 
14  // Declare and configure a *standard* calorimeter digitization task;
15  auto calo = new EicCalorimeterDigiHitProducer("FHAC");
16  // Scintillating plates will be used as sensitive volumes;
17  // 12.6 here is the Birk's constant for polystyrene;
18  calo->DeclareDigiSensitiveVolume("FhacScintillatorPlate", 12.6);
19 
20  // Number of "primary" photons is calculated based on expected (say, experimentally measured)
21  // light output per GeV of deposited energy; it is assumed that light can be collected on
22  // upstream and downstream ends of "long objects" (like typical calorimeter matrix crystals),
23  // so that attenuation length can be accounted; either end can be a 100% efficient sensor or
24  // a mirror with reflection in the range [0.0 .. 1.0]; sensor (and other types of)
25  // inefficiencies are accounted effectively via light output setting (see below);
26  calo->ConfigureUpstreamSensorGroup(CalorimeterSensorGroup::Reflection, 0.0);
27  calo->ConfigureDownstreamSensorGroup(CalorimeterSensorGroup::Sensor);
28  // Either qAPD or qSiPM; digitization options differ a bit (see below);
29  calo->SetSensorType(CalorimeterDigiParData::SiPM);
30 
31  // In [cm]; large value basically means "no attenuation" mode;
32  calo->SetAttenuationLength(10000.);
33  calo->SetZBinning(20);
34 
35  // In photons; this threshold is used just to remove very low energy cells;
36  calo->SetCleanupThreshold(1);
37 
38  // APD-related section; see other sources (like PANDA EMC TDR) for exact meaning
39  // and typical values of ENF and ENC;
40  //calo->setApdGainFactor(50);
41  //calo->setApdExcessNoiseFactor(1.);
42  //calo->setApdEquivalentNoiseCharge(4200.);
43  //
44  // SiPM-related section;
45  // Noise, in counts per [ns]; setTimingGate() setting matter (see below);
46  //cemc->setSipmNoiseLevel(40E-3);
47 
48  // For sampling calorimeters (like HCal in this example): average number of photons
49  // which are supposed to be produced per GeV of dE/dx energy deposited by shower particles
50  // (after Birk's correction) in the *sensitive* material, under assumption that
51  // *all* this light is collected by upstream and downstream sensors and there is
52  // *no* attenuation; the number should be tuned in such a way, that at given
53  // attenuation length and registration efficiency number of photons per GeV of
54  // incoming particle energy is roughly equal to the test-run measured one; this
55  // effectively takes into account sampling fraction for the defined geometry,
56  // capturing efficiency in the fibers (plates), etc; see respective 1D histogram
57  // in the reconstruction.root file (provided RequestLightYieldPlot() is called
58  // in the reconstruction.C);
59  calo->SetPrimaryLightYield(12000.);
60 
61  // Put some realistic timing numbers here; times in [ns]; light velocity in [cm/ns];
62  calo->SetTimingGate(0., 100.);
63  calo->SetDecayConstant(6.5);
64  calo->SetLightPropagationVelocity(100./7);
65 
66  fRun->AddTask(calo);
67 
68  // Initialize and run digitization; exit at the end;
69  fRun->Run();
70 } // digitization()