CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
PiZeroAnalyzer Class Reference

EgammaCoreTools. More...

#include <PiZeroAnalyzer.h>

Inheritance diagram for PiZeroAnalyzer:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 PiZeroAnalyzer (const edm::ParameterSet &)
 
 ~PiZeroAnalyzer () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

void makePizero (const edm::EventSetup &es, const edm::Handle< EcalRecHitCollection > eb, const edm::Handle< EcalRecHitCollection > ee)
 

Private Attributes

edm::EDGetTokenT< edm::SortedCollection< EcalRecHit, edm::StrictWeakOrdering< EcalRecHit > > > barrelEcalHits_token_
 
int clusEtaSize_
 
int clusPhiSize_
 
double clusSeedThr_
 parameters needed for pizero finding More...
 
std::stringstream currentFolder_
 
double cutStep_
 
edm::EDGetTokenT< edm::SortedCollection< EcalRecHit, edm::StrictWeakOrdering< EcalRecHit > > > endcapEcalHits_token_
 
std::string fName_
 
MonitorElementhIsoPi0EB_
 
MonitorElementhMinvPi0EB_
 
MonitorElementhPt1Pi0EB_
 
MonitorElementhPt2Pi0EB_
 
MonitorElementhPtPi0EB_
 
double minPhoEtCut_
 
int nEvt_
 
int numberOfSteps_
 
bool ParameterLogWeighted_
 
double ParameterT0_barl_
 
double ParameterW0_
 
double ParameterX0_
 
edm::ParameterSet posCalcParameters_
 
unsigned int prescaleFactor_
 
double seleMinvMaxPi0_
 
double seleMinvMinPi0_
 
double selePi0BeltDeta_
 
double selePi0BeltDR_
 
double selePi0Iso_
 
double selePtGammaOne_
 
double selePtGammaTwo_
 
double selePtPi0_
 
double seleS4S9GammaOne_
 
double seleS4S9GammaTwo_
 
double seleXtalMinEnergy_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

EgammaCoreTools.

$Id: PiZeroAnalyzer authors: Nancy Marinelli, U. of Notre Dame, US Jamie Antonelli, U. of Notre Dame, US

$Id: PiZeroAnalyzer authors: Nancy Marinelli, U. of Notre Dame, US
Jamie Antonelli, U. of Notre Dame, US

Definition at line 75 of file PiZeroAnalyzer.h.

Constructor & Destructor Documentation

◆ PiZeroAnalyzer()

PiZeroAnalyzer::PiZeroAnalyzer ( const edm::ParameterSet pset)
explicit

Definition at line 20 of file PiZeroAnalyzer.cc.

20  {
21  fName_ = pset.getUntrackedParameter<std::string>("Name");
22  prescaleFactor_ = pset.getUntrackedParameter<int>("prescaleFactor", 1);
23 
24  barrelEcalHits_token_ = consumes<edm::SortedCollection<EcalRecHit, edm::StrictWeakOrdering<EcalRecHit> > >(
25  pset.getParameter<edm::InputTag>("barrelEcalHits"));
26  endcapEcalHits_token_ = consumes<edm::SortedCollection<EcalRecHit, edm::StrictWeakOrdering<EcalRecHit> > >(
27  pset.getParameter<edm::InputTag>("endcapEcalHits"));
28 
29  nEvt_ = 0;
30 
31  // parameters for Pizero finding
32  seleXtalMinEnergy_ = pset.getParameter<double>("seleXtalMinEnergy");
33  clusSeedThr_ = pset.getParameter<double>("clusSeedThr");
34  clusEtaSize_ = pset.getParameter<int>("clusEtaSize");
35  clusPhiSize_ = pset.getParameter<int>("clusPhiSize");
36  ParameterLogWeighted_ = pset.getParameter<bool>("ParameterLogWeighted");
37  ParameterX0_ = pset.getParameter<double>("ParameterX0");
38  ParameterT0_barl_ = pset.getParameter<double>("ParameterT0_barl");
39  ParameterW0_ = pset.getParameter<double>("ParameterW0");
40 
41  selePtGammaOne_ = pset.getParameter<double>("selePtGammaOne");
42  selePtGammaTwo_ = pset.getParameter<double>("selePtGammaTwo");
43  seleS4S9GammaOne_ = pset.getParameter<double>("seleS4S9GammaOne");
44  seleS4S9GammaTwo_ = pset.getParameter<double>("seleS4S9GammaTwo");
45  selePtPi0_ = pset.getParameter<double>("selePtPi0");
46  selePi0Iso_ = pset.getParameter<double>("selePi0Iso");
47  selePi0BeltDR_ = pset.getParameter<double>("selePi0BeltDR");
48  selePi0BeltDeta_ = pset.getParameter<double>("selePi0BeltDeta");
49  seleMinvMaxPi0_ = pset.getParameter<double>("seleMinvMaxPi0");
50  seleMinvMinPi0_ = pset.getParameter<double>("seleMinvMinPi0");
51 
52  posCalcParameters_ = pset.getParameter<edm::ParameterSet>("posCalcParameters");
53 }

