|
|
Go to the documentation of this file.
14 #include "G4VPhysicalVolume.hh"
17 #include "G4ParticleTable.hh"
18 #include "Randomize.hh"
19 #include "CLHEP/Units/PhysicalConstants.h"
20 #include "CLHEP/Units/SystemOfUnits.h"
26 #include "TBranchObject.h"
80 if (pTreeName.find(
".") == 0)
81 pTreeName.erase(0, 2);
82 const char* nTree = pTreeName.c_str();
83 hf = TFile::Open(nTree);
87 edm::LogError(
"CastorShower") <<
"CastorShowerLibrary: opening " << nTree <<
" failed";
88 throw cms::Exception(
"Unknown",
"CastorShowerLibrary") <<
"Opening of " << pTreeName <<
" fails\n";
90 edm::LogVerbatim(
"CastorShower") <<
"CastorShowerLibrary: opening " << nTree <<
" successfully";
94 TTree*
event = (TTree*)
hf->Get(
"CastorCherenkovPhotons");
96 evtInfo = (TBranchObject*)
event->GetBranch(branchEvInfo.c_str());
100 edm::LogError(
"CastorShower") <<
"CastorShowerLibrary: " << branchEvInfo.c_str()
101 <<
" Branch does not exit in Event";
102 throw cms::Exception(
"Unknown",
"CastorShowerLibrary") <<
"Event information absent\n";
105 edm::LogError(
"CastorShower") <<
"CastorShowerLibrary: Events Tree does not exist";
106 throw cms::Exception(
"Unknown",
"CastorShowerLibrary") <<
"Events tree absent\n";
110 emBranch = (TBranchObject*)
event->GetBranch(branchEM.c_str());
117 <<
" entries and Branch " << branchHAD <<
" has " <<
hadBranch->GetEntries()
154 edm::LogVerbatim(
"CastorShower") <<
" CastorShowerLibrary::loadEventInfo : "
155 <<
"\n \n Total number of events : " <<
totEvents
156 <<
"\n Number of bins (E) : " <<
nBinsE
158 <<
"\n Number of bins (Eta) : " <<
nBinsEta
160 <<
"\n Number of bins (Phi) : " <<
nBinsPhi
161 <<
"\n Number of events/bin (Phi) : " <<
nEvtPerBinPhi <<
"\n";
163 std::stringstream ss1;
164 ss1 <<
"CastorShowerLibrary: energies in GeV:\n";
165 for (
unsigned int i = 0;
i <
nBinsE; ++
i) {
166 if (
i > 0 &&
i / 10 * 10 ==
i) {
171 ss1 <<
"\nCastorShowerLibrary: etas:\n";
173 if (
i > 0 &&
i / 10 * 10 ==
i) {
178 ss1 <<
"\nCastorShowerLibrary: phis:\n";
180 if (
i > 0 &&
i / 10 * 10 ==
i) {
191 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
192 G4Track*
track = aStep->GetTrack();
194 const G4ThreeVector& hitPoint = preStepPoint->GetPosition();
206 double pin = preStepPoint->GetTotalEnergy();
207 double zint = hitPoint.z();
208 double R =
sqrt(hitPoint.x() * hitPoint.x() + hitPoint.y() * hitPoint.y());
210 double phiin = atan2(hitPoint.y(), hitPoint.x());
218 select(0, pin, etain, phiin);
220 select(1, pin, etain, phiin);
223 hit = (*showerEvent);
242 LogDebug(
"CastorShower") <<
"CastorShowerLibrary::getRecord: ";
256 LogDebug(
"CastorShower") <<
"CastorShowerLibrary::getRecord: Record " <<
record <<
" of type " <<
type <<
" with "
257 << nHit <<
" CastorShowerHits";
280 double r = G4UniformRand();
298 phiin = phiin +
M_PI;
302 double remainder = fmod(phiin,
phiMax);
303 phiin =
phiMin + remainder;
320 edm::LogVerbatim(
"CastorShower") <<
"CastorShowerLibrary:: Select record " << irec <<
" of type " <<
type;
std::vector< double > SLphis
void initFile(edm::ParameterSet const &)
std::vector< double > SLetas
CastorShowerEvent getShowerHits(const G4Step *, bool &)
T getUntrackedParameter(std::string const &, T const &) const
int FindEnergyBin(double)
static bool isGammaElectronPositron(int pdgCode)
unsigned int nEvtPerBinPhi
CastorShowerLibrary(const std::string &name, edm::ParameterSet const &p)
void select(int, double, double=0, double=9)
Geom::Theta< T > theta() const
unsigned int getNEvtPerBin()
Tan< T >::type tan(const T &t)
TBranchObject * hadBranch
T getParameter(std::string const &) const
unsigned int nEvtPerBinEta
static bool isStableHadronIon(const G4Track *)
std::vector< double > SLenergies
CastorShowerLibraryInfo * eventInfo
void loadEventInfo(TBranchObject *)
CastorShowerEvent * showerEvent
Abs< T >::type abs(const T &t)