Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:35

0001 #include "SimGeneral/GFlash/interface/GflashHistogram.h"
0002 
0003 GflashHistogram *GflashHistogram::instance_ = nullptr;
0004 
0005 GflashHistogram *GflashHistogram::instance() {
0006   if (instance_ == nullptr)
0007     instance_ = new GflashHistogram();
0008   return instance_;
0009 }
0010 
0011 GflashHistogram::GflashHistogram() : theStoreFlag(false) {}
0012 
0013 void GflashHistogram::bookHistogram(std::string histFileName) {
0014   histFile_ = new TFile(histFileName.c_str(), "RECREATE");
0015 
0016   TH1::AddDirectory(kTRUE);
0017 
0018   histFile_->mkdir("GflashEMShowerProfile");
0019   histFile_->cd("GflashEMShowerProfile");
0020 
0021   em_incE = new TH1F("em_incE", "Incoming energy at Ecal;E (GeV);Number of Events", 500, 0.0, 500.0);
0022   em_ssp_rho = new TH1F("em_ssp_rho", "Shower starting position;#rho (cm);Number of Events", 100, 100.0, 200.0);
0023   em_ssp_z = new TH1F("em_ssp_z", "Shower starting position;z (cm);Number of Events", 800, -400.0, 400.0);
0024   em_long = new TH1F("em_long", "Longitudinal Profile;Radiation Length;Number of Spots", 100, 0.0, 50.0);
0025   em_lateral = new TH2F(
0026       "em_lateral", "Lateral Profile vs. Shower Depth;Radiation Length;Moliere Radius", 100, 0.0, 50.0, 100, 0.0, 3.0);
0027   em_long_sd = new TH1F("em_long_sd",
0028                         "Longitudinal Profile in Sensitive Detector;Radiation "
0029                         "Length;Number of Spots",
0030                         100,
0031                         0.0,
0032                         50.0);
0033   em_lateral_sd = new TH2F("em_lateral_sd",
0034                            "Lateral Profile vs. Shower Depth in Sensitive "
0035                            "Detector;Radiation Length;Moliere Radius",
0036                            100,
0037                            0.0,
0038                            50.0,
0039                            100,
0040                            0.0,
0041                            3.0);
0042   em_nSpots_sd = new TH1F("em_nSpots_sd",
0043                           "Number of Gflash Spots in Sensitive Detector;Number "
0044                           "of Spots;Number of Events",
0045                           1000,
0046                           0.0,
0047                           100000);
0048 
0049   histFile_->mkdir("GflashHadronShowerModel");
0050   histFile_->cd("GflashHadronShowerModel");
0051 
0052   preStepPosition = new TH1F("preStepPosition", "PreStep Position Shower", 500, 120.0, 270.);
0053   postStepPosition = new TH1F("postStepPosition", "PostStep Position Shower", 500, 120.0, 270.);
0054   deltaStep = new TH1F("deltaStep", "Delta Step", 200, 0.0, 100.);
0055   kineticEnergy = new TH1F("kineticEnergy", "Kinetic Energy", 200, 0.0, 200.);
0056   energyLoss = new TH1F("energyLoss", "Energy Loss", 200, 0.0, 200.);
0057   energyRatio = new TH1F("energyRatio", "energyLeading/energyTotal", 200, 0.0, 1.);
0058 
0059   histFile_->mkdir("GflashHadronShowerProfile");
0060   histFile_->cd("GflashHadronShowerProfile");
0061 
0062   rshower = new TH1F("rshower", "Lateral Lever", 200, 0., 100.);
0063   lateralx = new TH1F("lateralx", "Lateral-X Distribution", 200, -100., 100.);
0064   lateraly = new TH1F("lateraly", "Lateral-Y Distribution", 200, -100., 100.);
0065   gfhlongProfile = new TH2F("gfhlongProfile", "Longitudinal Profile (all hits)", 160, 0.0, 160., 60, 125, 245);
0066 
0067   histFile_->mkdir("GflashWatcher");
0068   histFile_->cd("GflashWatcher");
0069 
0070   g4vertexTrack = new TH1F("g4vertexTrack", "Vertex of Track", 300, 0.0, 300.);
0071   g4stepCharge = new TH2F("g4stepCharge", "Geant4 Step Charge", 300, 120., 420, 5, -2.5, 2.5);
0072   g4nSecondary = new TH1F("g4nSecondary", "number of Secondaries", 100, 0.0, 100.);
0073   g4pidSecondary = new TH1F("g4pidSecondary", "PID of Secondaries", 3000, -500.0, 2500.);
0074 
0075   g4energySecondary = new TH1F("g4energySecondary", "Kinetic Energy of Secondaries", 300, 0.0, 15.);
0076   g4energyPi0 = new TH1F("g4energyPi0", "Kinetic Energy of Pi0", 300, 0.0, 15.);
0077   g4energyElectron = new TH1F("g4energyElectron", "Kinetic Energy of Electron", 300, 0.0, 15.);
0078   g4energyPhoton = new TH1F("g4energyPhoton", "Kinetic Energy of Photon", 300, 0.0, 15.);
0079 
0080   g4totalEnergySecPhoton = new TH1F("g4totalEnergySecPhoton", "Total Kinetic Energy of Sec Photon", 300, 0.0, 3.);
0081   g4totalEnergySecElectron = new TH1F("g4toalEnergySecElectron", "Total Kinetic Energy of Sec Electron", 300, 0.0, 3.);
0082   g4totalEnergySecPi0 = new TH1F("g4totalEnergySecPi0", "Total Kinetic Energy of Sec Pi0", 300, 0.0, 30.);
0083 
0084   g4energyEM = new TH1F("energyEM", "EM Energy", 600, 0.0, 150.0);
0085   g4energyHad = new TH1F("energyHad", "Had Energy", 600, 0.0, 150.0);
0086   g4energyTotal = new TH1F("energyTotal", "Total Energy", 600, 0.0, 150.0);
0087   g4energyEMMip = new TH1F("energyEMMip", "EM Energy (MIP)", 100, 0.0, 2.0);
0088   g4energyHadMip = new TH1F("energyHadMip", "Had Energy (MIP)", 600, 0.0, 150.0);
0089   g4energyMip = new TH1F("energyMip", "Total Energy (MIP)", 600, 0.0, 150.0);
0090   g4energyEMvsHad = new TH2F("energyEMvsHad", "EM Energy", 600, 0.0, 150.0, 600, 0.0, 150.0);
0091 
0092   g4energySensitiveEM = new TH1F("energySensitiveEM", "Sensitive EM Energy", 600, 0.0, 150.0);
0093   g4energySensitiveHad = new TH1F("energySensitiveHad", "Sensitive Had Energy", 600, 0.0, 150.0);
0094   g4energySensitiveTotal = new TH1F("energySensitiveTotal", "Sensitive Total Energy", 600, 0.0, 150.0);
0095   g4energyHybridTotal = new TH1F("energyHybridTotal", "Hybrid Total Energy", 600, 0.0, 150.0);
0096   g4energySensitiveEMMip = new TH1F("energySensitiveEMMip", "Sensitive EM Energy (MIP)", 100, 0.0, 2.0);
0097   g4energySensitiveEMvsHad =
0098       new TH2F("energySensitiveEMvsHad", "Sensitive EM Energy vs Had", 600, 0.0, 150.0, 600, 0.0, 150.0);
0099 
0100   g4energyEMProfile = new TH2F("energyEMProfile", "EM Energy Profile", 600, 0.0, 150.0, 60, 125, 245);
0101   g4energyHadProfile = new TH2F("energyHadProfile", "Had Energy Profile", 600, 0.0, 150.0, 60, 125, 245);
0102   g4energyTotalProfile = new TH2F("energyTotalProfile", "Total Energy Profile", 600, 0.0, 150.0, 60, 125, 245);
0103   g4energyHybridProfile = new TH2F("energyHybridProfile", "Hybrid Energy Profile", 600, 0.0, 150.0, 60, 125, 245);
0104 
0105   g4ssp = new TH1F("g4ssp", "Shower Starting Position", 160, 120.0, 280.);
0106   g4energy = new TH1F("g4energy", "Energy at Shower Starting Position", 600, 0.0, 150.0);
0107   g4energyLoss = new TH1F("g4energyLoss", "Energy Loss", 600, 0.0, 150.);
0108   g4momentum = new TH1F("g4momentum", "Momentum/GeV at Shower Starting Position", 300, 0.0, 150.0);
0109   g4charge = new TH1F("g4charge", "Track Charge at Shower Starting Position", 10, -5.0, 5.0);
0110 
0111   g4rshower = new TH2F("g4rshower", "rshower", 200, 0., 40, 25, 125., 250);
0112   g4rshowerR1 = new TH2F("g4rshowerR1", "rshower vs depth ssp=127-129", 200, 0., 40, 40, 0.0, 160.);
0113   g4rshowerR2 = new TH2F("g4rshowerR2", "rshower vs depth ssp=131-133", 200, 0., 40, 40, 0.0, 160.);
0114   g4rshowerR3 = new TH2F("g4rshowerR3", "rshower vs depth ssp=173-175", 200, 0., 40, 40, 0.0, 160.);
0115 
0116   g4lateralXY = new TH2F("g4lateralXY", "Lateral Profile XY", 160, -40., 40, 25, 125., 250);
0117   g4lateralRZ = new TH2F("g4lateralRZ", "Lateral Profile RZ", 160, -40., 40, 25, 125., 250);
0118   g4spotXY = new TH2F("g4spotXY", "x-y of spots in global coordinate", 800, -400., 400., 800, -400.0, 400.0);
0119   g4spotRZ = new TH2F("g4spotRZ", "r-z of spots in global coordinate", 1200, -1500., 1500., 400, .0, 400.0);
0120   g4spotRZ0 = new TH2F("g4spotRZ0", "all r-z of spots in global coordinate", 1200, -1500., 1500., 400, .0, 400.0);
0121 
0122   g4stepRho = new TH1F("g4stepRho", "rho of Geant4 Step", 200, 120., 320.);
0123   g4trajectoryPhi0 = new TH1F("g4trajectoryPhi0", "trajectory Phi0", 2000, -5., 5.);
0124 
0125   g4trajectoryXY = new TH2F("g4trajectoryXY", "trajectory x-y", 800, -400.0, 400.0, 800, -400.0, 400.0);
0126   g4trajectoryRZ = new TH2F("g4trajectoryRZ", "trajectory r-z ", 1200, -600.0, 600.0, 400, 0.0, 400.0);
0127 
0128   g4longProfile = new TH2F("g4longProfile", "Longitudinal Profile (all hits)", 160, 0.0, 160., 60, 125, 245);
0129   g4longDetector =
0130       new TH2F("g4longDetector", "Longitudinal Profile (hits inisde detectors)", 160, 0.0, 160., 60, 125, 245);
0131   g4longSensitive = new TH2F("g4longSensitive", "Longitudinal Profile (Sensitive)", 160, 0.0, 160., 60, 125, 245);
0132 }
0133 
0134 GflashHistogram::~GflashHistogram() {
0135   histFile_->cd();
0136   histFile_->Write();
0137   histFile_->Close();
0138 }