References muonDTDigis_cfi::pset, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~PiZeroAnalyzer()

PiZeroAnalyzer::~PiZeroAnalyzer ( )
override

Definition at line 55 of file PiZeroAnalyzer.cc.

55 {}

Member Function Documentation

◆ analyze()

void PiZeroAnalyzer::analyze ( const edm::Event e,
const edm::EventSetup esup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 80 of file PiZeroAnalyzer.cc.

80  {
81  using namespace edm;
82 
83  if (nEvt_ % prescaleFactor_)
84  return;
85  nEvt_++;
86  LogInfo("PiZeroAnalyzer") << "PiZeroAnalyzer Analyzing event number: " << e.id() << " Global Counter " << nEvt_
87  << "\n";
88 
89  // Get EcalRecHits
90  bool validEcalRecHits = true;
91  Handle<EcalRecHitCollection> barrelHitHandle;
93  e.getByToken(barrelEcalHits_token_, barrelHitHandle);
94  if (!barrelHitHandle.isValid()) {
95  edm::LogError("PhotonProducer") << "Error! Can't get the product: barrelEcalHits_token_";
96  validEcalRecHits = false;
97  }
98 
99  Handle<EcalRecHitCollection> endcapHitHandle;
100  e.getByToken(endcapEcalHits_token_, endcapHitHandle);
102  if (!endcapHitHandle.isValid()) {
103  edm::LogError("PhotonProducer") << "Error! Can't get the product: endcapEcalHits_token_";
104  validEcalRecHits = false;
105  }
106 
107  if (validEcalRecHits)
108  makePizero(esup, barrelHitHandle, endcapHitHandle);
109 }

References HLT_FULL_cff::barrelRecHits, MillePedeFileConverter_cfg::e, HLT_FULL_cff::endcapRecHits, and edm::HandleBase::isValid().

◆ bookHistograms()

void PiZeroAnalyzer::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 57 of file PiZeroAnalyzer.cc.

59  {
60  currentFolder_.str("");
61  currentFolder_ << "Egamma/PiZeroAnalyzer/";
62  ibooker.setCurrentFolder(currentFolder_.str());
63 
64  hMinvPi0EB_ = ibooker.book1D("Pi0InvmassEB", "Pi0 Invariant Mass in EB", 100, 0., 0.5);
65  hMinvPi0EB_->setAxisTitle("Inv Mass [GeV] ", 1);
66 
67  hPt1Pi0EB_ = ibooker.book1D("Pt1Pi0EB", "Pt 1st most energetic Pi0 photon in EB", 100, 0., 20.);
68  hPt1Pi0EB_->setAxisTitle("1st photon Pt [GeV] ", 1);
69 
70  hPt2Pi0EB_ = ibooker.book1D("Pt2Pi0EB", "Pt 2nd most energetic Pi0 photon in EB", 100, 0., 20.);
71  hPt2Pi0EB_->setAxisTitle("2nd photon Pt [GeV] ", 1);
72 
73  hPtPi0EB_ = ibooker.book1D("PtPi0EB", "Pi0 Pt in EB", 100, 0., 20.);
74  hPtPi0EB_->setAxisTitle("Pi0 Pt [GeV] ", 1);
75 
76  hIsoPi0EB_ = ibooker.book1D("IsoPi0EB", "Pi0 Iso in EB", 50, 0., 1.);
77  hIsoPi0EB_->setAxisTitle("Pi0 Iso", 1);
78 }

References dqm::implementation::IBooker::book1D(), dqm::impl::MonitorElement::setAxisTitle(), and dqm::implementation::NavigatorBase::setCurrentFolder().

◆ makePizero()

void PiZeroAnalyzer::makePizero ( const edm::EventSetup es,
const edm::Handle< EcalRecHitCollection eb,
const edm::Handle< EcalRecHitCollection ee 
)
private

Definition at line 111 of file PiZeroAnalyzer.cc.

113  {
114  const EcalRecHitCollection* hitCollection_p = rhEB.product();
115 
116  edm::ESHandle<CaloGeometry> geoHandle;
117  es.get<CaloGeometryRecord>().get(geoHandle);
118 
119  edm::ESHandle<CaloTopology> theCaloTopology;
120  es.get<CaloTopologyRecord>().get(theCaloTopology);
121 
122  const CaloSubdetectorTopology* topology_p;
123  const CaloSubdetectorGeometry* geometry_p = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
124  const CaloSubdetectorGeometry* geometryES_p = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalPreshower);
125 
126  // Parameters for the position calculation:
127  PositionCalc posCalculator_ = PositionCalc(posCalcParameters_);
128  //
129  std::map<DetId, EcalRecHit> recHitsEB_map;
130  //
131  std::vector<EcalRecHit> seeds;
132 
133  seeds.clear();
134  //
135  vector<EBDetId> usedXtals;
136  usedXtals.clear();
137  //
139  //
140  static const int MAXCLUS = 2000;
141  int nClus = 0;
142  vector<float> eClus;
143  vector<float> etClus;
144  vector<float> etaClus;
145  vector<float> phiClus;
146  vector<EBDetId> max_hit;
147  vector<vector<EcalRecHit> > RecHitsCluster;
148  vector<float> s4s9Clus;
149 
150  // find cluster seeds in EB
151  for (itb = rhEB->begin(); itb != rhEB->end(); ++itb) {
152  EBDetId id(itb->id());
153  double energy = itb->energy();
154  if (energy > seleXtalMinEnergy_) {
155  std::pair<DetId, EcalRecHit> map_entry(itb->id(), *itb);
156  recHitsEB_map.insert(map_entry);
157  }
158  if (energy > clusSeedThr_)
159  seeds.push_back(*itb);
160  } // Eb rechits
161 
162  sort(seeds.begin(), seeds.end(), [](auto& x, auto& y) { return (x.energy() > y.energy()); });
163  for (std::vector<EcalRecHit>::iterator itseed = seeds.begin(); itseed != seeds.end(); itseed++) {
164  EBDetId seed_id = itseed->id();
165  std::vector<EBDetId>::const_iterator usedIds;
166 
167  bool seedAlreadyUsed = false;
168  for (usedIds = usedXtals.begin(); usedIds != usedXtals.end(); usedIds++) {
169  if (*usedIds == seed_id) {
170  seedAlreadyUsed = true;
171  //cout<< " Seed with energy "<<itseed->energy()<<" was used !"<<endl;
172  break;
173  }
174  }
175  if (seedAlreadyUsed)
176  continue;
177  topology_p = theCaloTopology->getSubdetectorTopology(DetId::Ecal, EcalBarrel);
178  std::vector<DetId> clus_v = topology_p->getWindow(seed_id, clusEtaSize_, clusPhiSize_);
179  //std::vector<DetId> clus_used;
180  std::vector<std::pair<DetId, float> > clus_used;
181 
182  vector<EcalRecHit> RecHitsInWindow;
183 
184  double simple_energy = 0;
185 
186  for (std::vector<DetId>::iterator det = clus_v.begin(); det != clus_v.end(); det++) {
187  // EBDetId EBdet = *det;
188  // cout<<" det "<< EBdet<<" ieta "<<EBdet.ieta()<<" iphi "<<EBdet.iphi()<<endl;
189  bool HitAlreadyUsed = false;
190  for (usedIds = usedXtals.begin(); usedIds != usedXtals.end(); usedIds++) {
191  if (*usedIds == *det) {
192  HitAlreadyUsed = true;
193  break;
194  }
195  }
196  if (HitAlreadyUsed)
197  continue;
198  if (recHitsEB_map.find(*det) != recHitsEB_map.end()) {
199  // cout<<" Used det "<< EBdet<<endl;
200  std::map<DetId, EcalRecHit>::iterator aHit;
201  aHit = recHitsEB_map.find(*det);
202  usedXtals.push_back(*det);
203  RecHitsInWindow.push_back(aHit->second);
204  clus_used.push_back(std::pair<DetId, float>(*det, 1.));
205  simple_energy = simple_energy + aHit->second.energy();
206  }
207  }
208 
209  math::XYZPoint clus_pos = posCalculator_.Calculate_Location(clus_used, hitCollection_p, geometry_p, geometryES_p);
210  float theta_s = 2. * atan(exp(-clus_pos.eta()));
211  float p0x_s = simple_energy * sin(theta_s) * cos(clus_pos.phi());
212  float p0y_s = simple_energy * sin(theta_s) * sin(clus_pos.phi());
213  // float p0z_s = simple_energy * cos(theta_s);
214  float et_s = sqrt(p0x_s * p0x_s + p0y_s * p0y_s);
215 
216  //cout << " Simple Clustering: E,Et,px,py,pz: "<<simple_energy<<" "<<et_s<<" "<<p0x_s<<" "<<p0y_s<<" "<<endl;
217 
218  eClus.push_back(simple_energy);
219  etClus.push_back(et_s);
220  etaClus.push_back(clus_pos.eta());
221  phiClus.push_back(clus_pos.phi());
222  max_hit.push_back(seed_id);
223  RecHitsCluster.push_back(RecHitsInWindow);
224  //Compute S4/S9 variable
225  //We are not sure to have 9 RecHits so need to check eta and phi:
226  float s4s9_[4];
227  for (int i = 0; i < 4; i++)
228  s4s9_[i] = itseed->energy();
229  for (unsigned int j = 0; j < RecHitsInWindow.size(); j++) {
230  //cout << " Simple cluster rh, ieta, iphi : "<<((EBDetId)RecHitsInWindow[j].id()).ieta()<<" "<<((EBDetId)RecHitsInWindow[j].id()).iphi()<<endl;
231  if ((((EBDetId)RecHitsInWindow[j].id()).ieta() == seed_id.ieta() - 1 && seed_id.ieta() != 1) ||
232  (seed_id.ieta() == 1 && (((EBDetId)RecHitsInWindow[j].id()).ieta() == seed_id.ieta() - 2))) {
233  if (((EBDetId)RecHitsInWindow[j].id()).iphi() == seed_id.iphi() - 1 ||
234  ((EBDetId)RecHitsInWindow[j].id()).iphi() - 360 == seed_id.iphi() - 1) {
235  s4s9_[0] += RecHitsInWindow[j].energy();
236  } else {
237  if (((EBDetId)RecHitsInWindow[j].id()).iphi() == seed_id.iphi()) {
238  s4s9_[0] += RecHitsInWindow[j].energy();
239  s4s9_[1] += RecHitsInWindow[j].energy();
240  } else {
241  if (((EBDetId)RecHitsInWindow[j].id()).iphi() == seed_id.iphi() + 1 ||
242  ((EBDetId)RecHitsInWindow[j].id()).iphi() - 360 == seed_id.iphi() + 1) {
243  s4s9_[1] += RecHitsInWindow[j].energy();
244  }
245  }
246  }
247  } else {
248  if (((EBDetId)RecHitsInWindow[j].id()).ieta() == seed_id.ieta()) {
249  if (((EBDetId)RecHitsInWindow[j].id()).iphi() == seed_id.iphi() - 1 ||
250  ((EBDetId)RecHitsInWindow[j].id()).iphi() - 360 == seed_id.iphi() - 1) {
251  s4s9_[0] += RecHitsInWindow[j].energy();
252  s4s9_[3] += RecHitsInWindow[j].energy();
253  } else {
254  if (((EBDetId)RecHitsInWindow[j].id()).iphi() == seed_id.iphi() + 1 ||
255  ((EBDetId)RecHitsInWindow[j].id()).iphi() - 360 == seed_id.iphi() + 1) {
256  s4s9_[1] += RecHitsInWindow[j].energy();
257  s4s9_[2] += RecHitsInWindow[j].energy();
258  }
259  }
260  } else {
261  if ((((EBDetId)RecHitsInWindow[j].id()).ieta() == seed_id.ieta() + 1 && seed_id.ieta() != -1) ||
262  (seed_id.ieta() == -1 && (((EBDetId)RecHitsInWindow[j].id()).ieta() == seed_id.ieta() + 2))) {
263  if (((EBDetId)RecHitsInWindow[j].id()).iphi() == seed_id.iphi() - 1 ||
264  ((EBDetId)RecHitsInWindow[j].id()).iphi() - 360 == seed_id.iphi() - 1) {
265  s4s9_[3] += RecHitsInWindow[j].energy();
266  } else {
267  if (((EBDetId)RecHitsInWindow[j].id()).iphi() == seed_id.iphi()) {
268  s4s9_[2] += RecHitsInWindow[j].energy();
269  s4s9_[3] += RecHitsInWindow[j].energy();
270  } else {
271  if (((EBDetId)RecHitsInWindow[j].id()).iphi() == seed_id.iphi() + 1 ||
272  ((EBDetId)RecHitsInWindow[j].id()).iphi() - 360 == seed_id.iphi() + 1) {
273  s4s9_[2] += RecHitsInWindow[j].energy();
274  }
275  }
276  }
277  } else {
278  cout << " (EBDetId)RecHitsInWindow[j].id()).ieta() " << ((EBDetId)RecHitsInWindow[j].id()).ieta()
279  << " seed_id.ieta() " << seed_id.ieta() << endl;
280  cout << " Problem with S4 calculation " << endl;
281  return;
282  }
283  }
284  }
285  }
286  s4s9Clus.push_back(*max_element(s4s9_, s4s9_ + 4) / simple_energy);
287  // cout<<" s4s9Clus[0] "<<s4s9_[0]/simple_energy<<" s4s9Clus[1] "<<s4s9_[1]/simple_energy<<" s4s9Clus[2] "<<s4s9_[2]/simple_energy<<" s4s9Clus[3] "<<s4s9_[3]/simple_energy<<endl;
288  // cout<<" Max "<<*max_element( s4s9_,s4s9_+4)/simple_energy<<endl;
289  nClus++;
290  if (nClus == MAXCLUS)
291  return;
292  } // End loop over seed clusters
293 
294  // cout<< " Pi0 clusters: "<<nClus<<endl;
295 
296  // Selection, based on Simple clustering
297  //pi0 candidates
298  static const int MAXPI0S = 200;
299  int npi0_s = 0;
300 
301  vector<EBDetId> scXtals;
302  scXtals.clear();
303 
304  if (nClus <= 1)
305  return;
306  for (Int_t i = 0; i < nClus; i++) {
307  for (Int_t j = i + 1; j < nClus; j++) {
308  // cout<<" i "<<i<<" etClus[i] "<<etClus[i]<<" j "<<j<<" etClus[j] "<<etClus[j]<<endl;
309  if (etClus[i] > selePtGammaOne_ && etClus[j] > selePtGammaTwo_ && s4s9Clus[i] > seleS4S9GammaOne_ &&
310  s4s9Clus[j] > seleS4S9GammaTwo_) {
311  float theta_0 = 2. * atan(exp(-etaClus[i]));
312  float theta_1 = 2. * atan(exp(-etaClus[j]));
313 
314  float p0x = eClus[i] * sin(theta_0) * cos(phiClus[i]);
315  float p1x = eClus[j] * sin(theta_1) * cos(phiClus[j]);
316  float p0y = eClus[i] * sin(theta_0) * sin(phiClus[i]);
317  float p1y = eClus[j] * sin(theta_1) * sin(phiClus[j]);
318  float p0z = eClus[i] * cos(theta_0);
319  float p1z = eClus[j] * cos(theta_1);
320 
321  float pt_pi0 = sqrt((p0x + p1x) * (p0x + p1x) + (p0y + p1y) * (p0y + p1y));
322  // cout<<" pt_pi0 "<<pt_pi0<<endl;
323  if (pt_pi0 < selePtPi0_)
324  continue;
325  float m_inv = sqrt((eClus[i] + eClus[j]) * (eClus[i] + eClus[j]) - (p0x + p1x) * (p0x + p1x) -
326  (p0y + p1y) * (p0y + p1y) - (p0z + p1z) * (p0z + p1z));
327  if ((m_inv < seleMinvMaxPi0_) && (m_inv > seleMinvMinPi0_)) {
328  //New Loop on cluster to measure isolation:
329  vector<int> IsoClus;
330  IsoClus.clear();
331  float Iso = 0;
332  TVector3 pi0vect = TVector3((p0x + p1x), (p0y + p1y), (p0z + p1z));
333  for (Int_t k = 0; k < nClus; k++) {
334  if (k == i || k == j)
335  continue;
336  TVector3 Clusvect = TVector3(eClus[k] * sin(2. * atan(exp(-etaClus[k]))) * cos(phiClus[k]),
337  eClus[k] * sin(2. * atan(exp(-etaClus[k]))) * sin(phiClus[k]),
338  eClus[k] * cos(2. * atan(exp(-etaClus[k]))));
339  float dretaclpi0 = fabs(etaClus[k] - pi0vect.Eta());
340  float drclpi0 = Clusvect.DeltaR(pi0vect);
341 
342  if ((drclpi0 < selePi0BeltDR_) && (dretaclpi0 < selePi0BeltDeta_)) {
343  Iso = Iso + etClus[k];
344  IsoClus.push_back(k);
345  }
346  }
347 
348  if (Iso / pt_pi0 < selePi0Iso_) {
349  hMinvPi0EB_->Fill(m_inv);
350  hPt1Pi0EB_->Fill(etClus[i]);
351  hPt2Pi0EB_->Fill(etClus[j]);
352  hPtPi0EB_->Fill(pt_pi0);
353  hIsoPi0EB_->Fill(Iso / pt_pi0);
354 
355  npi0_s++;
356  }
357 
358  if (npi0_s == MAXPI0S)
359  return;
360  }
361  }
362  }
363  }
364 }

