32 produces<HFShowerPhotonCollection> (
"emParticles");
33 produces<std::vector<HFShowerPhotonCollection> > (
"emParticlesss");
34 produces< std::vector<int> > (
"emParticles");
35 produces<HFShowerPhotonCollection> (
"hadParticles");
36 produces< std::vector<int> > (
"hadParticles");
37 produces<std::vector<HFShowerLibraryEventInfo> > (
"HFShowerLibraryEventInfo");
44 std::vector<double> energyBin;
45 double energyBin2[12] = {10,15,20,35,50,80,100,150,250,350,500,1000};
46 for (
int z = 0;
z< 12; ++
z) {energyBin.push_back(energyBin2[
z]);}
48 std::vector<HFShowerLibraryEventInfo> Info;
50 std::vector<HFShowerPhotonCollection> emCollsss;
53 fakeColl.push_back(afakePhoton);
58 std::vector<int> emCollnPhoton;
59 std::vector<int> hadCollnPhoton;
62 for (
int i = 0;
i <
n; ++
i) {
70 fFile =
new TFile(fn.c_str(),
"READ");
71 fTree = (TTree*)
fFile->FindObjectAny(
"CherenkovPhotons");
74 <<
"Cannot find TTree with name CherenkovPhotons";
83 for (
int kk = 0; kk < 10000; ++kk) {
91 fTree->SetBranchAddress(
"nphot", &nphot);
92 fTree->SetBranchAddress(
"x", &x);
93 fTree->SetBranchAddress(
"y", &y);
94 fTree->SetBranchAddress(
"z", &z);
95 fTree->SetBranchAddress(
"t", &t);
96 fTree->SetBranchAddress(
"lambda", &lambda);
97 fTree->SetBranchAddress(
"fiberId", &fiberId);
98 int nentry = int(fTree->GetEntries());
99 std::cout<<
"nenetry " << nentry<<std::endl;
100 if (particle ==
"electron") {
101 for (
int iev = 0; iev < nentry; iev++) {
102 fTree->GetEntry(iev);
104 emCollnPhoton.push_back(nphot);
105 for (
int iph = 0; iph < nphot; ++iph) {
108 emColl.push_back(aPhoton);
110 emCollsss.push_back(emColl);
114 if (particle ==
"pion") {
115 for (
int iev = 0; iev < nentry; iev++) {
116 fTree->GetEntry(iev);
117 hadCollnPhoton.push_back(nphot);
118 for (
int iph = 0; iph < nphot; ++iph) {
121 hadColl.push_back(aPhoton);
129 Info.push_back(aInfo);
131 std::auto_ptr< std::vector<HFShowerLibraryEventInfo> > product_info(
new std::vector<HFShowerLibraryEventInfo>(Info) );
133 std::auto_ptr<std::vector<HFShowerPhotonCollection> > product_emsss(
new std::vector<HFShowerPhotonCollection>(emCollsss));
134 std::cout<<
"em coll size "<<emCollsss.size()<<std::endl;
138 iEvent.
put(product_info,
"HFShowerLibraryEventInfo");
139 iEvent.
put(product_emsss,
"emParticles");
140 iEvent.
put(product_had,
"hadParticles");
151 <<
"Cannot find file" <<
fDataFile.c_str();
155 while (!
input.eof()) {
156 input >> fFileName >> fPID >> fMom;
157 std::cout <<
" using " << fFileName <<
" fPID" << fPID <<
" fMom" << fMom << std::endl;
159 std::cout <<
" using " << fFileName <<
" " << fPID <<
" " << fMom << std::endl;
161 aFile.
name = fFileName;
168 input.ignore(999,
'\n');
T getParameter(std::string const &) const
math::XYZPointF Point
point in the space
std::vector< FileHandle > fFileHandle
#define DEFINE_FWK_MODULE(type)
virtual void produce(edm::Event &, const edm::EventSetup &) override
void addDefault(ParameterSetDescription const &psetDescription)
std::vector< HFShowerPhoton > HFShowerPhotonCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
HcalForwardLibWriter(const edm::ParameterSet &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)