13 if (pName.find(
".") == 0)
20 LibTree =
new TTree(
"HFSimHits",
"HFSimHits");
21 LibTree->Branch(
"emParticles",
"HFShowerPhotons-emParticles", &
emColl, bsize);
22 LibTree->Branch(
"hadParticles",
"HFShowerPhotons-hadParticles", &
hadColl, bsize);
31 std::vector<double> en;
32 double momBin[16] = {2,3,5,7,10,15,20,30,50,75,100,150,250,350,500,1000};
33 for (
int i = 0;
i <
nbins; ++
i) en.push_back(momBin[
i]);
38 for (
int i = 0; i <
n; ++
i) {
41 TFile*
theFile =
new TFile(fn.c_str(),
"READ");
42 TTree *
theTree = (TTree*)gDirectory->Get(
"g4SimHits/CherenkovPhotons");
50 for (
int kk = 0;
kk < 10000; ++
kk) {
58 theTree->SetBranchAddress(
"nphot", &nphot);
59 theTree->SetBranchAddress(
"x", &x);
60 theTree->SetBranchAddress(
"y", &y);
61 theTree->SetBranchAddress(
"z", &z);
62 theTree->SetBranchAddress(
"t", &t);
63 theTree->SetBranchAddress(
"lambda", &lambda);
64 theTree->SetBranchAddress(
"fiberId", &fiberId);
65 int nentries =
int(theTree->GetEntries());
66 if(nentries>5000) nentries=5000;
69 for (
int iev = 0; iev < nentries; iev++) {
70 nbytes += theTree->GetEntry(iev);
71 if (particle ==
"electron") {
79 for (
int iph = 0; iph < nphot; ++iph) {
81 if (fiberId[iph]==1) {
90 if (particle ==
"electron") {
99 if (particle ==
"electron") {
100 LibTree->SetBranchStatus(
"hadParticles",0);
102 LibTree->SetBranchStatus(
"emParticles",0);
105 if (particle ==
"electron") {
134 while (!
input.eof()) {
135 input >> theFileName >> thePID >> mom;
138 aFile.
name = theFileName;
146 input.ignore(999,
'\n');
T getParameter(std::string const &) const
math::XYZPointF Point
point in the space
#define DEFINE_FWK_MODULE(type)
edm::Service< TFileService > fs
static std::string const input
virtual void analyze(const edm::Event &, const edm::EventSetup &)
TFile & file() const
return opened TFile
HcalForwardLibWriter(const edm::ParameterSet &)
std::vector< FileHandle > theFileHandle
HFShowerPhotonCollection hadColl
HFShowerPhotonCollection emColl