References edm::SortedCollection< T, SORT >::begin(), PositionCalc::Calculate_Location(), funct::cos(), gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalPreshower, edm::SortedCollection< T, SORT >::end(), HCALHighEnergyHPDFilter_cfi::energy, JetChargeProducer_cfi::exp, edm::EventSetup::get(), get, CaloGeometry::getSubdetectorGeometry(), CaloTopology::getSubdetectorTopology(), CaloSubdetectorTopology::getWindow(), mps_fire::i, triggerObjects_cff::id, EBDetId::ieta(), LEDCalibrationChannels::ieta, EBDetId::iphi(), LEDCalibrationChannels::iphi, dqmiolumiharvest::j, dqmdumpme::k, edm::Handle< T >::product(), InitialStep_cff::seeds, funct::sin(), and mathSSE::sqrt().

Member Data Documentation

◆ barrelEcalHits_token_

edm::EDGetTokenT<edm::SortedCollection<EcalRecHit, edm::StrictWeakOrdering<EcalRecHit> > > PiZeroAnalyzer::barrelEcalHits_token_
private

Definition at line 94 of file PiZeroAnalyzer.h.

◆ clusEtaSize_

int PiZeroAnalyzer::clusEtaSize_
private

Definition at line 103 of file PiZeroAnalyzer.h.

