ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/yangyong/interface/RecoAnalyzer.h
Revision: 1.2
Committed: Mon Feb 28 16:50:13 2011 UTC (14 years, 2 months ago) by yangyong
Content type: text/plain
Branch: MAIN
CVS Tags: V01-00-00, HEAD
Changes since 1.1: +4 -0 lines
Log Message:
new files for running regionalUnpacking sequence on top of RECO data-format

File Contents

# User Rev Content
1 yangyong 1.1 /**
2    
3     Description: Producer for EcalRecHits to be used for pi0 ECAL calibration. ECAL Barrel RecHits only.
4    
5    
6     Implementation:
7     <Notes on implementation>
8     */
9     //
10     // Original Author: Vladimir Litvine
11    
12    
13     // system include files
14     #include <memory>
15    
16     // user include files
17     #include "FWCore/Framework/interface/Frameworkfwd.h"
18     //#include "FWCore/Framework/interface/EDProducer.h"
19     #include "FWCore/Framework/interface/EDAnalyzer.h"
20    
21     #include "FWCore/Framework/interface/Event.h"
22     #include "FWCore/Framework/interface/MakerMacros.h"
23    
24     #include "FWCore/ParameterSet/interface/ParameterSet.h"
25     //#include "FWCore/ParameterSet/interface/InputTag.h"
26     #include "FWCore/Utilities/interface/InputTag.h"
27     #include "FWCore/Framework/interface/EventSetup.h"
28     #include "FWCore/Utilities/interface/Exception.h"
29     #include "FWCore/Framework/interface/ESHandle.h"
30    
31    
32     #include "DataFormats/VertexReco/interface/Vertex.h"
33     #include "DataFormats/VertexReco/interface/VertexFwd.h"
34    
35     #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
36     #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
37     #include "DataFormats/EcalRecHit/interface/EcalUncalibratedRecHit.h"
38    
39     //#include "TrackingTools/TrackAssociator/interface/TimerStack.h"
40     #include "Utilities/Timing/interface/TimerStack.h"
41    
42     #include "HLTrigger/HLTcore/interface/HLTFilter.h"
43     // Geometry
44     #include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h"
45     #include "Geometry/CaloTopology/interface/CaloTopology.h"
46     #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
47     #include "Geometry/Records/interface/IdealGeometryRecord.h"
48     #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
49     #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
50     #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
51     #include "Geometry/CaloTopology/interface/EcalEndcapTopology.h"
52     #include "Geometry/CaloTopology/interface/EcalBarrelTopology.h"
53    
54    
55     #include <vector>
56     #include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h"
57    
58    
59     #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"
60     #include "DataFormats/Math/interface/Point3D.h"
61    
62     // ES stuff
63     #include "DataFormats/EgammaReco/interface/PreshowerCluster.h"
64     #include "RecoEcal/EgammaClusterAlgos/interface/PreshowerClusterAlgo.h"
65    
66    
67    
68     #include "DataFormats/L1Trigger/interface/L1EmParticle.h"
69     #include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h"
70    
71     //L1 Trigger
72     #include "DataFormats/L1Trigger/interface/L1EmParticle.h"
73     #include "DataFormats/L1Trigger/interface/L1JetParticle.h"
74     #include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
75     #include "DataFormats/L1Trigger/interface/L1EtMissParticle.h"
76     #include "DataFormats/L1Trigger/interface/L1ParticleMapFwd.h"
77     #include "DataFormats/L1Trigger/interface/L1ParticleMap.h"
78     #include "L1Trigger/L1ExtraFromDigis/interface/L1ExtraParticleMapProd.h"
79     #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
80    
81     #include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h"
82     #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
83     #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
84    
85    
86     #include "DataFormats/BeamSpot/interface/BeamSpot.h"
87    
88     #include "DataFormats/Common/interface/Ref.h"
89     #include "DataFormats/Common/interface/RefVector.h"
90    
91     #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
92     #include "Geometry/CommonDetUnit/interface/GeomDet.h"
93     #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
94    
95    
96     #include "SimDataFormats/Track/interface/SimTrack.h"
97     #include "SimDataFormats/Track/interface/SimTrackContainer.h"
98     #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
99    
100    
101     #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
102    
103     //#include "DataFormats/EcalDigi/interface/EcalDigiv1Collections.h"
104    
105     #include <set>
106    
107     #include "CondFormats/EcalObjects/interface/EcalGainRatios.h"
108     #include "CondFormats/EcalObjects/interface/EcalPedestals.h"
109     #include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h"
110     #include "CondFormats/DataRecord/interface/EcalGainRatiosRcd.h"
111     #include "CondFormats/EcalObjects/interface/EcalMGPAGainRatio.h"
112    
113    
114     #include "DataFormats/EcalDigi/interface/EEDataFrame.h"
115     #include "DataFormats/EcalDigi/interface/EBDataFrame.h"
116     #include "DataFormats/EcalDigi/interface/ESDataFrame.h"
117     #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h"
118     #include "CondFormats/DataRecord/interface/EcalTimeCalibConstantsRcd.h"
119     #include "CondFormats/DataRecord/interface/EcalADCToGeVConstantRcd.h"
120     #include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h"
121     #include "CondFormats/EcalObjects/interface/EcalTimeCalibConstants.h"
122     #include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbRecord.h"
123    
124     #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
125     #include "CondFormats/EcalObjects/interface/EcalTimeCalibConstants.h"
126     #include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h"
127     #include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"
128    
129     #include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbService.h"
130    
131    
132     // class declaration
133     //
134     #include "DataFormats/Common/interface/Handle.h"
135     #include "FWCore/Utilities/interface/RegexMatch.h"
136    
137     //ROOT
138     #include "TROOT.h"
139     #include "TFile.h"
140     #include "TLorentzVector.h"
141     #include "TTree.h"
142     #include "TBranch.h"
143     #include "TH1.h"
144     #include "TH2.h"
145     #include "TVector3.h"
146    
147     #include <vector>
148     #include <boost/foreach.hpp>
149    
150     #include <ext/algorithm>
151     #include "CLHEP/Matrix/Vector.h"
152     #include "CLHEP/Matrix/SymMatrix.h"
153    
154     #include "SimCalorimetry/EcalSimAlgos/interface/EcalSimParameterMap.h"
155     #include "SimCalorimetry/CaloSimAlgos/interface/CaloHitResponse.h"
156     //#include "SimCalorimetry/EcalSimAlgos/interface/EcalShape.h"
157     #include "SimDataFormats/CrossingFrame/interface/MixCollection.h"
158     #include "SimDataFormats/CaloHit/interface/PCaloHit.h"
159    
160     #include "CalibFormats/CaloObjects/interface/CaloSamples.h"
161     #include "DataFormats/Provenance/interface/ParameterSetID.h"
162     #include "FWCore/Framework/interface/ESWatcher.h"
163     #include "HLTrigger/HLTcore/interface/HLTFilter.h"
164    
165     #include "DataFormats/Common/interface/TriggerResults.h"
166    
167     ///#include "FWCore/Framework/interface/TriggerNames.h"
168     #include "FWCore/Common/interface/TriggerNames.h"
169    
170     #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h"
171    
172    
173     // forward declarations
174     namespace edm {
175     class TriggerResults;
176     }
177    
178     class AlCaRecoTriggerBitsRcd;
179    
180    
181     typedef std::map<DetId, EcalRecHit> RecHitsMap;
182    
183     // Less than operator for sorting EcalRecHits according to energy.
184     class ecalRecHitLess : public std::binary_function<EcalRecHit, EcalRecHit, bool>
185     {
186     public:
187     bool operator()(EcalRecHit x, EcalRecHit y)
188     {
189     return (x.energy() > y.energy());
190     }
191     };
192    
193     struct VertexHit {
194     float z;
195     float r;
196     float w;
197     };
198    
199    
200    
201    
202     using namespace std;
203    
204    
205     class RecoAnalyzer : public edm::EDAnalyzer {
206     public:
207     explicit RecoAnalyzer(const edm::ParameterSet&);
208     ~RecoAnalyzer();
209    
210    
211     int filter(const edm::Event&, const edm::EventSetup&);
212    
213     int getContainedHits(const std::vector<VertexHit> &hits, double z0, double &chi);
214    
215     int convertSmToFedNumbBarrel(int, int);
216     void convxtalid(int & , int &);
217     int diff_neta_s(int,int);
218     int diff_nphi_s(int,int);
219    
220     void makeClusterES(double x, double y, double z,const CaloSubdetectorGeometry*&iSubGeom,CaloSubdetectorTopology*& topology_p);
221    
222     std::vector<int> ListOfFEDS(double etaLow, double etaHigh, double phiLow,
223     double phiHigh, double etamargin, double phimargin);
224    
225    
226    
227     double DeltaPhi(double v1, double v2);
228     double GetDeltaR(double eta1, double eta2, double phi1, double phi2);
229     double getcosd(double eta1, double phi1, double eta2, double phi2);
230     int getMotherIndex(int );
231     int indexofParticle(float px, float pz, int status);
232     void findgenpi0eta();
233     // virtual bool filter(edm::Event &, const edm::EventSetup&);
234     void matchGenpi0Pht(float etapair, float phipair,float eta1,float phi1,float eta2,float phi2,float res[]);
235     void matchGenetaPht(float etapair, float phipair,float eta1,float phi1,float eta2,float phi2,float res[]);
236    
237     void calcPairPhoton(float en[],float eta[],float phi[],float res[]);
238    
239     double ecalEta(double EtaParticle ,double Zvertex, double RhoVertex);
240     double ecalPhi(double phi,double x0,double y0);
241    
242     void runEcalUncalibRecHitFixedAlphaBetaFit(const EcalDigiCollection::const_iterator & itdg,double res[]);
243    
244     void makeEcalUncalibRecHitEB(const EBDataFrame &dataFrame, const double* pedestals,
245     const double* gainRatios,double res[]
246     );
247    
248     double pulseShapeFunction(double t);
249     float PerformAnalyticFit(double* samples, int max_sample);
250     void InitFitParameters(double* samples, int max_sample);
251     void SetAlphaBeta( double alpha, double beta);
252     void SetMinAmpl( double ampl);
253    
254     void makeEcalRecHit(const edm::Event & evt, DetId detid, double res_uncalib[],double res_calib[]);
255    
256    
257     void runEcalUncalibRecHitFixedAlphaBetaFitCluster(vector<DetId> id_clus, double res[]);
258    
259     void getDigiSample_v1(DetId detid, double adc[]);
260     void getDigiSample(DetId detid, double adc[]);
261     void getDigiSample_EndCap(DetId detid, double adc[]);
262    
263     /// input signal is in pe. Converted in GeV
264     void amplify(CaloSamples & clf) const;
265     double constantTerm() const;
266    
267    
268     // get HLTPaths with key 'key' from EventSetup (AlCaRecoTriggerBitsRcd)
269     std::vector<std::string> pathsFromSetup(const std::string &key,
270     const edm::EventSetup &iSetup) const;
271    
272    
273     void NtoNmatchingEta(float drMatch, vector<int> pairReco ,vector<int> &pairRecoMatchedtoGen, vector<int> &pairRecoMatchedtoGen1stPhtInd, vector<int> &genetaMatchedtoReco);
274     void NtoNmatchingPi0(float drMatch, vector<int> pairReco ,vector<int> &pairRecoMatchedtoGen, vector<int> &pairRecoMatchedtoGen1stPhtInd, vector<int> &genetaMatchedtoReco);
275    
276    
277    
278     void doSelectionAndFillTree(const edm::Event &evt, const edm::EventSetup &es, const reco::CaloID::Detectors detector, bool rmPiz, int pizEta,double s4s9Cut, double s9s25Cut, double minvMinCut, double minvMaxCut,
279     double isodetaCut, double isodrCut, double isoptCut, double isoCut );
280    
281    
282     private:
283     //virtual void beginJob(const edm::EventSetup&) ;
284     virtual void beginJob() ;
285     //virtual void analyze(const edm::Event&, const edm::EventSetup&);
286     virtual void analyze(const edm::Event&, const edm::EventSetup&);
287    
288     virtual void endJob() ;
289    
290     static const int PIZ = 1;
291     static const int ETA = 2;
292    
293     L1GtUtils m_l1GtUtils;
294    
295     typedef std::vector<std::string> vstring;
296    
297    
298    
299     std::vector<std::string> alcaL1trigNames_;
300    
301    
302     vector<string> listOfAlCaL1Trigs;
303    
304     void makeNxNClusters(const edm::Event &evt, const edm::EventSetup &es,
305     const EcalRecHitCollection *hits, const reco::CaloID::Detectors detector);
306    
307    
308     /// initialize the trigger conditions (call this if the trigger paths have changed)
309     //void init(const edm::TriggerResults & results, const edm::EventSetup &iSetup);
310     int init(const edm::TriggerResults & results, const edm::EventSetup &iSetup);
311    
312     edm::InputTag beamSpotInputTag_;
313    
314    
315     edm::InputTag m_l1GtTmLInputTag;
316    
317     // ----------member data ---------------------------
318    
319     ///From HLTrigger/HLTfilters/interface/HLTHighLevelDev.h
320     // replace the 2 strings with 1 InputTag of form label:instance
321     edm::InputTag inputTag_;
322     /// HLT trigger names
323     /// HLT trigger names
324     edm::TriggerNames triggerNames_;
325     ///edm::ParameterSetID triggerNamesID_;
326     /// false = and-mode (all requested triggers), true = or-mode (at least one)
327     bool andOr_;
328     /// throw on any requested trigger being unknown
329     bool throw_;
330     /// not empty => use read paths from AlCaRecoTriggerBitsRcd via this key
331     std::string eventSetupPathsKey_;
332     /// Watcher to be created and used if 'eventSetupPathsKey_' non empty:
333     edm::ESWatcher<AlCaRecoTriggerBitsRcd> *watchAlCaRecoTriggerBitsRcd_;
334     /// input patterns that will be expanded into trigger names
335     std::vector<std::string> HLTPatterns_;
336     /// for each trigger/pattern define a prescale.
337     /// Only a subset of the events per trigger will be selected
338     std::vector<uint32_t> HLTPrescales_;
339     /// This variable stores the prescales after pattern matching and expansion
340     std::vector<uint32_t> HLTPrescalesExpanded_;
341     /// Scalers for the prescaling, L1 style.
342     std::vector<uint32_t> HLTPrescalesScalers;
343     /// You can define a prescale after the filter logic has been applied
344     /// this is different from the single prescales. It can be applied on
345     /// top of the single trigger prescales
346     uint32_t HLTOverallPrescale_ ;
347     uint32_t HLTOverallPrescalesScaler_;
348     /// list of required HLT triggers by HLT name
349     std::vector<std::string> HLTPathsByName_;
350     /// list of required HLT triggers by HLT index
351     std::vector<unsigned int> HLTPathsByIndex_;
352    
353    
354    
355    
356    
357     double MinAmpl_;
358     bool dyn_pedestal;
359     double fAlpha_;//parameter of the shape
360     double fBeta_;//parameter of the shape
361     double fAmp_max_;// peak amplitude
362     double fTim_max_ ;// time of the peak (in 25ns units)
363     double fPed_max_;// pedestal value
364     double alfabeta_;
365    
366    
367     int fNb_iter_;
368     int fNum_samp_bef_max_ ;
369     int fNum_samp_after_max_;
370    
371     float fSigma_ped;
372     double un_sur_sigma;
373     //temporary solution for different alpha and beta
374     // float alpha_table_[36][1701];
375     // float beta_table_[36][1701];
376    
377     bool doFit_;
378    
379     double alphaEB_;
380     double betaEB_;
381     double alphaEE_;
382     double betaEE_;
383    
384    
385     const EcalSimParameterMap * theParameterMap;
386     const CaloVShape * theEcalShape;
387    
388     CaloHitResponse * theEcalResponse;
389    
390     bool applyConstantTerm_;
391     double rmsConstantTerm_;
392    
393     std::string srcVertex_;
394    
395     std::string hitsProducer_;
396    
397     edm::ESHandle<EcalIntercalibConstants> ical;
398    
399     const EcalIntercalibConstants *icalp;
400     //const EcalIntercalibConstantMap &iicalMap;
401     const EcalADCToGeVConstant *agcp;
402    
403     const EBDigiCollection* ebDigis ;
404     const EEDigiCollection* eeDigis ;
405    
406     // const EBDigiv1Collection* ebDigisv1 ;
407     // const EEDigiv1Collection* eeDigisv1 ;
408    
409    
410    
411     edm::ESHandle<EcalTimeCalibConstants> itime;
412     edm::ESHandle<EcalADCToGeVConstant> agc;
413     edm::ESHandle<EcalChannelStatus> chStatus;
414     std::vector<int> v_chstatus_;
415     edm::ESHandle<EcalLaserDbService> laser;
416    
417    
418     EcalElectronicsMapping* TheMapping;
419     edm::InputTag srcPixels_;
420    
421     edm::InputTag srcTowers_;
422    
423    
424     edm::InputTag barrelHits_;
425     edm::InputTag endcapHits_;
426    
427    
428     edm::InputTag barrelHitsEta_;
429     edm::InputTag endcapHitsEta_;
430    
431    
432    
433     int nhit_simeb[180][360];
434     float en_simeb[180][360][20];
435     float time_simeb[180][360][20];
436    
437    
438    
439     std::string pi0BarrelHits_;
440     std::string pi0EndcapHits_;
441     std::string etaBarrelHits_;
442     std::string etaEndcapHits_;
443    
444     std::string pi0ESHits_;
445     std::string etaESHits_;
446    
447     ///interal use
448     std::string BarrelHits_;
449     std::string EndcapHits_;
450     std::string ESHits_;
451    
452     struct LessById {
453     bool operator()(const SimTrack &tk1, const SimTrack &tk2) const { return tk1.trackId() < tk2.trackId(); }
454     bool operator()(const SimTrack &tk1, unsigned int id ) const { return tk1.trackId() < id; }
455     bool operator()(unsigned int id, const SimTrack &tk2) const { return id < tk2.trackId(); }
456     };
457    
458    
459    
460    
461     ////gen-level pi0/eta
462     vector<int> indpi0Gen;
463     vector<int> indetaGen;
464     vector<int> indpht1pi0Gen;
465     vector<int> indpht2pi0Gen;
466     vector<int> indpht1etaGen;
467     vector<int> indpht2etaGen;
468    
469    
470     int bunchX;
471     int orbitNumber;
472     int evtTime;
473    
474    
475    
476     int InputDataFormat_;
477     int procID;
478     float ptHAT;
479    
480    
481     int maxNumberofSeeds_;
482     int maxNumberofClusters_;
483    
484     int gammaCandEtaSize_;
485     int gammaCandPhiSize_;
486    
487     double clusSeedThr_;
488     double clusSeedThrEndCap_;
489    
490     int clusEtaSize_;
491     int clusPhiSize_;
492     double seleXtalMinEnergy_;
493     double seleXtalMinEnergyEndCap_;
494     int seleNRHMax_;
495    
496     //// for pi0->gg barrel
497     bool doSelForPi0Barrel_;
498     double selePtGamma_;
499     double selePtPi0_;
500     double seleMinvMaxPi0_;
501     double seleMinvMinPi0_;
502     double seleS4S9Gamma_;
503     double selePi0BeltDR_;
504     double selePi0BeltDeta_;
505     double selePi0Iso_;
506     double ptMinForIsolation_;
507     bool storeIsoClusRecHitPi0EB_;
508    
509    
510     ///for pi0->gg endcap
511     bool doSelForPi0Endcap_;
512     double selePtGammaEndCap_;
513     double selePtPi0EndCap_;
514     double region1_Pi0EndCap_;
515     double selePtGammaPi0EndCap_region1_;
516     double selePtPi0EndCap_region1_;
517     double region2_Pi0EndCap_;
518     double selePtGammaPi0EndCap_region2_;
519     double selePtPi0EndCap_region2_;
520     double selePtGammaPi0EndCap_region3_;
521     double selePtPi0EndCap_region3_;
522 yangyong 1.2 double selePtPi0MaxEndCap_region3_;
523    
524 yangyong 1.1 double seleMinvMaxPi0EndCap_;
525     double seleMinvMinPi0EndCap_;
526     double seleS4S9GammaEndCap_;
527     double selePi0IsoEndCap_;
528     double selePi0BeltDREndCap_;
529     double selePi0BeltDetaEndCap_;
530     double ptMinForIsolationEndCap_;
531     bool storeIsoClusRecHitPi0EE_;
532    
533    
534     ///for eta->gg barrel
535     bool doSelForEtaBarrel_;
536     double selePtGammaEta_;
537     double selePtEta_;
538     double seleS4S9GammaEta_;
539     double seleS9S25GammaEta_;
540     double seleMinvMaxEta_;
541     double seleMinvMinEta_;
542     double ptMinForIsolationEta_;
543     double seleEtaIso_;
544     double seleEtaBeltDR_;
545     double seleEtaBeltDeta_;
546     bool removePi0CandidatesForEta_;
547     double massLowPi0Cand_;
548     double massHighPi0Cand_;
549     bool store5x5RecHitEtaEB_;
550     bool store5x5IsoClusRecHitEtaEB_;
551     bool storeIsoClusRecHitEtaEB_;
552    
553    
554     ///for eta->gg endcap
555     bool doSelForEtaEndcap_;
556     double selePtGammaEtaEndCap_;
557     double seleS4S9GammaEtaEndCap_;
558     double seleS9S25GammaEtaEndCap_;
559     double selePtEtaEndCap_;
560     double region1_EtaEndCap_;
561     double selePtGammaEtaEndCap_region1_;
562     double selePtEtaEndCap_region1_;
563     double region2_EtaEndCap_;
564     double selePtGammaEtaEndCap_region2_;
565     double selePtEtaEndCap_region2_;
566     double selePtGammaEtaEndCap_region3_;
567     double selePtEtaEndCap_region3_;
568 yangyong 1.2 double selePtEtaMaxEndCap_region3_;
569    
570 yangyong 1.1 double seleMinvMaxEtaEndCap_;
571     double seleMinvMinEtaEndCap_;
572     double ptMinForIsolationEtaEndCap_;
573     double seleEtaIsoEndCap_;
574     double seleEtaBeltDREndCap_;
575     double seleEtaBeltDetaEndCap_;
576     bool storeIsoClusRecHitEtaEE_;
577     bool store5x5RecHitEtaEE_;
578     bool store5x5IsoClusRecHitEtaEE_;
579    
580    
581     bool doBarrel;
582     bool doEndcap;
583    
584    
585    
586     //pre-scale factors for different eta regions in Endcap, to suppress rate from high eta regions.
587     ///region1: |eta|<2; region2: 2<|eta|<2.5; region3: |eta|>2.5;
588     int preScale_endcapPi0_region1_;
589     int preScale_endcapPi0_region2_;
590     int preScale_endcapPi0_region3_;
591    
592     int preScale_endcapEta_region1_;
593     int preScale_endcapEta_region2_;
594     int preScale_endcapEta_region3_;
595    
596     ///global counts for selected
597     long int selected_endcapPi0_region1;
598     long int selected_endcapPi0_region2;
599     long int selected_endcapPi0_region3;
600    
601     long int selected_endcapEta_region1;
602     long int selected_endcapEta_region2;
603     long int selected_endcapEta_region3;
604    
605    
606     bool storeRecHitES_;
607     edm::InputTag preshHitProducer_; // name of module/plugin/producer producing hits
608     edm::InputTag preshHitProducerEta_; // name of module/plugin/producer producing hits
609    
610     ///whether or not to add ES energy when do selections
611     bool addESEnergyToEECluster_;
612     bool saveAllPhotonBarrel_;
613     bool saveAllPhotonEndcap_;
614    
615     bool doSelPiz_;
616     bool doSelEta_;
617    
618    
619     int preshNclust_;
620     double preshClustECut;
621     double etThresh_;
622     double calib_planeX_;
623     double calib_planeY_;
624     double mip_;
625     double gamma_;
626     PreshowerClusterAlgo * presh_algo; // algorithm doing the real work
627     PreshowerClusterAlgo::DebugLevel debugL;
628     // name out output ES cluster collections
629     std::string preshClusterCollectionX_;
630     std::string preshClusterCollectionY_;
631    
632    
633     bool ParameterLogWeighted_;
634     double ParameterX0_;
635     double ParameterT0_barl_;
636     double ParameterT0_endc_;
637     double ParameterT0_endcPresh_;
638     double ParameterW0_;
639    
640    
641     edm::InputTag l1IsolatedTag_;
642     edm::InputTag l1NonIsolatedTag_;
643     edm::InputTag l1SeedFilterTag_;
644    
645    
646     /// std::map<DetId, EcalRecHit> *recHitsEB_map;
647     ///replace by two vectors.
648    
649     std::vector<EBDetId> detIdEBRecHits;
650     std::vector<EcalRecHit> EBRecHits;
651    
652    
653     std::vector<EEDetId> detIdEERecHits;
654     std::vector<EcalRecHit> EERecHits;
655    
656    
657     std::vector<EBDetId> detIdEBRecHitsEta;
658     std::vector<EcalRecHit> EBRecHitsEta;
659    
660    
661     std::vector<EEDetId> detIdEERecHitsEta;
662     std::vector<EcalRecHit> EERecHitsEta;
663    
664    
665    
666     std::vector<EBDetId> alldetIdEBDigi;
667     std::vector<EEDetId> alldetIdEEDigi;
668    
669     // std::vector<EBDetId> alldetIdEBDigiv1;
670     // std::vector<EEDetId> alldetIdEEDigiv1;
671    
672    
673     //std::vector<EcalDigi> allEBDigi;
674     // std::vector<dataFrame> allEBDigi;
675    
676     edm::ESHandle<EcalGainRatios> pRatio;
677     edm::ESHandle<EcalPedestals> pedHandle;
678    
679    
680     bool Jets_;
681    
682     edm::InputTag CentralSource_;
683     edm::InputTag ForwardSource_;
684     edm::InputTag TauSource_;
685     bool JETSdoCentral_ ;
686     bool JETSdoForward_ ;
687     bool JETSdoTau_ ;
688     double Ptmin_jets_;
689     double Ptmin_taujets_;
690     double JETSregionEtaMargin_;
691     double JETSregionPhiMargin_;
692    
693    
694     int theMinBunch;
695     int theMaxBunch;
696    
697     int debug_;
698     bool first_;
699     double EMregionEtaMargin_;
700     double EMregionPhiMargin_;
701    
702     //parameter which decide which level of flags of EcalRecHit used for clustering.
703    
704    
705     bool useRecoFlag_;
706     bool useDBStatus_;
707     int flagLevelRecHitsToUse_;
708     int statusLevelRecHitsToUse_;
709     //number of minimal rechits for selected clusters.
710     int nMinRecHitsSel1stCluster_;
711     int nMinRecHitsSel2ndCluster_;
712    
713     edm::InputTag m_l1GtRecordInputTag;
714    
715     edm::InputTag m_vertexSrc; //offlinePViwthBS
716     edm::InputTag m_vertexSrc2; //offlinwPV
717    
718    
719    
720     int isFakeOffPVwithBS;
721     int isValidOffPVwithBS;
722     float xOffPVwithBS;
723     float yOffPVwithBS;
724     float zOffPVwithBS;
725    
726     float xErrOffPVwithBS;
727     float yErrOffPVwithBS;
728     float zErrOffPVwithBS;
729    
730     int NtrkOffPVwithBS;
731     float chi2OffPVwithBS;
732     int ndofOffPVwithBS;
733     float nchi2OffPVwithBS;
734    
735     //without BS
736    
737     int isFakeOffPV;
738     int isValidOffPV;
739     float xOffPV;
740     float yOffPV;
741     float zOffPV;
742    
743     float xErrOffPV;
744     float yErrOffPV;
745     float zErrOffPV;
746    
747     int NtrkOffPV;
748     float chi2OffPV;
749     int ndofOffPV;
750     float nchi2OffPV;
751    
752    
753    
754    
755     std::map<std::string,double> providedParameters;
756    
757    
758    
759     std::vector<int> FEDListUsed; ///by regional objects. ( em, jet, etc)
760    
761     std::vector<int> FEDListUsedBarrel;
762     std::vector<int> FEDListUsedEndcap;
763    
764     bool RegionalMatch_;
765    
766    
767     double ptMinEMObj_ ;
768    
769     std::map<DetId, EcalRecHit> esrechits_map;
770     std::set<DetId> used_strips;
771    
772     edm::InputTag ebDigiCollection_; // collection of EB digis
773     edm::InputTag eeDigiCollection_; // collection of EE digis
774    
775     edm::InputTag ebDigiCollectionv1_; // collection of EB digis
776     edm::InputTag eeDigiCollectionv1_; // collection of EE digis
777    
778    
779     int nErrorPrinted;
780    
781     static const int maxErrorToPrint = 100 ;
782    
783    
784     bool ecalDigiReFit_;
785    
786    
787     const CaloGeometry * theGeometry;
788    
789     // const CaloSubdetectorGeometry *geometry_eb;
790     // const CaloSubdetectorGeometry *geometry_ee;
791     // const CaloSubdetectorGeometry *geometry_es;
792     //const CaloSubdetectorTopology *topology_eb;
793     // const CaloSubdetectorTopology *topology_ee;
794     //CaloSubdetectorTopology *topology_es;
795    
796    
797     PositionCalc posCalculator_;
798    
799     static const int MAXCLUS = 2000;
800     static const int MAXPI0S = 200;
801    
802     int nEventsProcessed ;
803    
804     int nPassedBSC;
805     int nPassedBSC_noBeamHalo;
806    
807    
808     std::string outputFile_;
809    
810    
811    
812     TFile* rootFile_;
813     TTree* mytree_pizeb;
814     TTree* mytree_pizee;
815    
816    
817     TTree* mytree_etaeb;
818     TTree* mytree_etaee;
819    
820    
821    
822     TTree* mytree_pizbe;
823    
824    
825     TTree* mytree_hiteb;
826    
827     TTree* mytree_clus;
828    
829    
830     ///variable
831     float mpair_3x3;
832     float mpair_3x3v1;
833     float mpair_3x3v2;
834     float mpair_3x3v3;
835     float mpair_3x3test; //Z - 60 cm
836    
837    
838     float etapair_3x3;
839     float phipair_3x3;
840     float ptpair_3x3;
841    
842     float isolationPiz[5];/// 0, 0.3, 0.5, 0.7,1;
843     float isolationEta[5];/// 0, 0.3, 0.5, 0.7,1;
844    
845     ///no belt cone dr <0.3, 0.4, 0.5;
846     float isolationv1[3];
847    
848     float drpair_3x3;
849    
850     float gs4s9min;
851     float gs4s6min;
852     float gs6s9min;
853     float gs9s25min;
854     float openangle_3x3;
855    
856     int runNumber;
857     int evtNumber;
858     int lumiBlock;
859    
860     static const int MAXL1bits = 500;
861     static const int MAXHLTbits = 500;
862     int nL1bits;
863     int L1bits[MAXL1bits];
864    
865     int nL1bitsTech;
866     int L1bitsTech[MAXL1bits];
867    
868     int nL1Alca;
869     int L1Alca[MAXL1bits];
870    
871    
872     int nHLTbits;
873     int HLTbits[MAXHLTbits];
874    
875     ///for each of rechits, now add the sim energy and time
876     int nhitSimClus1[25];
877     float ehitSimClus1[25][20];
878     float thitSimClus1[25][20];
879    
880     int nhitSimClus2[25];
881     float ehitSimClus2[25][20];
882     float thitSimClus2[25][20];
883    
884     ///for each of rechit, add the added sim energy of each time , ( after pulse shape, )
885     /// in
886     float sXtalClus1[25][10];
887     float sXtalClus2[25][10];
888    
889    
890     ///this is what clustered
891     int nxtClus1;
892     float eXtalClus1[25];
893     int ietaXtalClus1[25];
894     int iphiXtalClus1[25];
895     float tXtalClus1[25];
896     int fXtalClus1[25];
897     int nxtClus2;
898     float eXtalClus2[25];
899     int ietaXtalClus2[25];
900     int iphiXtalClus2[25];
901     float tXtalClus2[25];
902     int fXtalClus2[25];
903     ///this is the 25-
904    
905     int nxt5x5Clus1;
906     float eXtal5x5Clus1[25];
907     int ietaXtal5x5Clus1[25];
908     int iphiXtal5x5Clus1[25];
909     float tXtal5x5Clus1[25];
910     int fXtal5x5Clus1[25];
911     int nxt5x5Clus2;
912     float eXtal5x5Clus2[25];
913     int ietaXtal5x5Clus2[25];
914     int iphiXtal5x5Clus2[25];
915     float tXtal5x5Clus2[25];
916     int fXtal5x5Clus2[25];
917    
918     //the same for all rechits in the cluster.
919     int izXtalClus1;
920     int izXtalClus2;
921    
922    
923    
924    
925     //digi
926     float dXtalClus1[25][11];
927     float dXtalClus2[25][11];
928    
929    
930    
931     float gptmin;
932    
933    
934    
935     int nxt9v1[2];
936    
937     float E25_3x3[2];
938     float E9_3x3[2];
939     float E6_3x3[2];
940     float E4_3x3[2];
941     float Et_3x3[2];
942     float pos_3x3[2][3];
943    
944    
945     ///ES cluster X/Y
946     float infoESX[2][8]; //[2] for the first / second cluster, [5]; es cluster x,y,z, phi, highest energy strip,eta,phi
947     float infoESY[2][8]; //[2] for the first / second cluster, [5]; es cluster e,eta, phi, highest energy strip,eta,phi
948    
949    
950     static const int MAXMC = 100000;
951     int nMCpart;
952     float pxMCpart[MAXMC];
953     float pyMCpart[MAXMC];
954     float pzMCpart[MAXMC];
955     float ptotMCpart[MAXMC];
956     float ptMCpart[MAXMC];
957     float eMCpart[MAXMC];
958     float etMCpart[MAXMC];
959     float etaMCpart[MAXMC];
960     float phiMCpart[MAXMC];
961     float mMCpart[MAXMC];
962     int chargeMCpart[MAXMC];
963     int pidMCpart[MAXMC];
964     int pidmomMCpart[MAXMC];
965     int barcodemomMCpart[MAXMC];
966     int nDauMCpart[MAXMC];
967     static const int MAXDAU = 100;
968     int barcodeDauMCpart[MAXMC][MAXDAU];
969     int statusMCpart[MAXMC];
970     float vtxXMCpart[MAXMC];
971     float vtxYMCpart[MAXMC];
972     float vtxZMCpart[MAXMC];
973    
974     int convPhtMCpart[MAXMC][3]; //only for status==1 Gen photon, and the two index to the two electrons
975    
976    
977     int npizallgen;
978     int netaallgen;
979    
980    
981     static const int MAXGenPIZ = 1000;
982    
983     int nGenpi0;
984     int nGeneta;
985     float etaGenpi0[MAXGenPIZ];
986     float phiGenpi0[MAXGenPIZ];
987     float etGenpi0[MAXGenPIZ];
988     float eGenpi0[MAXGenPIZ];
989     float mGenpi0[MAXGenPIZ];
990     float dr2phGenpi0[MAXGenPIZ];
991     float dr2phGeneta[MAXGenPIZ];
992     float etaGeneta[MAXGenPIZ];
993     float phiGeneta[MAXGenPIZ];
994     float etGeneta[MAXGenPIZ];
995     float eGeneta[MAXGenPIZ];
996     float ePhtGenpi0[MAXGenPIZ][2];
997     float etaPhtGenpi0[MAXGenPIZ][2];
998     float phiPhtGenpi0[MAXGenPIZ][2];
999     float ePhtGeneta[MAXGenPIZ][2];
1000     float etaPhtGeneta[MAXGenPIZ][2];
1001     float phiPhtGeneta[MAXGenPIZ][2];
1002     float vtxGenpi0[MAXGenPIZ][3];
1003     float vtxPhtGenpi0[MAXGenPIZ][3];
1004     float vtxGeneta[MAXGenPIZ][3];
1005     float vtxPhtGeneta[MAXGenPIZ][3];
1006    
1007    
1008     int pidMomGenpi0[MAXGenPIZ];
1009     int barcodeMomGenpi0[MAXGenPIZ];
1010    
1011     int pidMomGeneta[MAXGenPIZ];
1012     int barcodeMomGeneta[MAXGenPIZ];
1013    
1014     int isConvPhtGeneta[MAXGenPIZ][2];
1015     float convPht1Geneta[MAXGenPIZ][6]; ///e, eta, phi, e, eta, phi
1016     float convPht2Geneta[MAXGenPIZ][6]; ///e, eta, phi, e, eta, phi
1017    
1018     int isConvPhtGenpi0[MAXGenPIZ][2];
1019     float convPht1Genpi0[MAXGenPIZ][6]; ///e, eta, phi, e, eta, phi
1020     float convPht2Genpi0[MAXGenPIZ][6]; ///e, eta, phi, e, eta, phi
1021     float convVtxPhtGenpi0[MAXGenPIZ][6];
1022     float convVtxPhtGeneta[MAXGenPIZ][6];
1023    
1024    
1025    
1026     /* float geninfo[14]; */
1027     /* float geninfoeta[14]; */
1028    
1029    
1030     /* float geninfo[14]; */
1031     /* float geninfoeta[14]; */
1032    
1033     float geninfo[6];
1034     int convinfo[2];
1035    
1036    
1037    
1038     int conv[2];
1039    
1040     // L1 objects
1041     static const int MAXL1OBJ = 20;
1042     // static const int MAXL1BITS = 128;
1043     // L1 EM isolated objects
1044     int nL1EMIso;
1045     float L1EMIso_e[MAXL1OBJ];
1046     float L1EMIso_et[MAXL1OBJ];
1047     float L1EMIso_eta[MAXL1OBJ];
1048     float L1EMIso_phi[MAXL1OBJ];
1049     // L1 EM non-isolated objects
1050     int nL1EMnonIso;
1051     float L1EMnonIso_e[MAXL1OBJ];
1052     float L1EMnonIso_et[MAXL1OBJ];
1053     float L1EMnonIso_eta[MAXL1OBJ];
1054     float L1EMnonIso_phi[MAXL1OBJ];
1055    
1056    
1057     bool saveEGObj_;
1058     bool saveAllRecHitEB_;
1059     bool saveAllRecHitEE_;
1060    
1061    
1062     static const int MAXEB = 61200;
1063     int nEB;
1064     int ietaEB[MAXEB];
1065     int iphiEB[MAXEB];
1066     int rEB[MAXEB];
1067     int digiEB[MAXEB][12];
1068     float simEB[MAXEB][10];
1069     float eEB[MAXEB];
1070    
1071     static const int MAXEE = 61200;
1072     int nEE;
1073     int ietaEE[MAXEE];
1074     int iphiEE[MAXEE];
1075     int izEE[MAXEE];
1076     int rEE[MAXEE];
1077     int digiEE[MAXEE][12];
1078     float eEE[MAXEE];
1079    
1080     int nSeeds;
1081     int nClusters;
1082    
1083    
1084    
1085     static const int MAX3x3ClusEB = 2000;
1086     int n3x3ClusEB;
1087     float e3x3ClusEB[MAX3x3ClusEB];
1088     float eta3x3ClusEB[MAX3x3ClusEB];
1089     float phi3x3ClusEB[MAX3x3ClusEB];
1090    
1091     ///tmp by simplelog
1092     float leta3x3ClusEB[MAX3x3ClusEB];
1093     float lphi3x3ClusEB[MAX3x3ClusEB];
1094    
1095    
1096     float x3x3ClusEB[MAX3x3ClusEB];
1097     float y3x3ClusEB[MAX3x3ClusEB];
1098     float z3x3ClusEB[MAX3x3ClusEB];
1099    
1100     int nXt3x3ClusEB[MAX3x3ClusEB];
1101     float eXt3x3ClusEB[MAX3x3ClusEB][9];
1102     float tXt3x3ClusEB[MAX3x3ClusEB][9];
1103     int ietaXt3x3ClusEB[MAX3x3ClusEB][9]; ///index from -85,0,84; ,
1104     int iphiXt3x3ClusEB[MAX3x3ClusEB][9]; ///phi, 0,359
1105     float etaXt3x3ClusEB[MAX3x3ClusEB][9];
1106     float phiXt3x3ClusEB[MAX3x3ClusEB][9];
1107    
1108    
1109     float xXt3x3ClusEB[MAX3x3ClusEB][9];
1110     float yXt3x3ClusEB[MAX3x3ClusEB][9];
1111     float zXt3x3ClusEB[MAX3x3ClusEB][9];
1112     float S43x3ClusEB[MAX3x3ClusEB];
1113     float S63x3ClusEB[MAX3x3ClusEB];
1114     float S253x3ClusEB[MAX3x3ClusEB];
1115    
1116     float s4s93x3ClusEB[MAX3x3ClusEB];
1117     float s6s93x3ClusEB[MAX3x3ClusEB];
1118     float s9s253x3ClusEB[MAX3x3ClusEB];
1119    
1120    
1121    
1122     static const int MAX3x3ClusEE = 2000;
1123     int n3x3ClusEE;
1124     float e3x3ClusEE[MAX3x3ClusEE];
1125     float eta3x3ClusEE[MAX3x3ClusEE];
1126     float phi3x3ClusEE[MAX3x3ClusEE];
1127    
1128     ///tmp by simplelog
1129     float leta3x3ClusEE[MAX3x3ClusEE];
1130     float lphi3x3ClusEE[MAX3x3ClusEE];
1131    
1132    
1133     float x3x3ClusEE[MAX3x3ClusEE];
1134     float y3x3ClusEE[MAX3x3ClusEE];
1135     float z3x3ClusEE[MAX3x3ClusEE];
1136    
1137     int nXt3x3ClusEE[MAX3x3ClusEE];
1138     float eXt3x3ClusEE[MAX3x3ClusEE][9];
1139     float tXt3x3ClusEE[MAX3x3ClusEE][9];
1140     int ixXt3x3ClusEE[MAX3x3ClusEE][9]; ///index from -85,0,84; ,
1141     int iyXt3x3ClusEE[MAX3x3ClusEE][9]; ///phi, 0,359
1142     int izXt3x3ClusEE[MAX3x3ClusEE][9]; ///phi, 0,359
1143    
1144     float etaXt3x3ClusEE[MAX3x3ClusEE][9];
1145     float phiXt3x3ClusEE[MAX3x3ClusEE][9];
1146    
1147    
1148     float xXt3x3ClusEE[MAX3x3ClusEE][9];
1149     float yXt3x3ClusEE[MAX3x3ClusEE][9];
1150     float zXt3x3ClusEE[MAX3x3ClusEE][9];
1151     float S43x3ClusEE[MAX3x3ClusEE];
1152     float S63x3ClusEE[MAX3x3ClusEE];
1153     float S253x3ClusEE[MAX3x3ClusEE];
1154    
1155     float s4s93x3ClusEE[MAX3x3ClusEE];
1156     float s6s93x3ClusEE[MAX3x3ClusEE];
1157     float s9s253x3ClusEE[MAX3x3ClusEE];
1158    
1159    
1160     double hfETowerh_;
1161    
1162     int nPxlHits ;
1163     float clusVtxQual;
1164    
1165     int nHfTowersP ;
1166     int nHfTowersN ;
1167    
1168     float sumHfEsubEpPlus;
1169     float sumHfEsubEpMinus;
1170    
1171     float sumHfEaddEpPlus;
1172     float sumHfEaddEpMinus;
1173    
1174    
1175     int phyDeclared;
1176    
1177     float highPurityTrackFrac;
1178    
1179     edm::InputTag m_tracksSrc;
1180     static const int MAXTRK = 5000;
1181     int nTracks;
1182     float pxTracks[MAXTRK];
1183     float pyTracks[MAXTRK];
1184     float pzTracks[MAXTRK];
1185     float pTracks[MAXTRK];
1186     float ptTracks[MAXTRK];
1187     float etaTracks[MAXTRK];
1188     float phiTracks[MAXTRK];
1189     int pidTracks[MAXTRK];
1190     int chargeTracks[MAXTRK];
1191     float vxTracks[MAXTRK];
1192     float vyTracks[MAXTRK];
1193     float vzTracks[MAXTRK];
1194     int nhitsTracks[MAXTRK];
1195     float nChi2Tracks[MAXTRK];
1196     int algoTracks[MAXTRK];
1197     int ndofTracks[MAXTRK];
1198     int nValidhitsTracks[MAXTRK];
1199     int nValidpixelhitsTracks[MAXTRK];
1200     int nValidstriphitsTracks[MAXTRK];
1201     int qualityFlagTracks[MAXTRK];
1202    
1203     float vBeamSpot[3];
1204    
1205    
1206    
1207    
1208     ///generated ch
1209     int nChaGen;
1210     float ptChaGen[MAXMC];
1211     float etaChaGen[MAXMC];
1212     int pidChaGen[MAXMC];
1213     int chaChaGen[MAXMC];
1214     int staChaGen[MAXMC];
1215    
1216    
1217     bool reRunPixelRecHits_;
1218    
1219    
1220     ////peak after some selection.
1221     TH1F *hh_mpair[10];
1222    
1223    
1224     TH1F *hh_vtx_mc[10];
1225    
1226     TH1F *hh_L1bitFired;
1227     TH1F *hh_L1bitTechFired;
1228    
1229     int nL1bits_fired[200];
1230     int nL1bitsTech_fired[200];
1231    
1232    
1233     ///trackerOnlyConversion
1234    
1235     static const int nMaxTrkOnlyConv = 1000;
1236     int nTrkOnlyConv;
1237     float vtxLTrkOnlyConv[nMaxTrkOnlyConv][3];
1238     float vtxRTrkOnlyConv[nMaxTrkOnlyConv][3];
1239     float nChi2LTrkOnlyConv[nMaxTrkOnlyConv];
1240     float nChi2RTrkOnlyConv[nMaxTrkOnlyConv];
1241     int rechitSizeLTrkOnlyConv[nMaxTrkOnlyConv];
1242     int rechitSizeRTrkOnlyConv[nMaxTrkOnlyConv];
1243     float zPVTrkOnlyConv[nMaxTrkOnlyConv];
1244    
1245     float nChi2vtxTrkOnlyConv[nMaxTrkOnlyConv];
1246     int ndofvtxTrkOnlyConv[nMaxTrkOnlyConv];
1247    
1248    
1249     float ptLTrkOnlyConv[nMaxTrkOnlyConv];
1250     float etaLTrkOnlyConv[nMaxTrkOnlyConv];
1251     float phiLTrkOnlyConv[nMaxTrkOnlyConv];
1252    
1253     float ptRTrkOnlyConv[nMaxTrkOnlyConv];
1254     float etaRTrkOnlyConv[nMaxTrkOnlyConv];
1255     float phiRTrkOnlyConv[nMaxTrkOnlyConv];
1256    
1257    
1258    
1259     float vtxTrkOnlyConv[nMaxTrkOnlyConv][3];
1260     float dmApproachTrkOnlyConv[nMaxTrkOnlyConv];
1261     float dphiTrackatVtxTrkOnlyConv[nMaxTrkOnlyConv];
1262     float pairPtTrkOnlyConv[nMaxTrkOnlyConv];
1263     float pairEtaTrkOnlyConv[nMaxTrkOnlyConv];
1264     float pairPhiTrkOnlyConv[nMaxTrkOnlyConv];
1265     float pairMTrkOnlyConv[nMaxTrkOnlyConv];
1266    
1267    
1268     float pairCotThetaTrkOnlyConv[nMaxTrkOnlyConv];
1269     float dPhiTracksAtEcalTrkOnlyConv[nMaxTrkOnlyConv];
1270     float dEtaTracksAtEcalTrkOnlyConv[nMaxTrkOnlyConv];
1271    
1272     edm::InputTag convLabel;
1273    
1274    
1275     int nClus;
1276    
1277     ///this is for pi0->gg barrel
1278     vector<double> eClus;
1279     vector<double> eClusv1;
1280     vector<double> etClus;
1281     vector<double> etaClus;
1282     vector<double> thetaClus;
1283     vector<double> phiClus;
1284     vector< vector<EcalRecHit> > RecHitsCluster;
1285     vector< vector<EcalRecHit> > RecHitsCluster5x5;
1286     vector<double> s4s9Clus;
1287     vector<double> s4s6Clus;
1288     vector<double> s6s9Clus;
1289     vector<double> s9s25Clus;
1290     vector<double> e4Clus;
1291     vector<double> e6Clus;
1292     vector<double> e9Clus;
1293     vector<double> e25Clus;
1294     vector<double> xClus;
1295     vector<double> yClus;
1296     vector<double> zClus;
1297     vector<int> nXtv1Clus; ///number of Xtal , no matter if it is clustered or not
1298    
1299    
1300     float mpair;
1301     float mpairv1;
1302     float ptpair;
1303     float etapair;
1304     float phipair;
1305     float ptmin;
1306     float isolation;
1307    
1308     int genMatched;
1309    
1310     float s4s9min;
1311     float s9s25min;
1312    
1313     ///adding L1 trigger info
1314     int L1_SingleIsoEG5;
1315     int L1_SingleIsoEG8;
1316     int L1_SingleIsoEG10;
1317     int L1_SingleIsoEG12;
1318     int L1_SingleIsoEG15;
1319     int L1_SingleEG2;
1320     int L1_SingleEG5;
1321     int L1_SingleEG8;
1322     int L1_SingleEG10;
1323     int L1_SingleEG12;
1324     int L1_SingleEG15;
1325     int L1_SingleEG20;
1326     int L1_SingleJet6U;
1327     int L1_SingleJet10U;
1328     int L1_SingleJet20U;
1329     int L1_SingleJet30U;
1330     int L1_SingleJet40U;
1331     int L1_SingleJet50U;
1332     int L1_DoubleJet30U;
1333     int L1_DoubleEG5;
1334    
1335    
1336     int fullRECO_;
1337    
1338     bool removeSpike_;
1339    
1340    
1341    
1342     TH1I *hh_mul_ieta;
1343     TH1I *hh_mul_iphi;
1344    
1345    
1346     TH1I *hh_mul_ietaSeed;
1347     TH1I *hh_mul_iphiSeed;
1348    
1349    
1350     TH1I *hh_mul_ietaSeedClus;
1351     TH1I *hh_mul_iphiSeedClus;
1352    
1353    
1354     TH1I *hh_mul_ietaSeedSel;
1355     TH1I *hh_mul_iphiSeedSel;
1356    
1357    
1358    
1359     };