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);
29 std::vector<double> en;
30 double momBin[16] = {2, 3, 5, 7, 10, 15, 20, 30, 50, 75, 100, 150, 250, 350, 500, 1000};
32 en.push_back(momBin[
i]);
37 for (
int i = 0; i <
n; ++
i) {
40 TFile*
theFile =
new TFile(fn.c_str(),
"READ");
41 TTree*
theTree = (TTree*)gDirectory->Get(
"g4SimHits/CherenkovPhotons");
49 for (
int kk = 0;
kk < 10000; ++
kk) {
57 theTree->SetBranchAddress(
"nphot", &nphot);
58 theTree->SetBranchAddress(
"x", &x);
59 theTree->SetBranchAddress(
"y", &y);
60 theTree->SetBranchAddress(
"z", &z);
61 theTree->SetBranchAddress(
"t", &t);
62 theTree->SetBranchAddress(
"lambda", &lambda);
63 theTree->SetBranchAddress(
"fiberId", &fiberId);
64 int nentries =
int(theTree->GetEntries());
69 for (
int iev = 0; iev < nentries; iev++) {
70 nbytes += theTree->GetEntry(iev);
71 if (particle ==
"electron") {
77 float nphot_short = 0;
79 for (
int iph = 0; iph < nphot; ++iph) {
80 if (fiberId[iph] == 1) {
89 if (particle ==
"electron") {
98 if (particle ==
"electron") {
99 LibTree->SetBranchStatus(
"hadParticles",
false);
101 LibTree->SetBranchStatus(
"emParticles",
false);
104 if (particle ==
"electron") {
132 while (!
input.eof()) {
133 input >> theFileName >> thePID >> mom;
136 aFile.
name = theFileName;
144 input.ignore(999,
'\n');
T getParameter(std::string const &) const
math::XYZPointF Point
point in the space
edm::Service< TFileService > fs
static std::string const input
#define DEFINE_FWK_MODULE(type)
~HcalForwardLibWriter() override
TFile & file() const
return opened TFile
HcalForwardLibWriter(const edm::ParameterSet &)
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< FileHandle > theFileHandle
HFShowerPhotonCollection hadColl
HFShowerPhotonCollection emColl