◆ clusPhiSize_

int PiZeroAnalyzer::clusPhiSize_
private

Definition at line 104 of file PiZeroAnalyzer.h.

◆ clusSeedThr_

double PiZeroAnalyzer::clusSeedThr_
private

parameters needed for pizero finding

Definition at line 102 of file PiZeroAnalyzer.h.

◆ currentFolder_

std::stringstream PiZeroAnalyzer::currentFolder_
private

Definition at line 124 of file PiZeroAnalyzer.h.

◆ cutStep_

double PiZeroAnalyzer::cutStep_
private

Definition at line 98 of file PiZeroAnalyzer.h.

◆ endcapEcalHits_token_

edm::EDGetTokenT<edm::SortedCollection<EcalRecHit, edm::StrictWeakOrdering<EcalRecHit> > > PiZeroAnalyzer::endcapEcalHits_token_
private

Definition at line 95 of file PiZeroAnalyzer.h.

◆ fName_

std::string PiZeroAnalyzer::fName_
private

Definition at line 87 of file PiZeroAnalyzer.h.

◆ hIsoPi0EB_

MonitorElement* PiZeroAnalyzer::hIsoPi0EB_
private

Definition at line 129 of file PiZeroAnalyzer.h.

◆ hMinvPi0EB_

MonitorElement* PiZeroAnalyzer::hMinvPi0EB_
private

