243 : ptMin_(iConfig.getUntrackedParameter<double>(
"PTMin", 1.0)),
244 etaMax_(iConfig.getUntrackedParameter<double>(
"MaxChargedHadronEta", 2.5)),
245 pCutIsolate_(iConfig.getUntrackedParameter<double>(
"PMaxIsolation", 20.0)),
246 a_Isolation_(iConfig.getUntrackedParameter<
bool>(
"UseConeIsolation",
false)),
247 genSrc_(iConfig.getUntrackedParameter(
"GenSrc",
std::
string(
"generatorSmeared"))),
248 useHepMC_(iConfig.getUntrackedParameter<
bool>(
"UseHepMC",
false)),
249 a_coneR_(iConfig.getUntrackedParameter<double>(
"ConeRadius", 34.98)),
250 a_mipR_(iConfig.getUntrackedParameter<double>(
"ConeRadiusMIP", 14.0)),
251 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)) {
260 if (!strcmp(
"Dummy",
genSrc_.c_str())) {
271 tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
273 tok_topo_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
274 tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
275 tok_pdt_ = esConsumes<HepPDT::ParticleDataTable, PDTRecord>();
281 desc.addUntracked<
bool>(
"UseHepMC",
false);
282 desc.addUntracked<
double>(
"ChargedHadronSeedP", 1.0);
283 desc.addUntracked<
double>(
"PTMin", 1.0);
284 desc.addUntracked<
double>(
"MaxChargedHadronEta", 2.5);
285 desc.addUntracked<
double>(
"ConeRadius", 34.98);
286 desc.addUntracked<
double>(
"ConeRadiusMIP", 14.0);
287 desc.addUntracked<
bool>(
"UseConeIsolation",
true);
288 desc.addUntracked<
double>(
"PMaxIsolation", 5.0);
289 desc.addUntracked<
int>(
"Verbosity", 0);
290 descriptions.
add(
"studyCaloGen",
desc);
322 for (
unsigned int indx = 0; indx < trackIDs.size(); ++indx) {
323 int charge = trackIDs[indx].charge;
324 HepMC::GenEvent::particle_const_iterator
p = trackIDs[indx].trkItr;
326 (*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz(), (*p)->momentum().e());
328 edm::LogVerbatim(
"IsoTrack") <<
"trkIndx " << indx <<
" pdgid " << trackIDs[indx].pdgId <<
" charge " <<
charge
329 <<
" momVec " << momVec;
334 posVec =
GlobalPoint(0.1 * (*p)->production_vertex()->position().x(),
335 0.1 * (*p)->production_vertex()->position().y(),
336 0.1 * (*p)->production_vertex()->position().z());
337 posECAL = trackIDs[indx].pointECAL;
338 fillTrack(posVec, momVec, posECAL, trackIDs[indx].
pdgId, trackIDs[indx].okECAL,
true);
340 edm::LogVerbatim(
"IsoTrack") <<
"posECAL " << posECAL <<
" okECAL " << trackIDs[indx].okECAL <<
"okHCAL "
341 << trackIDs[indx].okHCAL;
342 if (trackIDs[indx].okECAL) {
359 trackIDs[indx].directionECAL,
368 trackIDs[indx].directionECAL,
371 if (trackIDs[indx].okHCAL) {
382 trackIDs[indx].directionHCAL,
391 trackIDs[indx].directionHCAL,
396 bool saveTrack =
true;
406 fillTrack(posVec, momVec, posECAL, 0,
false,
false);
412 HepMC::GenEvent::particle_const_iterator
p;
413 for (
p = myGenEvent->particles_begin(), indx = 0;
p != myGenEvent->particles_end(); ++
p, ++indx) {
414 int pdgId = ((*p)->pdg_id());
417 double pp = (*p)->momentum().rho();
418 double eta = (*p)->momentum().eta();
423 std::vector<spr::propagatedGenParticleID> trackIDs =
426 for (
unsigned int indx = 0; indx < trackIDs.size(); ++indx) {
427 int charge = trackIDs[indx].charge;
428 reco::GenParticleCollection::const_iterator
p = trackIDs[indx].trkItr;
432 edm::LogVerbatim(
"IsoTrack") <<
"trkIndx " << indx <<
" pdgid " << trackIDs[indx].pdgId <<
" charge " <<
charge
433 <<
" momVec " << momVec;
438 edm::LogVerbatim(
"IsoTrack") <<
" pt " << momVec.Pt() <<
" eta " << momVec.eta();
440 posVec =
GlobalPoint(
p->vertex().x(),
p->vertex().y(),
p->vertex().z());
441 posECAL = trackIDs[indx].pointECAL;
443 edm::LogVerbatim(
"IsoTrack") <<
"posECAL " << posECAL <<
" okECAL " << trackIDs[indx].okECAL <<
"okHCAL "
444 << trackIDs[indx].okHCAL;
445 fillTrack(posVec, momVec, posECAL, trackIDs[indx].
pdgId, trackIDs[indx].okECAL,
true);
446 if (trackIDs[indx].okECAL) {
472 trackIDs[indx].directionECAL,
481 trackIDs[indx].directionECAL,
484 if (trackIDs[indx].okHCAL) {
499 trackIDs[indx].directionHCAL,
508 trackIDs[indx].directionHCAL,
513 bool saveTrack =
true;
523 fillTrack(posVec, momVec, posECAL, 0,
false,
false);
529 reco::GenParticleCollection::const_iterator
p;
534 double pp = (
p->momentum()).
R();
535 double eta = (
p->momentum()).Eta();
549 double tempgen_TH[
NPBins_ + 1] = {0.0, 5.0, 12.0, 300.0};
553 double tempgen_Eta[
NEtaBins_ + 1] = {0.0, 0.5, 1.1, 1.7, 2.3};
569 double phi1 = momVec.phi();
570 double phi2 = (posECAL - posVec).
phi();
572 double deta = momVec.eta() - (posECAL - posVec).
eta();
770 h_NEventProc = fs->
make<TH1I>(
"h_NEventProc",
"h_NEventProc", 2, -0.5, 0.5);
772 double pBin[
PBins_ + 1] = {0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0,
773 70.0, 80.0, 90.0, 100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 400.0, 450.0,
774 500.0, 550.0, 600.0, 650.0, 700.0, 750.0, 800.0, 850.0, 900.0, 950.0, 1000.0};
775 double etaBin[
EtaBins_ + 1] = {-3.0, -2.9, -2.8, -2.7, -2.6, -2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8,
776 -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5,
777 -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8,
778 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1,
779 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0};
781 "electron",
"positron",
"#gamma",
"#pi^+",
"#pi^-",
"K^+",
"K^-",
"p",
"n",
"pbar",
"nbar",
"K^0_L"};
785 sprintf(
name,
"pEta%d",
i);
786 sprintf(
title,
"#eta vs momentum for %s", particle[
i].c_str());
791 tree_ = fs->
make<TTree>(
"StudyCaloGen",
"StudyCaloGen");
948 t_muEneR =
new std::vector<double>();
1135 tree_->Branch(
"t_muEneR",
"std::vector<double>", &
t_muEneR);
1361 int partID[
Particles] = {11, -11, 21, 211, -211, 321, -321, 2212, 2112, -2212, -2112, 130};
1363 for (
int ik = 0; ik <
Particles; ++ik) {
1364 if (
pdgId == partID[ik]) {