31 produces<HFShowerPhotonCollection> (
"emParticles");
32 produces<std::vector<HFShowerPhotonCollection> > (
"emParticlesss");
33 produces< std::vector<int> > (
"emParticles");
34 produces<HFShowerPhotonCollection> (
"hadParticles");
35 produces< std::vector<int> > (
"hadParticles");
36 produces<std::vector<HFShowerLibraryEventInfo> > (
"HFShowerLibraryEventInfo");
43 std::vector<double> energyBin;
44 double energyBin2[12] = {10,15,20,35,50,80,100,150,250,350,500,1000};
45 for (
int z = 0;
z< 12; ++
z) {energyBin.push_back(energyBin2[
z]);}
47 std::vector<HFShowerLibraryEventInfo> Info;
49 std::vector<HFShowerPhotonCollection> emCollsss;
52 fakeColl.push_back(afakePhoton);
57 std::vector<int> emCollnPhoton;
58 std::vector<int> hadCollnPhoton;
61 for (
int i = 0;
i <
n; ++
i) {
69 fFile =
new TFile(fn.c_str(),
"READ");
70 fTree = (TTree*)
fFile->FindObjectAny(
"CherenkovPhotons");
73 <<
"Cannot find TTree with name CherenkovPhotons";
82 for (
int kk = 0;
kk < 10000; ++
kk) {
90 fTree->SetBranchAddress(
"nphot", &nphot);
91 fTree->SetBranchAddress(
"x", &x);
92 fTree->SetBranchAddress(
"y", &y);
93 fTree->SetBranchAddress(
"z", &z);
94 fTree->SetBranchAddress(
"t", &t);
95 fTree->SetBranchAddress(
"lambda", &lambda);
96 fTree->SetBranchAddress(
"fiberId", &fiberId);
97 int nentry = int(fTree->GetEntries());
98 std::cout<<
"nenetry " << nentry<<std::endl;
99 if (particle ==
"electron") {
100 for (
int iev = 0; iev < nentry; iev++) {
101 fTree->GetEntry(iev);
103 emCollnPhoton.push_back(nphot);
104 for (
int iph = 0; iph < nphot; ++iph) {
107 emColl.push_back(aPhoton);
109 emCollsss.push_back(emColl);
113 if (particle ==
"pion") {
114 for (
int iev = 0; iev < nentry; iev++) {
115 fTree->GetEntry(iev);
116 hadCollnPhoton.push_back(nphot);
117 for (
int iph = 0; iph < nphot; ++iph) {
120 hadColl.push_back(aPhoton);
128 Info.push_back(aInfo);
130 std::auto_ptr< std::vector<HFShowerLibraryEventInfo> > product_info(
new std::vector<HFShowerLibraryEventInfo>(Info) );
132 std::auto_ptr<std::vector<HFShowerPhotonCollection> > product_emsss(
new std::vector<HFShowerPhotonCollection>(emCollsss));
133 std::cout<<
"em coll size "<<emCollsss.size()<<std::endl;
137 iEvent.
put(product_info,
"HFShowerLibraryEventInfo");
138 iEvent.
put(product_emsss,
"emParticles");
139 iEvent.
put(product_had,
"hadParticles");
150 <<
"Cannot find file" <<
fDataFile.c_str();
154 while (!
input.eof()) {
155 input >> fFileName >> fPID >> fMom;
156 std::cout <<
" using " << fFileName <<
" fPID" << fPID <<
" fMom" << fMom << std::endl;
158 std::cout <<
" using " << fFileName <<
" " << fPID <<
" " << fMom << std::endl;
160 aFile.
name = fFileName;
167 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
static std::string const input
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)