Definition at line 126 of file PiZeroAnalyzer.h.

◆ hPt1Pi0EB_

MonitorElement* PiZeroAnalyzer::hPt1Pi0EB_
private

Definition at line 127 of file PiZeroAnalyzer.h.

◆ hPt2Pi0EB_

MonitorElement* PiZeroAnalyzer::hPt2Pi0EB_
private

Definition at line 128 of file PiZeroAnalyzer.h.

◆ hPtPi0EB_

MonitorElement* PiZeroAnalyzer::hPtPi0EB_
private

Definition at line 130 of file PiZeroAnalyzer.h.

◆ minPhoEtCut_

double PiZeroAnalyzer::minPhoEtCut_
private

Definition at line 96 of file PiZeroAnalyzer.h.

◆ nEvt_

int PiZeroAnalyzer::nEvt_
private

Definition at line 90 of file PiZeroAnalyzer.h.

◆ numberOfSteps_

int PiZeroAnalyzer::numberOfSteps_
private

Definition at line 99 of file PiZeroAnalyzer.h.

◆ ParameterLogWeighted_

bool PiZeroAnalyzer::ParameterLogWeighted_
private

Definition at line 108 of file PiZeroAnalyzer.h.

◆ ParameterT0_barl_

double PiZeroAnalyzer::ParameterT0_barl_
private

