75 if (pName.find(
'.') == 0)
85 LibTree =
new TTree(
"HFSimHits",
"HFSimHits");
89 partsEm =
new std::vector<float>();
98 desc.add<
int>(
"Nbins", 16);
99 desc.add<
int>(
"Nshowers", 10000);
100 desc.add<
int>(
"BufSize", 1);
101 desc.add<
int>(
"SplitLevel", 2);
102 desc.add<
int>(
"CompressionAlgo", 4);
103 desc.add<
int>(
"CompressionLevel", 4);
104 descriptions.
add(
"hcalForwardLibWriterParameters",
desc);
109 std::vector<double> en;
110 double momBin[16] = {2, 3, 5, 7, 10, 15, 20, 30, 50, 75, 100, 150, 250, 350, 500, 1000};
113 en.push_back(momBin[
i]);
121 for (
int i = 0;
i <
n; ++
i) {
127 TFile*
theFile =
new TFile(
fn.c_str(),
"READ");
128 TTree*
theTree = (TTree*)gDirectory->Get(
"g4SimHits/CherenkovPhotons");
131 const int size = 10000;
133 edm::LogError(
"HcalForwardLibWriter") <<
"Too big Nshowers number";
137 float x[
size] = {0.};
138 float y[
size] = {0.};
139 float z[
size] = {0.};
140 float t[
size] = {0.};
141 float lambda[
size] = {0.};
142 int fiberId[
size] = {0};
145 theTree->SetBranchAddress(
"nphot", &nphot);
150 theTree->SetBranchAddress(
"lambda", &lambda);
151 theTree->SetBranchAddress(
"fiberId", &fiberId);
152 theTree->SetBranchAddress(
"primZ", &primZ);
156 for (
int iev = 0;
iev < nentries;
iev++) {
162 unsigned int nph = nphot;
163 if (particle ==
"electron") {
173 for (
int iph = 0; iph < nphot; ++iph) {
174 if (fiberId[iph] != 1) {
178 if (particle ==
"electron") {
179 (*partsEm)[iph] = (
x[iph]);
180 (*partsEm)[iph + 1 * nph] = (
y[iph]);
181 (*partsEm)[iph + 2 * nph] = (
z[iph]);
182 (*partsEm)[iph + 3 * nph] = (
t[iph]);
183 (*partsEm)[iph + 4 * nph] = (lambda[iph]);
185 (*partsHad)[iph] = (
x[iph]);
186 (*partsHad)[iph + 1 * nph] = (
y[iph]);
187 (*partsHad)[iph + 2 * nph] = (
z[iph]);
188 (*partsHad)[iph + 3 * nph] = (
t[iph]);
189 (*partsHad)[iph + 4 * nph] = (lambda[iph]);
194 if (particle ==
"electron") {
229 while (!
input.eof()) {
230 input >> theFileName >> thePID >> mom;
233 aFile.
name = theFileName;
241 input.ignore(999,
'\n');
T getParameter(std::string const &) const
TkSoAView< TrackerTraits > HitToTuple< TrackerTraits > const *__restrict__ int32_t int32_t int iev
HFShowerLibraryEventInfo evtInfo
Log< level::Error, false > LogError
std::vector< float > * partsEm
static std::string const input
std::vector< HFShowerPhoton > HFShowerPhotonCollection
#define DEFINE_FWK_MODULE(type)
~HcalForwardLibWriter() override
std::vector< float > * partsHad
HcalForwardLibWriter(const edm::ParameterSet &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< FileHandle > theFileHandle
HFShowerPhotonCollection hadColl
HFShowerPhotonCollection emColl