Definition at line 110 of file PiZeroAnalyzer.h.

◆ ParameterW0_

double PiZeroAnalyzer::ParameterW0_
private

Definition at line 111 of file PiZeroAnalyzer.h.

◆ ParameterX0_

double PiZeroAnalyzer::ParameterX0_
private

Definition at line 109 of file PiZeroAnalyzer.h.

◆ posCalcParameters_

edm::ParameterSet PiZeroAnalyzer::posCalcParameters_
private

Definition at line 92 of file PiZeroAnalyzer.h.

◆ prescaleFactor_

unsigned int PiZeroAnalyzer::prescaleFactor_
private

Definition at line 88 of file PiZeroAnalyzer.h.

◆ seleMinvMaxPi0_

double PiZeroAnalyzer::seleMinvMaxPi0_
private

Definition at line 121 of file PiZeroAnalyzer.h.

◆ seleMinvMinPi0_

double PiZeroAnalyzer::seleMinvMinPi0_
private

Definition at line 122 of file PiZeroAnalyzer.h.

◆ selePi0BeltDeta_

double PiZeroAnalyzer::selePi0BeltDeta_
private

Definition at line 119 of file PiZeroAnalyzer.h.

◆ selePi0BeltDR_

double PiZeroAnalyzer::selePi0BeltDR_
private

Definition at line 118 of file PiZeroAnalyzer.h.

◆ selePi0Iso_

double PiZeroAnalyzer::selePi0Iso_
private

Definition at line 120 of file PiZeroAnalyzer.h.

◆ selePtGammaOne_

double PiZeroAnalyzer::selePtGammaOne_
private

Definition at line 113 of file PiZeroAnalyzer.h.

◆ selePtGammaTwo_

double PiZeroAnalyzer::selePtGammaTwo_
private

Definition at line 114 of file PiZeroAnalyzer.h.

◆ selePtPi0_

double PiZeroAnalyzer::selePtPi0_
private

Definition at line 115 of file PiZeroAnalyzer.h.

◆ seleS4S9GammaOne_

double PiZeroAnalyzer::seleS4S9GammaOne_
private

Definition at line 116 of file PiZeroAnalyzer.h.

◆ seleS4S9GammaTwo_

double PiZeroAnalyzer::seleS4S9GammaTwo_
private

Definition at line 117 of file PiZeroAnalyzer.h.

◆ seleXtalMinEnergy_

double PiZeroAnalyzer::seleXtalMinEnergy_
private

Definition at line 106 of file PiZeroAnalyzer.h.

PiZeroAnalyzer::makePizero
void makePizero(const edm::EventSetup &es, const edm::Handle< EcalRecHitCollection > eb, const edm::Handle< EcalRecHitCollection > ee)
Definition: PiZeroAnalyzer.cc:111
DDAxes::y
EBDetId::ieta
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
mps_fire.i
i
Definition: mps_fire.py:428
PiZeroAnalyzer::nEvt_
int nEvt_
Definition: PiZeroAnalyzer.h:90
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
PiZeroAnalyzer::selePi0BeltDR_
double selePi0BeltDR_
Definition: PiZeroAnalyzer.h:118
PiZeroAnalyzer::seleMinvMinPi0_
double seleMinvMinPi0_
Definition: PiZeroAnalyzer.h:122
HLT_FULL_cff.endcapRecHits
endcapRecHits
Definition: HLT_FULL_cff.py:14918
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EBDetId
Definition: EBDetId.h:17
edm
HLT enums.
Definition: AlignableModifier.h:19
PiZeroAnalyzer::hPtPi0EB_
MonitorElement * hPtPi0EB_
Definition: PiZeroAnalyzer.h:130
gather_cfg.cout
cout
Definition: gather_cfg.py:144
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
HLT_FULL_cff.barrelRecHits
barrelRecHits
Definition: HLT_FULL_cff.py:14921
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
PiZeroAnalyzer::seleS4S9GammaTwo_
double seleS4S9GammaTwo_
Definition: PiZeroAnalyzer.h:117
edm::SortedCollection< EcalRecHit >
PiZeroAnalyzer::prescaleFactor_
unsigned int prescaleFactor_
Definition: PiZeroAnalyzer.h:88
DDAxes::x
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
EcalBarrel
Definition: EcalSubdetector.h:10
PiZeroAnalyzer::currentFolder_
std::stringstream currentFolder_
Definition: PiZeroAnalyzer.h:124
PiZeroAnalyzer::hPt2Pi0EB_
MonitorElement * hPt2Pi0EB_
Definition: PiZeroAnalyzer.h:128
PiZeroAnalyzer::clusEtaSize_
int clusEtaSize_
Definition: PiZeroAnalyzer.h:103
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PiZeroAnalyzer::seleXtalMinEnergy_
double seleXtalMinEnergy_
Definition: PiZeroAnalyzer.h:106
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
PiZeroAnalyzer::selePi0Iso_
double selePi0Iso_
Definition: PiZeroAnalyzer.h:120
PiZeroAnalyzer::selePtPi0_
double selePtPi0_
Definition: PiZeroAnalyzer.h:115
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
PiZeroAnalyzer::hIsoPi0EB_
MonitorElement * hIsoPi0EB_
Definition: PiZeroAnalyzer.h:129
PositionCalc::Calculate_Location
math::XYZPoint Calculate_Location(const HitsAndFractions &iDetIds, const edm::SortedCollection< HitType > *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=nullptr)
Definition: PositionCalc.h:65
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
edm::ESHandle< CaloGeometry >
PiZeroAnalyzer::selePi0BeltDeta_
double selePi0BeltDeta_
Definition: PiZeroAnalyzer.h:119
PiZeroAnalyzer::ParameterX0_
double ParameterX0_
Definition: PiZeroAnalyzer.h:109
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
PiZeroAnalyzer::clusSeedThr_
double clusSeedThr_
parameters needed for pizero finding
Definition: PiZeroAnalyzer.h:102
dqmdumpme.k
k
Definition: dqmdumpme.py:60
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
InitialStep_cff.seeds
seeds
Definition: InitialStep_cff.py:230
PiZeroAnalyzer::hMinvPi0EB_
MonitorElement * hMinvPi0EB_
Definition: PiZeroAnalyzer.h:126
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
edm::ParameterSet
Definition: ParameterSet.h:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
PiZeroAnalyzer::seleS4S9GammaOne_
double seleS4S9GammaOne_
Definition: PiZeroAnalyzer.h:116
CaloTopology::getSubdetectorTopology
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:17
PiZeroAnalyzer::posCalcParameters_
edm::ParameterSet posCalcParameters_
Definition: PiZeroAnalyzer.h:92
PositionCalc
Definition: PositionCalc.h:29
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
DetId::Ecal
Definition: DetId.h:27
get
#define get
PiZeroAnalyzer::hPt1Pi0EB_
MonitorElement * hPt1Pi0EB_
Definition: PiZeroAnalyzer.h:127
CaloSubdetectorTopology::getWindow
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
Definition: CaloSubdetectorTopology.cc:4
PiZeroAnalyzer::seleMinvMaxPi0_
double seleMinvMaxPi0_
Definition: PiZeroAnalyzer.h:121
PiZeroAnalyzer::barrelEcalHits_token_
edm::EDGetTokenT< edm::SortedCollection< EcalRecHit, edm::StrictWeakOrdering< EcalRecHit > > > barrelEcalHits_token_
Definition: PiZeroAnalyzer.h:94
EcalPreshower
Definition: EcalSubdetector.h:10
PiZeroAnalyzer::ParameterW0_
double ParameterW0_
Definition: PiZeroAnalyzer.h:111
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
PiZeroAnalyzer::ParameterLogWeighted_
bool ParameterLogWeighted_
Definition: PiZeroAnalyzer.h:108
PiZeroAnalyzer::selePtGammaOne_
double selePtGammaOne_
Definition: PiZeroAnalyzer.h:113
PiZeroAnalyzer::ParameterT0_barl_
double ParameterT0_barl_
Definition: PiZeroAnalyzer.h:110
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
EBDetId::iphi
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
PiZeroAnalyzer::clusPhiSize_
int clusPhiSize_
Definition: PiZeroAnalyzer.h:104
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
PiZeroAnalyzer::fName_
std::string fName_
Definition: PiZeroAnalyzer.h:87
PiZeroAnalyzer::selePtGammaTwo_
double selePtGammaTwo_
Definition: PiZeroAnalyzer.h:114
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
edm::InputTag
Definition: InputTag.h:15
PiZeroAnalyzer::endcapEcalHits_token_
edm::EDGetTokenT< edm::SortedCollection< EcalRecHit, edm::StrictWeakOrdering< EcalRecHit > > > endcapEcalHits_token_
Definition: PiZeroAnalyzer.h:95
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37