CMS 3D CMS Logo

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

#include <Calibration/EcalCalibAlgos/src/ZeeCalibration.cc>

Inheritance diagram for ZeeCalibration:
edm::ESProducerLooper edm::ESProducer edm::EventSetupRecordIntervalFinder edm::EDLooper edm::ESProxyFactoryProducer edm::EDLooperBase edm::eventsetup::DataProxyProvider

Public Member Functions

virtual void beginOfJob ()
 Called at beginning of job. More...
 
virtual Status duringLoop (const edm::Event &, const edm::EventSetup &)
 Called at each event. More...
 
virtual void endOfJob ()
 Called at end of job. More...
 
virtual Status endOfLoop (const edm::EventSetup &, unsigned int iLoop)
 Called at end of loop. More...
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 Dummy implementation (job done in duringLoop) More...
 
virtual std::shared_ptr< EcalIntercalibConstantsproduceEcalIntercalibConstants (const EcalIntercalibConstantsRcd &iRecord)
 Produce Ecal interCalibrations. More...
 
virtual void startingNewLoop (unsigned int iLoop)
 Called at beginning of loop. More...
 
 ZeeCalibration (const edm::ParameterSet &iConfig)
 Constructor. More...
 
 ~ZeeCalibration ()
 Destructor. More...
 
- Public Member Functions inherited from edm::ESProducerLooper
 ESProducerLooper ()
 
virtual std::set< eventsetup::EventSetupRecordKeymodifyingRecords () const
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 
- Public Member Functions inherited from edm::EDLooper
 EDLooper ()
 
 EDLooper (EDLooper const &)=delete
 
EDLooperoperator= (EDLooper const &)=delete
 
virtual ~EDLooper ()
 
- Public Member Functions inherited from edm::EDLooperBase
virtual void attachTo (ActivityRegistry &)
 Override this method if you need to monitor the state of the processing. More...
 
virtual void beginOfJob (EventSetup const &)
 
void copyInfo (ScheduleInfo const &)
 
void doBeginLuminosityBlock (LuminosityBlockPrincipal &, EventSetup const &, ProcessContext *)
 
void doBeginRun (RunPrincipal &, EventSetup const &, ProcessContext *)
 
Status doDuringLoop (EventPrincipal &eventPrincipal, EventSetup const &es, ProcessingController &, StreamContext *)
 
void doEndLuminosityBlock (LuminosityBlockPrincipal &, EventSetup const &, ProcessContext *)
 
Status doEndOfLoop (EventSetup const &es)
 
void doEndRun (RunPrincipal &, EventSetup const &, ProcessContext *)
 
void doStartingNewLoop ()
 
 EDLooperBase ()
 
 EDLooperBase (EDLooperBase const &)=delete
 
EDLooperBaseoperator= (EDLooperBase const &)=delete
 
void prepareForNextLoop (eventsetup::EventSetupProvider *esp)
 
void setActionTable (ExceptionToActionTable const *actionTable)
 
void setModuleChanger (ModuleChanger *)
 
virtual ~EDLooperBase () noexcept(false)
 

Private Member Functions

void bookHistograms ()
 
float computeCoefficientDistanceAtIteration (float v1[250], float v2[250], int size)
 
float EvalDPhi (float Phi, float Phi_ref)
 
float EvalDR (float Eta, float Eta_ref, float Phi, float Phi_ref)
 
double fEtaBarrelBad (double scEta) const
 
double fEtaBarrelGood (double scEta) const
 
double fEtaEndcapBad (double scEta) const
 
double fEtaEndcapGood (double scEta) const
 
void fillEleInfo (std::vector< HepMC::GenParticle * > &a, std::map< HepMC::GenParticle *, const reco::GsfElectron * > &b)
 
void fillMCInfo (HepMC::GenParticle *mcele)
 
void fillMCmap (const std::vector< const reco::GsfElectron * > *electronCollection, const std::vector< HepMC::GenParticle * > &mcEle, std::map< HepMC::GenParticle *, const reco::GsfElectron * > &myMCmap)
 
double getEtaCorrection (const reco::GsfElectron *)
 
std::pair< DetId, double > getHottestDetId (const std::vector< std::pair< DetId, float > > &mySCRecHits, const EBRecHitCollection *ebhits, const EERecHitCollection *eehits)
 
void printStatistics ()
 
void resetHistograms ()
 
void resetVariables ()
 
int ringNumberCorrector (int k)
 
bool xtalIsOnModuleBorder (EBDetId myEBDetId)
 

Private Attributes

char aHLTNames [6000]
 
bool aHLTResults [200]
 
TString aNames [200]
 
char aTriggerNames [200][30]
 
bool aTriggerResults [200]
 
int BARREL_ELECTRONS_AFTER_BORDER_CUT
 
int BARREL_ELECTRONS_BEFORE_BORDER_CUT
 
std::string barrelfile_
 
Int_t BBZN
 
Int_t BBZN_gg
 
Int_t BBZN_t0
 
Int_t BBZN_tt
 
float calibCoeff [250]
 
float calibCoeffError [250]
 
std::string calibMode_
 
double coefficientDistanceAtIteration [50]
 
int CRACK_ELECTRONS_IN_BARREL
 
int CRACK_ELECTRONS_IN_ENDCAP
 
Int_t EBZN
 
Int_t EBZN_gg
 
Int_t EBZN_t0
 
Int_t EBZN_tt
 
Int_t EEZN
 
Int_t EEZN_gg
 
Int_t EEZN_t0
 
Int_t EEZN_tt
 
std::string electronCollection_
 
std::string electronProducer_
 
unsigned int electronSelection_
 
std::string endcapfile_
 
std::string erechitCollection_
 
std::string erechitProducer_
 
unsigned int etaBins_
 
double etaMax_
 
double etaMin_
 
unsigned int etBins_
 
double etMax_
 
double etMin_
 
int GOLDEN_ELECTRONS_IN_BARREL
 
int GOLDEN_ELECTRONS_IN_ENDCAP
 
TH1F * h1_borderElectronClassification_
 
TH1F * h1_eleClasses_
 
TH1F * h1_electronCosTheta_SC_
 
TH1F * h1_electronCosTheta_SC_TK_
 
TH1F * h1_electronCosTheta_TK_
 
TH1F * h1_eleERecoOverEtrue_
 
TH1F * h1_eleEtaResol_
 
TH1F * h1_elePhiResol_
 
TH1F * h1_eventsAfterBorderSelection_
 
TH1F * h1_eventsAfterEWKSelection_
 
TH1F * h1_eventsBeforeBorderSelection_
 
TH1F * h1_eventsBeforeEWKSelection_
 
TH1F * h1_mc_
 
TH1F * h1_mcEB_
 
TH1F * h1_mcEBParz_ [25]
 
TH1F * h1_mcEE_
 
TH1F * h1_mcEEParz_ [25]
 
TH1F * h1_mcParz_ [25]
 
TH1F * h1_nEleReco_
 
TH1F * h1_occupancy_
 
TH1F * h1_occupancyBarrel_
 
TH1F * h1_occupancyEndcap_
 
TH1F * h1_occupancyVsEta_
 
TH1F * h1_occupancyVsEtaCrack_
 
TH1F * h1_occupancyVsEtaGold_
 
TH1F * h1_occupancyVsEtaShower_
 
TH1F * h1_occupancyVsEtaSilver_
 
TH1F * h1_preshowerOverSC_
 
TH1F * h1_reco_ZMass_
 
TH1F * h1_reco_ZMassBad_
 
TH1F * h1_reco_ZMassCorr_
 
TH1F * h1_reco_ZMassCorrBB_
 
TH1F * h1_reco_ZMassCorrEE_
 
TH1F * h1_reco_ZMassGood_
 
TH1F * h1_RMin_
 
TH1F * h1_RMinZ_
 
TH1F * h1_seedOverSC_
 
TH1F * h1_weightSumMeanBarrel_
 
TH1F * h1_weightSumMeanEndcap_
 
TH1F * h1_ZCandMult_
 
TH1F * h1_zEtaResol_
 
TH1F * h1_zMassResol_
 
TH1F * h1_zPhiResol_
 
TH2F * h2_chi2_ [25]
 
TH2F * h2_coeffVsEta_
 
TH2F * h2_coeffVsEtaGrouped_
 
TH2F * h2_coeffVsLoop_
 
TH2F * h2_fEtaBarrelBad_
 
TH2F * h2_fEtaBarrelGood_
 
TH2F * h2_fEtaEndcapBad_
 
TH2F * h2_fEtaEndcapGood_
 
TH2F * h2_iterations_ [25]
 
TH2F * h2_miscalRecal_
 
TH2F * h2_miscalRecalEB_
 
TH2F * h2_miscalRecalEE_
 
TH2F * h2_residualSigma_
 
TH2F * h2_xtalMiscalibCoeffBarrel_
 
TH2F * h2_xtalMiscalibCoeffEndcapMinus_
 
TH2F * h2_xtalMiscalibCoeffEndcapPlus_
 
TH2F * h2_xtalRecalibCoeffBarrel_ [25]
 
TH2F * h2_xtalRecalibCoeffEndcapMinus_ [25]
 
TH2F * h2_xtalRecalibCoeffEndcapPlus_ [25]
 
TH2F * h2_zMassDiffVsLoop_
 
TH2F * h2_zMassVsLoop_
 
TH2F * h2_zWidthVsLoop_
 
TH1F * h_eleEffEta [2]
 
TH1F * h_eleEffEta_ [2]
 
TH1F * h_eleEffPhi [2]
 
TH1F * h_eleEffPhi_ [2]
 
TH1F * h_eleEffPt [2]
 
TH1F * h_eleEffPt_ [2]
 
TH1F * h_ESCcorrEtrue_ [25]
 
TH2F * h_ESCcorrEtrueVsEta_ [25]
 
TH1F * h_ESCEtrue_ [25]
 
TH2F * h_ESCEtrueVsEta_ [25]
 
std::vector< unsigned int > hlAccept_
 
std::vector< unsigned int > hlErrors_
 
std::vector< std::string > hlNames_
 
Int_t hltCount
 
Int_t hltNamesLen
 
edm::InputTag hlTriggerResults_
 
std::vector< unsigned int > hlWasRun_
 
std::shared_ptr< EcalIntercalibConstantsical
 
bool init_
 
float initCalibCoeff [250]
 
bool isfirstcall_
 
double loopArray [50]
 
int loopFlag_
 
double mass
 
float mass4tree
 
float massDiff4tree
 
double maxInvMassCut_
 
std::string mcProducer_
 
Int_t MCZBB
 
Int_t MCZEB
 
Int_t MCZEE
 
double minInvMassCut_
 
TTree * myTree
 
ZeePlotsmyZeePlots_
 
ZeeRescaleFactorPlotsmyZeeRescaleFactorPlots_
 
unsigned int nAccept_
 
unsigned int nErrors_
 
unsigned int nEvents_
 
Int_t NEVT
 
float NewCalibCoeff [250]
 
unsigned int nWasRun_
 
TFile * outputFile_
 
std::string outputFileName_
 
int read_events
 
std::string RecalibBarrelHits_
 
std::string rechitCollection_
 
std::string rechitProducer_
 
std::string scCollection_
 
std::string scIslandCollection_
 
std::string scIslandProducer_
 
std::string scProducer_
 
int SHOWER_ELECTRONS_IN_BARREL
 
int SHOWER_ELECTRONS_IN_ENDCAP
 
double sigmaArray [50]
 
double sigmaErrorArray [50]
 
int SILVER_ELECTRONS_IN_BARREL
 
int SILVER_ELECTRONS_IN_ENDCAP
 
ZIterativeAlgorithmWithFittheAlgorithm_
 
unsigned int theMaxLoops
 
edm::ParameterSet theParameterSet
 
int TOTAL_ELECTRONS_IN_BARREL
 
int TOTAL_ELECTRONS_IN_ENDCAP
 
Int_t triggerCount
 
bool wantEtaCorrection_
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Public Types inherited from edm::EDLooperBase
enum  Status { kContinue, kStop }
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducerLooper
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void setIntervalFor (const eventsetup::EventSetupRecordKey &iKey, const IOVSyncValue &iTime, ValidityInterval &oInterval)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 
- Protected Member Functions inherited from edm::EDLooperBase
ModuleChangermoduleChanger ()
 This only returns a non-zero value during the call to endOfLoop. More...
 
ScheduleInfo const * scheduleInfo () const
 This returns a non-zero value after the constructor has been called. More...
 

Detailed Description

Description: Perform single electron calibration (tested on TB data only).

Implementation: <Notes on="" implementation>="">

Definition at line 72 of file ZeeCalibration.h.

Constructor & Destructor Documentation

ZeeCalibration::ZeeCalibration ( const edm::ParameterSet iConfig)

Constructor.

Definition at line 78 of file ZeeCalibration.cc.

References barrelfile_, calibMode_, coefficientDistanceAtIteration, gather_cfg::cout, electronCollection_, electronProducer_, electronSelection_, endcapfile_, erechitCollection_, erechitProducer_, etaBins_, etaMax_, etaMin_, etBins_, etMax_, etMin_, EcalIndexingTools::getInstance(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hlTriggerResults_, mps_fire::i, loopArray, mass4tree, massDiff4tree, maxInvMassCut_, mcProducer_, minInvMassCut_, myTree, outputFile_, outputFileName_, produceEcalIntercalibConstants(), rechitCollection_, rechitProducer_, scCollection_, scIslandCollection_, scIslandProducer_, scProducer_, EcalIndexingTools::setBinRange(), edm::ESProducer::setWhatProduced(), sigmaArray, sigmaErrorArray, AlCaHLTBitMon_QueryRunRegistry::string, theAlgorithm_, theMaxLoops, theParameterSet, and wantEtaCorrection_.

79 {
80 
81 #ifdef DEBUG
82  std::cout<<"[ZeeCalibration] Starting the ctor"<<std::endl;
83 #endif
84 
85  theMaxLoops = iConfig.getUntrackedParameter<unsigned int>("maxLoops",0);
86 
87  wantEtaCorrection_ = iConfig.getUntrackedParameter<bool>("wantEtaCorrection",true);
88 
89  outputFileName_ = iConfig.getParameter<std::string>("outputFile");
90 
91  minInvMassCut_ = iConfig.getUntrackedParameter<double>("minInvMassCut", 70.);
92  maxInvMassCut_ = iConfig.getUntrackedParameter<double>("maxInvMassCut", 110.);
93 
94  rechitProducer_ = iConfig.getParameter<std::string>("rechitProducer");
95  rechitCollection_ = iConfig.getParameter<std::string>("rechitCollection");
96 
97  erechitProducer_ = iConfig.getParameter<std::string>("erechitProducer");
98  erechitCollection_ = iConfig.getParameter<std::string>("erechitCollection");
99 
100  scProducer_ = iConfig.getParameter<std::string>("scProducer");
101  scCollection_ = iConfig.getParameter<std::string>("scCollection");
102 
103  scIslandProducer_ = iConfig.getParameter<std::string>("scIslandProducer");
104  scIslandCollection_ = iConfig.getParameter<std::string>("scIslandCollection");
105 
106  calibMode_ = iConfig.getUntrackedParameter<std::string>("ZCalib_CalibType");
107 
108  mcProducer_ = iConfig.getUntrackedParameter<std::string>("mcProducer","");
109 
110 
111  electronProducer_ = iConfig.getParameter<std::string > ("electronProducer");
112  electronCollection_ = iConfig.getParameter<std::string > ("electronCollection");
113 
114  outputFile_ = TFile::Open(outputFileName_.c_str(),"RECREATE"); // open output file to store histograms
115 
116  myTree = new TTree("myTree","myTree");
117  // myTree->Branch("zMass","zMass", &mass);
118  myTree->Branch("zMass",&mass4tree,"mass/F");
119  myTree->Branch("zMassDiff",&massDiff4tree,"massDiff/F");
120 
121  barrelfile_=iConfig.getUntrackedParameter<std::string> ("initialMiscalibrationBarrel","");
122  endcapfile_=iConfig.getUntrackedParameter<std::string> ("initialMiscalibrationEndcap","");
123 
124  electronSelection_=iConfig.getUntrackedParameter<unsigned int> ("electronSelection",0);//option for electron selection
125 
126  etaBins_ = iConfig.getUntrackedParameter<unsigned int>("etaBins", 10);
127  etBins_ = iConfig.getUntrackedParameter<unsigned int>("etBins", 10);
128 
129  etaMin_ = iConfig.getUntrackedParameter<double>("etaMin", 0.);
130  etMin_ = iConfig.getUntrackedParameter<double>("etMin", 0.);
131  etaMax_ = iConfig.getUntrackedParameter<double>("etaMax", 3.);
132  etMax_ = iConfig.getUntrackedParameter<double>("etMax", 100.);
133 
134 
135  // new ZeePlots("zeePlots.root");
136  // ZeePlots->bookHistos();
137 
138  //ZeeCalibrationPLots("zeeCalibPlots");
139  //ZeecaPlots->bookHistos(maxsIter);
140 
141  hlTriggerResults_ = iConfig.getParameter<edm::InputTag> ("HLTriggerResults");
142 
143  theParameterSet=iConfig;
144  EcalIndexingTools* myIndexTool=0;
145 
146 
147  myIndexTool = EcalIndexingTools::getInstance();
148 
149  myIndexTool->setBinRange( etaBins_, etaMin_, etaMax_, etBins_, etMin_, etMax_ );
150 
151  //creating the algorithm
153 
154  // Tell the framework what data is being produced
155  //setWhatProduced(this);
157  findingRecord<EcalIntercalibConstantsRcd> () ;
158 
159  for(int i = 0; i<50; i++){
160 
162  loopArray[i] = -1.;
163  sigmaArray[i] = -1.;
164  sigmaErrorArray[i] = -1.;
165 
166  }
167 
168 #ifdef DEBUG
169  std::cout<<"[ZeeCalibration] Done with the ctor"<<std::endl;
170 #endif
171 
172 }
unsigned int etBins_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string calibMode_
std::string outputFileName_
void setBinRange(int, double, double, int, double, double)
std::string scIslandCollection_
std::string electronCollection_
unsigned int theMaxLoops
edm::InputTag hlTriggerResults_
std::string endcapfile_
std::string rechitCollection_
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::string rechitProducer_
std::string scIslandProducer_
double sigmaArray[50]
static EcalIndexingTools * getInstance()
std::string scProducer_
std::string erechitProducer_
ZIterativeAlgorithmWithFit * theAlgorithm_
unsigned int electronSelection_
double coefficientDistanceAtIteration[50]
std::string scCollection_
unsigned int etaBins_
edm::ParameterSet theParameterSet
double loopArray[50]
std::string mcProducer_
virtual std::shared_ptr< EcalIntercalibConstants > produceEcalIntercalibConstants(const EcalIntercalibConstantsRcd &iRecord)
Produce Ecal interCalibrations.
std::string barrelfile_
std::string electronProducer_
std::string erechitCollection_
double sigmaErrorArray[50]
ZeeCalibration::~ZeeCalibration ( )

Destructor.

Definition at line 175 of file ZeeCalibration.cc.

176 {
177 // if (theAlgorithm_)
178 // delete theAlgorithm_;
179 }

Member Function Documentation

void ZeeCalibration::beginOfJob ( )
virtual

Called at beginning of job.

Reimplemented from edm::EDLooperBase.

Definition at line 190 of file ZeeCalibration.cc.

References isfirstcall_.

Referenced by produce().

190 {isfirstcall_=true;}
void ZeeCalibration::bookHistograms ( )
private

Definition at line 1689 of file ZeeCalibration.cc.

References ZeePlots::bookEleHistograms(), ZeePlots::bookEleMCHistograms(), ZeePlots::bookZHistograms(), ZeePlots::bookZMCHistograms(), h1_borderElectronClassification_, h1_eleClasses_, h1_electronCosTheta_SC_, h1_electronCosTheta_SC_TK_, h1_electronCosTheta_TK_, h1_eleEtaResol_, h1_elePhiResol_, h1_eventsAfterBorderSelection_, h1_eventsAfterEWKSelection_, h1_eventsBeforeBorderSelection_, h1_eventsBeforeEWKSelection_, h1_mc_, h1_mcEB_, h1_mcEBParz_, h1_mcEE_, h1_mcEEParz_, h1_mcParz_, h1_nEleReco_, h1_occupancy_, h1_occupancyBarrel_, h1_occupancyEndcap_, h1_occupancyVsEta_, h1_preshowerOverSC_, h1_reco_ZMass_, h1_reco_ZMassCorr_, h1_reco_ZMassCorrBB_, h1_reco_ZMassCorrEE_, h1_seedOverSC_, h1_weightSumMeanBarrel_, h1_weightSumMeanEndcap_, h1_ZCandMult_, h1_zEtaResol_, h1_zMassResol_, h1_zPhiResol_, h2_chi2_, h2_coeffVsEta_, h2_coeffVsEtaGrouped_, h2_coeffVsLoop_, h2_fEtaBarrelBad_, h2_fEtaBarrelGood_, h2_fEtaEndcapBad_, h2_fEtaEndcapGood_, h2_iterations_, h2_miscalRecal_, h2_miscalRecalEB_, h2_miscalRecalEE_, h2_residualSigma_, h2_xtalMiscalibCoeffBarrel_, h2_xtalMiscalibCoeffEndcapMinus_, h2_xtalMiscalibCoeffEndcapPlus_, h2_xtalRecalibCoeffBarrel_, h2_xtalRecalibCoeffEndcapMinus_, h2_xtalRecalibCoeffEndcapPlus_, h2_zMassDiffVsLoop_, h2_zMassVsLoop_, h2_zWidthVsLoop_, h_eleEffEta_, h_eleEffPhi_, h_eleEffPt_, h_ESCcorrEtrue_, h_ESCcorrEtrueVsEta_, h_ESCEtrue_, h_ESCEtrueVsEta_, mps_fire::i, and myZeePlots_.

Referenced by duringLoop(), and produce().

1690 {
1691 
1692  h1_eventsBeforeEWKSelection_= new TH1F("h1_eventsBeforeEWKSelection", "h1_eventsBeforeEWKSelection", 5,0,5);
1693  h1_eventsAfterEWKSelection_ = new TH1F("h1_eventsAfterEWKSelection", "h1_eventsAfterEWKSelection", 5,0,5);
1694 
1695  h1_eventsBeforeBorderSelection_= new TH1F("h1_eventsBeforeBorderSelection", "h1_eventsBeforeBorderSelection", 5,0,5);
1696  h1_eventsAfterBorderSelection_ = new TH1F("h1_eventsAfterBorderSelection", "h1_eventsAfterBorderSelection", 5,0,5);
1697 
1698  h1_seedOverSC_= new TH1F("h1_seedOverSC", "h1_seedOverSC", 400, 0., 2.);
1699 
1700  myZeePlots_ -> bookHLTHistograms();
1701 
1702  h1_borderElectronClassification_ = new TH1F("h1_borderElectronClassification", "h1_borderElectronClassification", 55, -5 , 50);
1703  h1_preshowerOverSC_= new TH1F("h1_preshowerOverSC", "h1_preshowerOverSC", 400, 0., 1.);
1704 
1705  h2_fEtaBarrelGood_ = new TH2F("fEtaBarrelGood","fEtaBarrelGood",800,-4.,4.,800,0.8,1.2);
1706  h2_fEtaBarrelGood_->SetXTitle("Eta");
1707  h2_fEtaBarrelGood_->SetYTitle("1/fEtaBarrelGood");
1708 
1709  h2_fEtaBarrelBad_ = new TH2F("fEtaBarrelBad","fEtaBarrelBad",800,-4.,4.,800,0.8,1.2);
1710  h2_fEtaBarrelBad_->SetXTitle("Eta");
1711  h2_fEtaBarrelBad_->SetYTitle("1/fEtaBarrelBad");
1712 
1713  h2_fEtaEndcapGood_ = new TH2F("fEtaEndcapGood","fEtaEndcapGood",800,-4.,4.,800,0.8,1.2);
1714  h2_fEtaEndcapGood_->SetXTitle("Eta");
1715  h2_fEtaEndcapGood_->SetYTitle("1/fEtaEndcapGood");
1716 
1717  h2_fEtaEndcapBad_ = new TH2F("fEtaEndcapBad","fEtaEndcapBad",800,-4.,4.,800,0.8,1.2);
1718  h2_fEtaEndcapBad_->SetXTitle("Eta");
1719  h2_fEtaEndcapBad_->SetYTitle("1/fEtaEndcapBad");
1720 
1721  for (int i=0;i<2;i++)
1722  {
1723  char histoName[50];
1724 
1725  sprintf(histoName,"h_eleEffEta_%d",i);
1726  h_eleEffEta_[i] = new TH1F(histoName,histoName, 150, 0., 2.7);
1727  h_eleEffEta_[i]->SetXTitle("|#eta|");
1728 
1729  sprintf(histoName,"h_eleEffPhi_%d",i);
1730  h_eleEffPhi_[i] = new TH1F(histoName,histoName, 400, -4., 4.);
1731  h_eleEffPhi_[i]->SetXTitle("Phi");
1732 
1733  sprintf(histoName,"h_eleEffPt_%d",i);
1734  h_eleEffPt_[i] = new TH1F(histoName,histoName, 200, 0., 200.);
1735  h_eleEffPt_[i]->SetXTitle("p_{T}(GeV/c)");
1736  }
1737 
1738  h2_xtalMiscalibCoeffBarrel_ = new TH2F("h2_xtalMiscalibCoeffBarrel","h2_xtalMiscalibCoeffBarrel", 171, -85, 85, 360, 0, 360);
1739  h2_xtalMiscalibCoeffEndcapMinus_ = new TH2F("h2_xtalMiscalibCoeffEndcapMinus", "h2_xtalMiscalibCoeffEndcapMinus", 100, 0,100, 100, 0, 100);
1740  h2_xtalMiscalibCoeffEndcapPlus_ = new TH2F("h2_xtalMiscalibCoeffEndcapPlus", "h2_xtalMiscalibCoeffEndcapPlus", 100, 0,100, 100, 0, 100);
1741 
1742  h2_xtalMiscalibCoeffBarrel_ ->SetXTitle("ieta");
1743  h2_xtalMiscalibCoeffBarrel_ ->SetYTitle("iphi");
1744 
1745  h2_xtalMiscalibCoeffEndcapMinus_->SetXTitle("ix");
1746  h2_xtalMiscalibCoeffEndcapMinus_->SetYTitle("iy");
1747 
1748  for (int i=0;i<25;i++)
1749  {
1750 
1751  char histoName[50];
1752  sprintf(histoName,"h_ESCEtrueVsEta_%d",i);
1753 
1754  h_ESCEtrueVsEta_[i] = new TH2F(histoName,histoName, 150, 0., 2.7, 300,0.,1.5);
1755  h_ESCEtrueVsEta_[i]->SetXTitle("|#eta|");
1756  h_ESCEtrueVsEta_[i]->SetYTitle("E_{SC,raw}/E_{MC}");
1757 
1758  sprintf(histoName,"h_ESCEtrue_%d",i);
1759 
1760  h_ESCEtrue_[i] = new TH1F(histoName,histoName, 300,0.,1.5);
1761 
1762  sprintf(histoName,"h2_chi2_%d",i);
1763  h2_chi2_[i] = new TH2F(histoName,histoName, 1000,-150,150, 1000, -1, 5);
1764 
1765  sprintf(histoName,"h2_iterations_%d",i);
1766  h2_iterations_[i] = new TH2F(histoName,histoName, 1000,-150,150, 1000, -1, 15);
1767 
1768  sprintf(histoName,"h_ESCcorrEtrueVsEta_%d",i);
1769 
1770  h_ESCcorrEtrueVsEta_[i] = new TH2F(histoName,histoName, 150, 0., 2.7, 300,0.,1.5);
1771  h_ESCcorrEtrueVsEta_[i]->SetXTitle("|#eta|");
1772  h_ESCcorrEtrueVsEta_[i]->SetYTitle("E_{SC,#eta-corr}/E_{MC}");
1773 
1774  sprintf(histoName,"h_ESCcorrEtrue_%d",i);
1775 
1776  h_ESCcorrEtrue_[i] = new TH1F(histoName,histoName, 300,0.,1.5);
1777 
1778  sprintf(histoName,"h2_xtalRecalibCoeffBarrel_%d",i);
1779  h2_xtalRecalibCoeffBarrel_[i] = new TH2F(histoName,histoName, 171, -85, 85, 360, 0, 360);
1780 
1781  h2_xtalRecalibCoeffBarrel_[i]->SetXTitle("ieta");
1782  h2_xtalRecalibCoeffBarrel_[i]->SetYTitle("iphi");
1783 
1784  sprintf(histoName,"h2_xtalRecalibCoeffEndcapMinus_%d",i);
1785  h2_xtalRecalibCoeffEndcapMinus_[i] = new TH2F(histoName,histoName, 100, 0,100, 100, 0, 100);
1786  h2_xtalRecalibCoeffEndcapMinus_[i]->SetXTitle("ix");
1787  h2_xtalRecalibCoeffEndcapMinus_[i]->SetYTitle("iy");
1788 
1789  sprintf(histoName,"h2_xtalRecalibCoeffEndcapPlus_%d",i);
1790  h2_xtalRecalibCoeffEndcapPlus_[i] = new TH2F(histoName,histoName, 100, 0,100, 100, 0, 100);
1791  h2_xtalRecalibCoeffEndcapPlus_[i]->SetXTitle("ix");
1792  h2_xtalRecalibCoeffEndcapPlus_[i]->SetYTitle("iy");
1793 
1794  }
1795 
1796  /*
1797  for (int i=0;i<15;i++)
1798  {
1799 
1800  char histoName[50];
1801 
1802  sprintf(histoName,"h_DiffZMassDistr_%d",i);
1803  h_DiffZMassDistr_[i] = new TH1F(histoName,histoName, 400, -20., 20.);
1804  h_DiffZMassDistr_[i]->SetXTitle("M_{Z, reco} - M_{Z, MC}");
1805  h_DiffZMassDistr_[i]->SetYTitle("events");
1806 
1807  sprintf(histoName,"h_ZMassDistr_%d",i);
1808  h_ZMassDistr_[i] = new TH1F(histoName,histoName, 200, 0., 150.);
1809  h_ZMassDistr_[i]->SetXTitle("RecoZmass (GeV)");
1810  h_ZMassDistr_[i]->SetYTitle("events");
1811 
1812  }
1813  */
1814 
1815  h1_zMassResol_ = new TH1F("zMassResol", "zMassResol", 200, -50., 50.);
1816  h1_zMassResol_->SetXTitle("M_{Z, reco} - M_{Z, MC}");
1817  h1_zMassResol_->SetYTitle("events");
1818 
1819  h1_eleEtaResol_ = new TH1F("eleEtaResol", "eleEtaResol", 100, -0.01, 0.01);
1820  h1_eleEtaResol_->SetXTitle("#eta_{reco} - #eta_{MC}");
1821  h1_eleEtaResol_->SetYTitle("events");
1822 
1823  h1_electronCosTheta_TK_ = new TH1F("electronCosTheta_TK", "electronCosTheta_TK", 100, -1, 1);
1824  h1_electronCosTheta_TK_->SetXTitle("cos #theta_{12}");
1825  h1_electronCosTheta_TK_->SetYTitle("events");
1826 
1827  h1_electronCosTheta_SC_ = new TH1F("electronCosTheta_SC", "electronCosTheta_SC", 100, -1, 1);
1828  h1_electronCosTheta_SC_->SetXTitle("cos #theta_{12}");
1829  h1_electronCosTheta_SC_->SetYTitle("events");
1830 
1831  h1_electronCosTheta_SC_TK_ = new TH1F("electronCosTheta_SC_TK", "electronCosTheta_SC_TK", 200, -0.1, 0.1);
1832  h1_electronCosTheta_SC_TK_->SetXTitle("cos #theta_{12}^{SC}/ cos #theta_{12}^{TK} - 1");
1833  h1_electronCosTheta_SC_TK_->SetYTitle("events");
1834 
1835  h1_elePhiResol_ = new TH1F("elePhiResol", "elePhiResol", 100, -0.01, 0.01);
1836  h1_elePhiResol_->SetXTitle("#phi_{reco} - #phi_{MC}");
1837  h1_elePhiResol_->SetYTitle("events");
1838 
1839 
1840  h1_zEtaResol_ = new TH1F("zEtaResol", "zEtaResol", 200, -1., 1.);
1841  h1_zEtaResol_->SetXTitle("#eta_{Z, reco} - #eta_{Z, MC}");
1842  h1_zEtaResol_->SetYTitle("events");
1843 
1844 
1845  h1_zPhiResol_ = new TH1F("zPhiResol", "zPhiResol", 200, -1., 1.);
1846  h1_zPhiResol_->SetXTitle("#phi_{Z, reco} - #phi_{Z, MC}");
1847  h1_zPhiResol_->SetYTitle("events");
1848 
1849  h1_nEleReco_ = new TH1F("nEleReco","Number of reco electrons",10,-0.5,10.5);
1850  h1_nEleReco_->SetXTitle("nEleReco");
1851  h1_nEleReco_->SetYTitle("events");
1852 
1853  // h1_occupancyVsEta_ = new TH1F("occupancyVsEta","occupancyVsEta",EcalRingCalibrationTools::N_RING_TOTAL,0,(float)EcalRingCalibrationTools::N_RING_TOTAL);
1854 
1855  h1_occupancyVsEta_ = new TH1F("occupancyVsEta","occupancyVsEta",249, -124, 124);
1856  h1_occupancyVsEta_->SetYTitle("Weighted electron statistics");
1857  h1_occupancyVsEta_->SetXTitle("Eta channel");
1858 
1859  h1_weightSumMeanBarrel_= new TH1F("weightSumMeanBarrel","weightSumMeanBarrel",10000, 0, 10000);
1860  h1_weightSumMeanEndcap_= new TH1F("weightSumMeanEndcap","weightSumMeanEndcap",10000, 0, 10000);
1861 
1862  h1_occupancy_ = new TH1F("occupancy","occupancy",1000,0,10000);
1863  h1_occupancy_->SetXTitle("Weighted electron statistics");
1864 
1865  h1_occupancyBarrel_ = new TH1F("occupancyBarrel","occupancyBarrel",1000,0,10000);
1866  h1_occupancyBarrel_->SetXTitle("Weighted electron statistics");
1867 
1868  h1_occupancyEndcap_ = new TH1F("occupancyEndcap","occupancyEndcap",1000,0,10000);
1869  h1_occupancyEndcap_->SetXTitle("Weighted electron statistics");
1870 
1871 
1872  h1_eleClasses_= new TH1F("eleClasses","eleClasses",301,-1,300);
1873  h1_eleClasses_->SetXTitle("classCode");
1874  h1_eleClasses_->SetYTitle("#");
1875 
1876 
1877 
1879 
1881 
1883 
1885 
1886 
1887  h1_ZCandMult_ =new TH1F("ZCandMult","Multiplicity of Z candidates in one event",10,-0.5,10.5);
1888  h1_ZCandMult_ ->SetXTitle("ZCandMult");
1889 
1890  h1_reco_ZMass_ = new TH1F("reco_ZMass","Inv. mass of 2 reco Electrons",200,0.,150.);
1891  h1_reco_ZMass_->SetXTitle("reco_ZMass (GeV)");
1892  h1_reco_ZMass_->SetYTitle("events");
1893 
1894  h1_reco_ZMassCorr_ = new TH1F("reco_ZMassCorr","Inv. mass of 2 corrected reco Electrons",200,0.,150.);
1895  h1_reco_ZMassCorr_->SetXTitle("reco_ZMass (GeV)");
1896  h1_reco_ZMassCorr_->SetYTitle("events");
1897 
1898  h1_reco_ZMassCorrBB_ = new TH1F("reco_ZMassCorrBB","Inv. mass of 2 corrected reco Electrons",200,0.,150.);
1899  h1_reco_ZMassCorrBB_->SetXTitle("reco_ZMass (GeV)");
1900  h1_reco_ZMassCorrBB_->SetYTitle("events");
1901 
1902  h1_reco_ZMassCorrEE_ = new TH1F("reco_ZMassCorrEE","Inv. mass of 2 corrected reco Electrons",200,0.,150.);
1903  h1_reco_ZMassCorrEE_->SetXTitle("reco_ZMass (GeV)");
1904  h1_reco_ZMassCorrEE_->SetYTitle("events");
1905 
1906  // h2_coeffVsEta_= new TH2F("h2_calibCoeffVsEta","h2_calibCoeffVsEta",EcalRingCalibrationTools::N_RING_TOTAL,0, (double)EcalRingCalibrationTools::N_RING_TOTAL, 200, 0., 2.);
1907 
1908  h2_coeffVsEta_= new TH2F("h2_calibCoeffVsEta","h2_calibCoeffVsEta",249,-124,125, 200, 0., 2.);
1909  h2_coeffVsEta_->SetXTitle("Eta channel");
1910  h2_coeffVsEta_->SetYTitle("recalibCoeff");
1911 
1912  h2_coeffVsEtaGrouped_= new TH2F("h2_calibCoeffVsEtaGrouped","h2_calibCoeffVsEtaGrouped", 200, 0., 3., 200, 0.6, 1.4);
1913  h2_coeffVsEtaGrouped_->SetXTitle("|#eta|");
1914  h2_coeffVsEtaGrouped_->SetYTitle("recalibCoeff");
1915 
1916  h2_zMassVsLoop_= new TH2F("h2_zMassVsLoop","h2_zMassVsLoop",1000,0,40, 90, 80.,95.);
1917 
1918  h2_zMassDiffVsLoop_= new TH2F("h2_zMassDiffVsLoop","h2_zMassDiffVsLoop",1000,0,40, 100, -1., 1.);
1919  h2_zMassDiffVsLoop_->SetXTitle("Iteration");
1920  h2_zMassDiffVsLoop_->SetYTitle("M_{Z, reco peak} - M_{Z, true}");
1921 
1922  h2_zWidthVsLoop_= new TH2F("h2_zWidthVsLoop","h2_zWidthVsLoop",1000,0,40, 100, 0.,10.);
1923 
1924  h2_coeffVsLoop_= new TH2F("h2_coeffVsLoop","h2_coeffVsLoop",1000,0,40, 100, 0., 2.);
1925 
1926  h2_residualSigma_= new TH2F("h2_residualSigma","h2_residualSigma",1000, 0, 40, 100, 0., .5);
1927 
1928  h2_miscalRecal_ = new TH2F("h2_miscalRecal","h2_miscalRecal", 500, 0., 2., 500, 0., 2.);
1929  h2_miscalRecal_->SetXTitle("initCalibCoeff");
1930  h2_miscalRecal_->SetYTitle("1/RecalibCoeff");
1931 
1932  h2_miscalRecalEB_ = new TH2F("h2_miscalRecalEB","h2_miscalRecalEB", 500, 0., 2., 500, 0., 2.);
1933  h2_miscalRecalEB_->SetXTitle("initCalibCoeff");
1934  h2_miscalRecalEB_->SetYTitle("1/RecalibCoeff");
1935 
1936  h2_miscalRecalEE_ = new TH2F("h2_miscalRecalEE","h2_miscalRecalEE", 500, 0., 2., 500, 0., 2.);
1937  h2_miscalRecalEE_->SetXTitle("initCalibCoeff");
1938  h2_miscalRecalEE_->SetYTitle("1/RecalibCoeff");
1939 
1940  h1_mc_ = new TH1F("h1_residualMiscalib","h1_residualMiscalib", 200, -0.2, 0.2);
1941  h1_mcEB_ = new TH1F("h1_residualMiscalibEB","h1_residualMiscalibEB", 200, -0.2, 0.2);
1942  h1_mcEE_ = new TH1F("h1_residualMiscalibEE","h1_residualMiscalibEE", 200, -0.2, 0.2);
1943 
1944  for (int i=0;i<25;i++)
1945  {
1946  char histoName[50];
1947  /*
1948  sprintf(histoName,"h2_miscalRecalParz_%d",i);
1949  h2_miscalRecalParz_[i] = new TH2F(histoName,histoName,500, 0., 2., 500, 0., 2.);
1950  h2_miscalRecalParz_[i]->SetXTitle("initCalibCoeff");
1951  h2_miscalRecalParz_[i]->SetYTitle("1/recalibCoeff");
1952 
1953  sprintf(histoName,"h2_miscalRecalEBParz_%d",i);
1954  h2_miscalRecalEBParz_[i] = new TH2F(histoName,histoName,500, 0., 2., 500, 0., 2.);
1955  h2_miscalRecalEBParz_[i]->SetXTitle("initCalibCoeff");
1956  h2_miscalRecalEBParz_[i]->SetYTitle("1/recalibCoeff");
1957 
1958  sprintf(histoName,"h2_miscalRecalEEParz_%d",i);
1959  h2_miscalRecalEEParz_[i] = new TH2F(histoName,histoName,500, 0., 2., 500, 0., 2.);
1960  h2_miscalRecalEEParz_[i]->SetXTitle("initCalibCoeff");
1961  h2_miscalRecalEEParz_[i]->SetYTitle("1/recalibCoeff");
1962  */
1963 
1964  sprintf(histoName,"h1_residualMiscalibParz_%d",i);
1965  h1_mcParz_[i] = new TH1F(histoName,histoName, 200, -0.2, 0.2);
1966  sprintf(histoName,"h1_residualMiscalibEBParz_%d",i);
1967  h1_mcEBParz_[i] = new TH1F(histoName,histoName, 200, -0.2, 0.2);
1968  sprintf(histoName,"h1_residualMiscalibEEParz_%d",i);
1969  h1_mcEEParz_[i] = new TH1F(histoName,histoName, 200, -0.2, 0.2);
1970 
1971  }
1972 
1973 
1974 }
TH2F * h2_fEtaBarrelBad_
TH1F * h1_mcEEParz_[25]
TH1F * h_eleEffPhi_[2]
TH2F * h2_miscalRecal_
TH1F * h1_eventsBeforeEWKSelection_
TH1F * h_ESCEtrue_[25]
TH1F * h1_eventsAfterBorderSelection_
TH1F * h1_occupancyEndcap_
TH1F * h1_eventsBeforeBorderSelection_
TH1F * h1_electronCosTheta_SC_
TH1F * h1_reco_ZMassCorr_
TH2F * h2_coeffVsEtaGrouped_
TH1F * h1_occupancyVsEta_
TH1F * h1_occupancyBarrel_
TH2F * h2_miscalRecalEE_
void bookEleHistograms()
Definition: ZeePlots.cc:231
TH1F * h1_electronCosTheta_TK_
TH2F * h_ESCcorrEtrueVsEta_[25]
TH2F * h2_fEtaEndcapBad_
TH1F * h1_mcEBParz_[25]
TH1F * h1_elePhiResol_
TH1F * h1_eleEtaResol_
TH2F * h2_xtalRecalibCoeffBarrel_[25]
TH1F * h1_eventsAfterEWKSelection_
void bookZMCHistograms()
Definition: ZeePlots.cc:62
TH1F * h1_preshowerOverSC_
TH1F * h1_electronCosTheta_SC_TK_
TH1F * h_eleEffPt_[2]
TH2F * h2_zMassDiffVsLoop_
TH1F * h1_mcParz_[25]
ZeePlots * myZeePlots_
TH2F * h2_miscalRecalEB_
TH1F * h_ESCcorrEtrue_[25]
TH2F * h2_xtalMiscalibCoeffEndcapPlus_
TH1F * h1_reco_ZMassCorrBB_
TH1F * h1_reco_ZMassCorrEE_
TH2F * h2_xtalMiscalibCoeffBarrel_
TH2F * h2_chi2_[25]
TH2F * h2_coeffVsLoop_
TH1F * h1_weightSumMeanBarrel_
TH2F * h_ESCEtrueVsEta_[25]
TH2F * h2_zMassVsLoop_
void bookZHistograms()
Definition: ZeePlots.cc:89
TH2F * h2_iterations_[25]
TH2F * h2_xtalRecalibCoeffEndcapPlus_[25]
TH2F * h2_fEtaEndcapGood_
TH2F * h2_xtalRecalibCoeffEndcapMinus_[25]
void bookEleMCHistograms()
Definition: ZeePlots.cc:186
TH2F * h2_fEtaBarrelGood_
TH1F * h_eleEffEta_[2]
TH1F * h1_borderElectronClassification_
TH2F * h2_xtalMiscalibCoeffEndcapMinus_
TH2F * h2_zWidthVsLoop_
TH2F * h2_residualSigma_
TH1F * h1_weightSumMeanEndcap_
float ZeeCalibration::computeCoefficientDistanceAtIteration ( float  v1[250],
float  v2[250],
int  size 
)
private

Definition at line 2253 of file ZeeCalibration.cc.

References funct::abs(), calibMode_, mps_fire::i, funct::pow(), ringNumberCorrector(), findQualityFiles::size, and mathSSE::sqrt().

Referenced by endOfLoop(), and produce().

2253  {
2254 
2255  float dist(0.);
2256 
2257  for(int i =0; i < size; i++){
2258 
2259  // std::cout<< "[ZeeCalibration::computeCoefficientDistanceAtIteration] Adding term "<<pow( v1[i]-v2[i], 2 )<<" from v1 "<<v1[i]<<" and v2 "<<v2[i]<<std::endl;
2260 
2261  bool isNearCrack = false;
2262 
2263  if( calibMode_ == "RING"){//exclude non-calibrated rings from computation
2264 
2265  isNearCrack = ( abs( ringNumberCorrector(i) ) == 1 || abs( ringNumberCorrector(i) ) == 25 ||
2266  abs( ringNumberCorrector(i) ) == 26 || abs( ringNumberCorrector(i) ) == 45 ||
2267  abs( ringNumberCorrector(i) ) == 46 || abs( ringNumberCorrector(i) ) == 65 ||
2268  abs( ringNumberCorrector(i) ) == 66 || abs( ringNumberCorrector(i) ) == 85 ||
2269  abs( ringNumberCorrector(i) ) == 86 || abs( ringNumberCorrector(i) ) == 124 );
2270  }
2271 
2272  if(!isNearCrack)
2273  dist += pow( v1[i]-v2[i], 2 );
2274  }
2275 
2276  dist = sqrt(dist) / size;
2277 
2278  return dist;
2279 
2280 }
size
Write out results.
std::string calibMode_
int ringNumberCorrector(int k)
T sqrt(T t)
Definition: SSEVec.h:18
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
edm::EDLooper::Status ZeeCalibration::duringLoop ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Called at each event.

START HERE....

Implements edm::EDLooper.

Definition at line 656 of file ZeeCalibration.cc.

References funct::abs(), edm::HLTGlobalStatus::accept(), ZIterativeAlgorithmWithFit::addEvent(), aHLTResults, BARREL_ELECTRONS_AFTER_BORDER_CUT, BARREL_ELECTRONS_BEFORE_BORDER_CUT, barrelfile_, BBZN, BBZN_gg, BBZN_t0, BBZN_tt, bookHistograms(), ZeeKinematicTools::calculateZMass_withTK(), ZeeKinematicTools::calculateZMassWithCorrectedElectrons_withTK(), calibCoeff, calibCoeffError, calibMode_, MessageLogger_cfi::cerr, ALCARECOTkAlJpsiMuMu_cff::charge, ZeeKinematicTools::cosThetaElectrons_SC(), ZeeKinematicTools::cosThetaElectrons_TK(), gather_cfg::cout, CRACK_ELECTRONS_IN_BARREL, CRACK_ELECTRONS_IN_ENDCAP, EBZN, EBZN_gg, EBZN_t0, EBZN_tt, EcalBarrel, EcalEndcap, EEZN, EEZN_gg, EEZN_t0, EEZN_tt, ElectronMcFakeValidator_cfi::electronCollection, electronCollection_, electronProducer_, electronSelection_, endcapfile_, erechitCollection_, erechitProducer_, PVValHelper::eta, cppFunctionSkipper::exception, JetChargeProducer_cfi::exp, HcalObjRepresent::Fill(), ZeePlots::fillEleInfo(), fillEleInfo(), ZeePlots::fillEleMCInfo(), ZeePlots::fillHLTInfo(), fillMCmap(), ZeePlots::fillZInfo(), ZeePlots::fillZMCInfo(), EcalCondObjectContainer< T >::find(), plotBeamSpotDB::first, objects.autophobj::float, GenParticle::GenParticle, edm::EventSetup::get(), CaloMiscalibMapEcal::get(), edm::Event::getByLabel(), EcalRingCalibrationTools::getDetIdsInECAL(), EcalRingCalibrationTools::getDetIdsInModule(), EcalRingCalibrationTools::getDetIdsInRing(), getEtaCorrection(), edm::HepMCProduct::GetEvent(), getHottestDetId(), EcalCondObjectContainer< T >::getMap(), ZIterativeAlgorithmWithFit::getNumberOfChannels(), GOLDEN_ELECTRONS_IN_BARREL, GOLDEN_ELECTRONS_IN_ENDCAP, h1_borderElectronClassification_, h1_eleClasses_, h1_electronCosTheta_SC_, h1_electronCosTheta_SC_TK_, h1_electronCosTheta_TK_, h1_eventsAfterBorderSelection_, h1_eventsAfterEWKSelection_, h1_eventsBeforeBorderSelection_, h1_eventsBeforeEWKSelection_, h1_reco_ZMass_, h1_reco_ZMassCorr_, h1_reco_ZMassCorrBB_, h1_reco_ZMassCorrEE_, h1_ZCandMult_, h1_zMassResol_, h2_xtalMiscalibCoeffBarrel_, h2_xtalMiscalibCoeffEndcapMinus_, h2_xtalMiscalibCoeffEndcapPlus_, hfClusterShapes_cfi::hits, hltCount, hlTriggerResults_, mps_fire::i, ical, EBDetId::ieta(), init_, initCalibCoeff, EBDetId::iphi(), isfirstcall_, edm::HandleBase::isValid(), EEDetId::ix(), EEDetId::iy(), gen::k, edm::EDLooperBase::kContinue, loopFlag_, mass, mass4tree, massDiff4tree, maxInvMassCut_, mcProducer_, MCZBB, MCZEB, MCZEE, minInvMassCut_, myTree, myZeePlots_, MZ, NEVT, outputFile_, AlCaHLTBitMon_ParallelJobs::p, MiscalibReaderFromXML::parseXMLMiscalibFile(), CaloMiscalibMapEcal::prefillMap(), edm::Handle< T >::product(), read_events, rechitCollection_, rechitProducer_, cleanAndMergeSuperClusters_cfi::scCollection, scCollection_, scIslandCollection_, scIslandProducer_, scProducer_, edm::second(), EcalRingCalibrationTools::setCaloGeometry(), SHOWER_ELECTRONS_IN_BARREL, SHOWER_ELECTRONS_IN_ENDCAP, SILVER_ELECTRONS_IN_BARREL, SILVER_ELECTRONS_IN_ENDCAP, funct::sin(), edm::HLTGlobalStatus::size(), edm::SortedCollection< T, SORT >::size(), mathSSE::sqrt(), DetId::subdetId(), theAlgorithm_, TOTAL_ELECTRONS_IN_BARREL, TOTAL_ELECTRONS_IN_ENDCAP, wantEtaCorrection_, xtalIsOnModuleBorder(), and EEDetId::zside().

Referenced by produce().

657 {
658  using namespace edm;
659 
660 #ifdef DEBUG
661  std::cout<<"[ZeeCalibration] Entering duringLoop"<<std::endl;
662 #endif
663 
664 
665  // code that used to be in beginJob
666  if (isfirstcall_){
667 
668  //inizializzare la geometria di ecal
670  iSetup.get<CaloGeometryRecord>().get(pG);
672 
673  myZeePlots_ = new ZeePlots( "zeePlots.root" );
674  // myZeeRescaleFactorPlots_ = new ZeeRescaleFactorPlots("zeeRescaleFactorPlots.root");
675 
676  // go to *OUR* rootfile and book histograms
677  outputFile_->cd();
678  bookHistograms();
679 
680  std::cout<<"[ZeeCalibration::beginOfJob] Histograms booked "<<std::endl;
681 
682  loopFlag_ = 0;
683 
684  //Read miscalibration map if requested
685  CaloMiscalibMapEcal* miscalibMap=0;
686  if (!barrelfile_.empty() || !barrelfile_.empty())
687  {
688  miscalibMap=new CaloMiscalibMapEcal();
689  miscalibMap->prefillMap();
690  }
691 
692 
693  if(!barrelfile_.empty())
694  {
695  MiscalibReaderFromXMLEcalBarrel barrelreader_(*miscalibMap);
696  barrelreader_.parseXMLMiscalibFile(barrelfile_);
697 #ifdef DEBUG
698  std::cout<<"[ZeeCalibration::beginOfJob] Parsed EB miscal file"<<std::endl;
699 #endif
700  }
701 
702  if(!endcapfile_.empty())
703  {
704  MiscalibReaderFromXMLEcalEndcap endcapreader_(*miscalibMap);
705  endcapreader_.parseXMLMiscalibFile(endcapfile_);
706 #ifdef DEBUG
707  std::cout<<"[ZeeCalibration::beginOfJob] Parsed EE miscal file"<<std::endl;
708 #endif
709  }
710 
711  std::cout << " theAlgorithm_->getNumberOfChannels() "
712  << theAlgorithm_->getNumberOfChannels() << std::endl;
713 
714 
716  for(int k = 0; k < theAlgorithm_->getNumberOfChannels(); k++)
717  {
718  calibCoeff[k]=1.;
719  calibCoeffError[k]=0.;
720 
721  std::vector<DetId> ringIds;
722 
723  if(calibMode_ == "RING")
725 
726  if(calibMode_ == "MODULE")
728 
729  if(calibMode_ == "ABS_SCALE" || calibMode_ == "ETA_ET_MODE" )
731 
732  if (miscalibMap)
733  {
734  initCalibCoeff[k]=0.;
735  for (unsigned int iid=0; iid<ringIds.size();++iid)
736  {
737  float miscalib=* (miscalibMap->get().getMap().find(ringIds[iid]) );
738  // float miscalib=miscalibMap->get().getMap().find(ringIds[iid])->second; ////////AP
739  initCalibCoeff[k]+=miscalib;
740  }
741  initCalibCoeff[k]/=(float)ringIds.size();
742  std::cout << k << " " << initCalibCoeff[k] << " " << ringIds.size() << std::endl;
743  }
744  else
745  {
746  initCalibCoeff[k]=1.;
747  }
748  }
749 
750  ical = std::make_shared<EcalIntercalibConstants>();
751 
752  for(int k = 0; k < theAlgorithm_->getNumberOfChannels(); k++)
753  {
754  // std::vector<DetId> ringIds = EcalRingCalibrationTools::getDetIdsInRing(k);
755 
756  std::vector<DetId> ringIds;
757 
758  if(calibMode_ == "RING")
760 
761  if(calibMode_ == "MODULE")
763 
764  if(calibMode_ == "ABS_SCALE" || calibMode_ == "ETA_ET_MODE")
766 
767 
768  for (unsigned int iid=0; iid<ringIds.size();++iid){
769  // ical->setValue( ringIds[iid], 1. * initCalibCoeff[k] );
770 
771  if(ringIds[iid].subdetId() == EcalBarrel){
772  EBDetId myEBDetId(ringIds[iid]);
773  h2_xtalMiscalibCoeffBarrel_->SetBinContent( myEBDetId.ieta() + 86, myEBDetId.iphi(), * (miscalibMap->get().getMap().find(ringIds[iid]) ) );//fill TH2 with miscalibCoeff
774 
775  }
776 
777  if(ringIds[iid].subdetId() == EcalEndcap){
778  EEDetId myEEDetId(ringIds[iid]);
779  if(myEEDetId.zside() < 0)
780  h2_xtalMiscalibCoeffEndcapMinus_->SetBinContent( myEEDetId.ix(), myEEDetId.iy(), * ( miscalibMap->get().getMap().find(ringIds[iid]) ) );//fill TH2 with miscalibCoeff
781 
782  if(myEEDetId.zside() > 0)
783  h2_xtalMiscalibCoeffEndcapPlus_->SetBinContent( myEEDetId.ix(), myEEDetId.iy(), * (miscalibMap->get().getMap().find(ringIds[iid]) ) );//fill TH2 with miscalibCoeff
784 
785  }
786 
787  ical->setValue( ringIds[iid], *(miscalibMap->get().getMap().find(ringIds[iid]) ) );
788 
789  }
790 
791 
792  read_events = 0;
793  init_ = false;
794 
795 
796  }
797  isfirstcall_=false;
798  }// if isfirstcall
799 
800 
801 
802 
803 
804 
805 
806 
807 
809 
810  for(unsigned int iHLT=0; iHLT<200; ++iHLT) {
811  aHLTResults[iHLT] = false;
812  }
813 
814 #ifdef DEBUG
815  std::cout<<"[ZeeCalibration::duringLoop] Done with initializing aHLTresults[] "<<std::endl;
816 #endif
817 
818  edm::Handle<edm::TriggerResults> hltTriggerResultHandle;
819  iEvent.getByLabel(hlTriggerResults_, hltTriggerResultHandle);
820 
821  if(!hltTriggerResultHandle.isValid()) {
822  //std::cout << "invalid handle for HLT TriggerResults" << std::endl;
823  } else {
824 
825  hltCount = hltTriggerResultHandle->size();
826 
827  if (loopFlag_ == 0)
828  myZeePlots_->fillHLTInfo(hltTriggerResultHandle);
829 
830 #ifdef DEBUG
831  std::cout<<"[ZeeCalibration::duringLoop] Done with myZeePlots_->fillHLTInfo(hltTriggerResultHandle); "<<std::endl;
832 #endif
833 
834  for(int i = 0 ; i < hltCount ; i++) {
835  aHLTResults[i] = hltTriggerResultHandle->accept(i);
836 
837  //HLT bit 32 = HLT1Electron
838  //HLT bit 34 = HLT2Electron
839  //HLT bit 35 = HLT2ElectronRelaxed
840 
841  }
842 
843  if(!aHLTResults[32] && !aHLTResults[34] && !aHLTResults[35])
844  return kContinue;
845 
846  }
847 
848 #ifdef DEBUG
849  std::cout<<"[ZeeCalibration::duringLoop] End HLT section"<<std::endl;
850 #endif
851 
853 
854 
855  std::vector<HepMC::GenParticle*> mcEle;
856 
857  float myGenZMass(-1);
858 
859  if (!mcProducer_.empty())
860  {
861 
862  //DUMP GENERATED Z MASS - BEGIN
863  Handle< HepMCProduct > hepProd ;
864  // iEvent.getByLabel( "source", hepProd ) ;
865  iEvent.getByLabel( mcProducer_.c_str(), hepProd ) ;
866 
867  const HepMC::GenEvent * myGenEvent = hepProd->GetEvent();
868 
869  if (loopFlag_ == 0)
870  myZeePlots_->fillZMCInfo( & (*myGenEvent) );
871 
872 #ifdef DEBUG
873  std::cout<<"[ZeeCalibration::duringLoop] Done with myZeePlots_->fillZMCInfo( & (*myGenEvent) ); "<<std::endl;
874 #endif
875 
876 
877  for ( HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin();
878  p != myGenEvent->particles_end(); ++p ) {
879  //return a pointer to MC Z in the event
880  if ( (*p)->pdg_id() == 23 && (*p)->status()==2){
881 
882  myGenZMass = (*p)->momentum().m();
883  }
884  }
885  //DUMP GENERATED Z MASS - END
886 
887 
888  if (loopFlag_ == 0)
889  myZeePlots_ ->fillEleMCInfo( & (*myGenEvent) );
890 
891 
892  //loop over MC positrons and find the closest MC positron in (eta,phi) phace space - begin
893  HepMC::GenParticle MCele;
894 
895  for ( HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin();
896  p != myGenEvent->particles_end(); ++p ) {
897 
898  if ( abs( (*p)->pdg_id() ) == 11 )
899  {
900  mcEle.push_back( (*p) );
901  MCele=*(*p);
902 
903  }
904  }
905 
906 
907  if(mcEle.size()==2 && fabs(mcEle[0]->momentum().eta())<2.4 && fabs(mcEle[1]->momentum().eta())<2.4 ){
908  NEVT++;
909 
910  if( fabs(mcEle[0]->momentum().eta())<1.479 && fabs(mcEle[1]->momentum().eta())<1.479 )MCZBB++;
911 
912  if( (fabs(mcEle[0]->momentum().eta())>1.479 && fabs(mcEle[1]->momentum().eta())<1.479) || (fabs(mcEle[0]->momentum().eta())<1.479 && fabs(mcEle[1]->momentum().eta())>1.479) )MCZEB++;
913 
914  if( fabs(mcEle[0]->momentum().eta())>1.479 && fabs(mcEle[1]->momentum().eta())>1.479 )MCZEE++;
915 
916 
917  }
918 
919  }
920 
921 
922 
923  // Get EBRecHits
925  try {
927  } catch (std::exception& ex) {
928  std::cerr << "Error! can't get the product EBRecHitCollection " << std::endl;
929  }
930  const EBRecHitCollection* hits = phits.product(); // get a ptr to the product
931 
932  // Get EERecHits
934  try {
936  } catch (std::exception& ex) {
937  std::cerr << "Error! can't get the product EERecHitCollection " << std::endl;
938  }
939  const EERecHitCollection* ehits = ephits.product(); // get a ptr to the product
940 
941 
942  //Get Hybrid SuperClusters
944  try {
945  iEvent.getByLabel(scProducer_, scCollection_, pSuperClusters);
946  } catch (std::exception& ex ) {
947  std::cerr << "Error! can't get the product SuperClusterCollection "<< std::endl;
948  }
949  const reco::SuperClusterCollection* scCollection = pSuperClusters.product();
950 
951 #ifdef DEBUG
952  std::cout<<"scCollection->size()"<<scCollection->size()<<std::endl;
953  for(reco::SuperClusterCollection::const_iterator scIt = scCollection->begin(); scIt != scCollection->end(); scIt++)
954  {
955  std::cout<<scIt->energy()<<std::endl;
956  }
957 #endif
958 
959  //Get Island SuperClusters
960  Handle<reco::SuperClusterCollection> pIslandSuperClusters;
961  try {
962  iEvent.getByLabel(scIslandProducer_, scIslandCollection_, pIslandSuperClusters);
963  } catch (std::exception& ex ) {
964  std::cerr << "Error! can't get the product IslandSuperClusterCollection "<< std::endl;
965  }
966  const reco::SuperClusterCollection* scIslandCollection = pIslandSuperClusters.product();
967 
968 #ifdef DEBUG
969  std::cout<<"scCollection->size()"<<scIslandCollection->size()<<std::endl;
970 #endif
971 
972  if( ( scCollection->size()+scIslandCollection->size() ) < 2)
973  return kContinue;
974 
975  // Get Electrons
977  try {
978  iEvent.getByLabel(electronProducer_, electronCollection_, pElectrons);
979  } catch (std::exception& ex ) {
980  std::cerr << "Error! can't get the product ElectronCollection "<< std::endl;
981  }
983 
984  /*
985  //reco-mc association map
986  std::map<HepMC::GenParticle*,const reco::PixelMatchGsfElectron*> myMCmap;
987 
988  fillMCmap(&(*electronCollection),mcEle,myMCmap);
989 
990  fillEleInfo(mcEle,myMCmap);
991  */
992 
993  if(electronCollection->size() < 2)
994  return kContinue;
995 
996  if ( !hits && !ehits){
997  std::cout << "!hits" << std::endl;
998  return kContinue;
999  }
1000 
1001  if (hits->size() == 0 && ehits->size() == 0){
1002  std::cout << "hits->size() == 0" << std::endl;
1003  return kContinue;
1004  }
1005 
1006  if (!electronCollection){
1007  std::cout << "!electronCollection" << std::endl;
1008  return kContinue;
1009  }
1010 
1011  if (electronCollection->size() == 0){
1012  std::cout << "electronCollection->size() == 0" << std::endl;
1013  return kContinue;
1014  }
1015 
1016 
1017 
1021 
1022  read_events++;
1023 
1024  // std::cout << "read_events = " << read_events << std::endl;
1025 
1027 
1028 #ifdef DEBUG
1029  std::cout <<" Starting with myZeePlots_->fillEleInfo(electronCollection); " << std::endl;
1030 #endif
1031 
1032  if (loopFlag_ == 0)
1033  myZeePlots_->fillEleInfo(electronCollection);
1034 
1035 #ifdef DEBUG
1036  std::cout <<" Done with myZeePlots_->fillEleInfo(electronCollection); " << std::endl;
1037 #endif
1038 
1039  //FILL an electron vector - end
1040  //###################################Electron-SC association: begin#####################################################
1041  //Filling new ElectronCollection with new SC ref and calibElectron container
1042  std::vector<calib::CalibElectron> calibElectrons;
1043  //std::map< const calib::CalibElectron* , const reco::SuperCluster* > eleScMap;
1044 
1045 
1046 
1047  //#####################################Electron-SC association map: end#####################################################
1048  for(unsigned int e_it = 0 ; e_it != electronCollection->size() ; e_it++)
1049  {
1050  calibElectrons.push_back(calib::CalibElectron(&((*electronCollection)[e_it]),hits,ehits));
1051 #ifdef DEBUG
1052  std::cout << calibElectrons.back().getRecoElectron()->superCluster()->energy() << " " << calibElectrons.back().getRecoElectron()->energy() << std::endl;
1053 #endif
1054  // h1_recoEleEnergy_->Fill(calibElectrons.back().getRecoElectron()->superCluster()->energy());
1055  }
1056  // if (iLoop == 0)
1057  //fillCalibElectrons(calibElectrons);
1058 
1059 #ifdef DEBUG
1060  std::cout << "Filled histos" << std::endl;
1061 #endif
1062 
1063  //COMBINATORY FOR Z MASS - begin
1064  std::vector<std::pair<calib::CalibElectron*,calib::CalibElectron*> > zeeCandidates;
1065  int myBestZ=-1;
1066 
1067  mass = -1.;
1068  double DeltaMinvMin(5000.);
1069 
1070  if (calibElectrons.size() < 2)
1071  return kContinue;
1072 
1073  for(unsigned int e_it = 0 ; e_it != calibElectrons.size() - 1 ; e_it++){
1074  for(unsigned int p_it = e_it + 1 ; p_it != calibElectrons.size() ; p_it++)
1075  {
1076 #ifdef DEBUG
1077  std::cout << e_it << " " << calibElectrons[e_it].getRecoElectron()->charge() << " " << p_it << " " << calibElectrons[p_it].getRecoElectron()->charge() << std::endl;
1078 #endif
1079  if (calibElectrons[e_it].getRecoElectron()->charge() * calibElectrons[p_it].getRecoElectron()->charge() != -1)
1080  continue;
1081 
1082  mass = ZeeKinematicTools::calculateZMass_withTK(std::pair<calib::CalibElectron*,calib::CalibElectron*>(&(calibElectrons[e_it]),&(calibElectrons[p_it])));
1083 
1084  if (mass<0)
1085  continue;
1086 
1087 #ifdef DEBUG
1088  std::cout << "#######################mass "<<mass << std::endl;
1089 #endif
1090 
1091  zeeCandidates.push_back(std::pair<calib::CalibElectron*,calib::CalibElectron*>(&(calibElectrons[e_it]),&(calibElectrons[p_it])));
1092  double DeltaMinv = fabs(mass - MZ);
1093 
1094  if( DeltaMinv < DeltaMinvMin)
1095  {
1096  DeltaMinvMin = DeltaMinv;
1097  myBestZ=zeeCandidates.size()-1;
1098  }
1099  }
1100  }
1101 
1102  // h_DeltaZMassDistr_[loopFlag_]->Fill( (mass-MZ) / MZ );
1103 
1104  // zeeCa->Fill(zeeCandidates);
1105  //
1106  h1_ZCandMult_->Fill(zeeCandidates.size());
1107 
1108  if(zeeCandidates.size()==0 || myBestZ==-1 )
1109  return kContinue;
1110 
1111  if (loopFlag_ == 0)
1112  myZeePlots_->fillZInfo( zeeCandidates[myBestZ] );
1113 
1114 #ifdef DEBUG
1115  std::cout << "Found ZCandidates " << myBestZ << std::endl;
1116 #endif
1117 
1118  // h1_zMassResol_ ->Fill(mass-myGenZMass);
1119 
1121 
1122 
1123  int class1 = zeeCandidates[myBestZ].first->getRecoElectron()->classification();
1124  int class2 = zeeCandidates[myBestZ].second->getRecoElectron()->classification();
1125 
1126  h1_eleClasses_->Fill(class1);
1127  h1_eleClasses_->Fill(class2);
1128 
1129 
1130  std::cout << "BEFORE "<<std::endl;
1131 
1132  // myZeePlots_->fillEleClassesPlots( zeeCandidates[myBestZ].first );
1133  //myZeePlots_->fillEleClassesPlots( zeeCandidates[myBestZ].second );
1134 
1135  std::cout << "AFTER "<<std::endl;
1136 
1138 
1139  if(class1 < 100)
1140  // h1_Elec_->Fill(1);
1142  if(class1 >= 100)
1144 
1145  if(class2 < 100)
1147  if(class2 >= 100)
1149 
1150 
1151  if( class1==0)
1153  if( class1==100)
1155  if( class1==10 || class1 ==20)
1157  if( class1==110 || class1 ==120)
1159  if( class1>=30 && class1 <=34)
1161  if( class1>=130 && class1 <=134)
1163  if( class1==40)
1165  if( class1==140)
1167 
1168  if( class2==0)
1170  if( class2==100)
1172  if( class2==10 || class2 ==20)
1174  if( class2==110 || class2 ==120)
1176  if( class2>=30 && class2 <=34)
1178  if( class2>=130 && class2 <=134)
1180  if( class2==40)
1182  if( class2==140)
1184 
1186 
1188 
1189 
1190  DetId firstElehottestDetId = getHottestDetId( zeeCandidates[myBestZ].first->getRecoElectron()->superCluster()->seed()->hitsAndFractions() , hits, ehits ).first;
1191  DetId secondElehottestDetId = getHottestDetId( zeeCandidates[myBestZ].second->getRecoElectron()->superCluster()->seed()->hitsAndFractions() , hits, ehits ).first;
1192 
1193  bool firstElectronIsOnModuleBorder(false);
1194  bool secondElectronIsOnModuleBorder(false);
1195 
1197 
1198  if(class1<100){
1199 
1200  if( firstElehottestDetId.subdetId() == EcalBarrel)
1201  firstElectronIsOnModuleBorder = xtalIsOnModuleBorder( firstElehottestDetId );
1202 
1204 
1205  if( firstElehottestDetId.subdetId() == EcalBarrel && !firstElectronIsOnModuleBorder )
1207 
1208  }
1209 
1210  if(class2<100){
1211 
1212  if( secondElehottestDetId.subdetId() == EcalBarrel)
1213  secondElectronIsOnModuleBorder = xtalIsOnModuleBorder( secondElehottestDetId );
1214 
1216 
1217  if( secondElehottestDetId.subdetId() == EcalBarrel && !secondElectronIsOnModuleBorder )
1219 
1220  }
1221 
1222 
1223  if(class1<100){
1224  if ( firstElehottestDetId.subdetId() == EcalBarrel && firstElectronIsOnModuleBorder ){
1226  return kContinue;
1227  }
1228  }
1229 
1230  if(class2<100){
1231  if ( secondElehottestDetId.subdetId() == EcalBarrel && secondElectronIsOnModuleBorder ){
1233  return kContinue;
1234  }
1235  }
1236 
1239 
1240 
1241  if(class1<100 && class2<100){
1242  BBZN++;
1243  if(class1==0 && class2==0)BBZN_gg++;
1244  if(class1<21 && class2<21)BBZN_tt++;
1245  if(class1<21 || class2<21)BBZN_t0++;
1246 
1247  }
1248 
1249  if(class1>=100 && class2>=100){
1250  EEZN++;
1251  if(class1==100 && class2==100)EEZN_gg++;
1252  if(class1<121 && class2<121)EEZN_tt++;
1253  if(class1<121 || class2<121)EEZN_t0++;
1254 
1255  }
1256 
1257  if( (class1<100 && class2>=100) || (class2<100 && class1>=100)){
1258  EBZN++;
1259  if( (class1==0 && class2==100)||(class2==0 && class1==100) )EBZN_gg++;
1260  if( ( class1<21 && class2<121) ||(class2<21 && class1<121) )EBZN_tt++;
1261  if( class2<21 || class1<21 || class2<121 || class1<121 )EBZN_t0++;
1262  }
1263 
1264 
1266 
1267  if(myBestZ == -1)
1268  return kContinue;
1269 
1270 
1271  bool invMassBool = ( (mass > minInvMassCut_) && (mass < maxInvMassCut_) );
1272 
1273  bool selectionBool=false;
1274  //0 = all electrons (but no crack)
1275 
1277 
1278  float theta1 = 2. * atan( exp(- zeeCandidates[myBestZ].first->getRecoElectron()->superCluster()->eta()) );
1279  bool ET_1 = ( (zeeCandidates[myBestZ].first->getRecoElectron()->superCluster()->energy() * sin( theta1) ) > 20.);
1280 
1281  float theta2 = 2. * atan( exp(- zeeCandidates[myBestZ].second->getRecoElectron()->superCluster()->eta()) );
1282  bool ET_2 = ( (zeeCandidates[myBestZ].second->getRecoElectron()->superCluster()->energy() * sin( theta2) ) > 20.);
1283 
1284 
1285  bool HoE_1 = (zeeCandidates[myBestZ].first->getRecoElectron()->hadronicOverEm() < 0.115);
1286  bool HoE_2 = (zeeCandidates[myBestZ].second->getRecoElectron()->hadronicOverEm() < 0.115);
1287 
1288  bool DeltaPhiIn_1 = ( zeeCandidates[myBestZ].first->getRecoElectron()->deltaPhiSuperClusterTrackAtVtx() < 0.090);
1289  bool DeltaPhiIn_2 = ( zeeCandidates[myBestZ].second->getRecoElectron()->deltaPhiSuperClusterTrackAtVtx() < 0.090);
1290 
1291  bool DeltaEtaIn_1 = ( zeeCandidates[myBestZ].first->getRecoElectron()->deltaEtaSuperClusterTrackAtVtx() < 0.0090);
1292  bool DeltaEtaIn_2 = ( zeeCandidates[myBestZ].second->getRecoElectron()->deltaEtaSuperClusterTrackAtVtx() < 0.0090);
1293 
1295 
1296  if(! (invMassBool &&
1297  ET_1 && ET_2 &&
1298  HoE_1 && HoE_2 &&
1299  DeltaPhiIn_1 && DeltaPhiIn_2 &&
1300  DeltaEtaIn_1 && DeltaEtaIn_2
1301  ) )
1302  return kContinue;
1304 
1305  h1_eventsAfterEWKSelection_->Fill(1);
1306 
1308 
1309 
1310  int c1st = zeeCandidates[myBestZ].first->getRecoElectron()->classification();
1311  int c2nd = zeeCandidates[myBestZ].second->getRecoElectron()->classification();
1312  if(electronSelection_==0)selectionBool=( myBestZ != -1 &&
1313  c1st!= 40 &&
1314  c1st!= 40 &&
1315  c2nd!= 40 &&
1316  c2nd!= 140);
1317 
1318  //1 = all electrons are Golden, BB or Narrow
1319 
1320  if(electronSelection_==1)selectionBool=( myBestZ != -1 &&
1321  (c1st ==0 ||
1322  c1st ==10 ||
1323  c1st ==20 ||
1324  c1st ==100 ||
1325  c1st ==110 ||
1326  c1st ==120
1327  ) &&
1328  (c2nd == 0 ||
1329  c2nd == 10 ||
1330  c2nd == 20 ||
1331  c2nd == 100 ||
1332  c2nd == 110 ||
1333  c2nd == 120
1334  )
1335  );
1336 
1337  //2 = all electrons are Golden
1338  if(electronSelection_==2)selectionBool=( myBestZ != -1 &&
1339  (c1st == 0 ||
1340  c1st == 100
1341  ) &&
1342  (c2nd == 0 ||
1343  c2nd == 100
1344  )
1345  );
1346  //3 = all electrons are showering
1347  if(electronSelection_==3)selectionBool=( myBestZ != -1 &&
1348  (
1349  (c1st >=30 &&
1350  c1st <=34)
1351  ||
1352  ((c1st >=130 &&
1353  c1st <=134))
1354  )
1355  &&
1356  ( (c2nd >=30 &&
1357  c2nd <=34)
1358  ||
1359  ((c2nd >=130 &&
1360  c2nd <=134))
1361  )
1362 
1363  );
1364 
1365  //4 = all Barrel electrons are Golden, BB or Narrow; take all Endcap electrons
1366 
1367  if(electronSelection_==4)selectionBool=( myBestZ != -1 &&
1368  (
1369 
1370  (
1371  (c1st ==0 ||
1372  c1st ==10 ||
1373  c1st ==20
1374  ) && c2nd>=100
1375  && c2nd!=140
1376  )
1377 
1378  ||
1379 
1380  (
1381  (c2nd ==0 ||
1382  c2nd ==10 ||
1383  c2nd ==20
1384  ) && c1st>=100
1385  && c1st!=140
1386  )
1387 
1388 
1389  )
1390  );
1391 
1392  //5 = all Endcap electrons (but no crack)
1393 
1394  if(electronSelection_==5)selectionBool=( myBestZ != -1 &&
1395  c1st>=100 &&
1396  c2nd>= 100 &&
1397  c1st!= 140 &&
1398  c2nd!= 140);
1399 
1400  //6 = all Barrel electrons (but no crack)
1401 
1402  if(electronSelection_==6)selectionBool=( myBestZ != -1 &&
1403  c1st<100 &&
1404  c2nd< 100 &&
1405  c1st!= 40 &&
1406  c2nd!= 40);
1407 
1408  //7 = this eliminates the events which have 1 ele in the Barrel and 1 in the Endcap
1409 
1410  if(electronSelection_==7)selectionBool=( myBestZ != -1 &&
1411  !(c1st<100 &&
1412  c2nd>=100) &&
1413  !(c1st>=100 &&
1414  c2nd<100) );
1415 
1416 
1417  float ele1EnergyCorrection(1.);
1418  float ele2EnergyCorrection(1.);
1419 
1420  if(invMassBool && selectionBool && wantEtaCorrection_){
1421 
1422  ele1EnergyCorrection=getEtaCorrection(zeeCandidates[myBestZ].first->getRecoElectron());
1423  ele2EnergyCorrection=getEtaCorrection(zeeCandidates[myBestZ].second->getRecoElectron());
1424 
1425  }
1426 
1427  if (invMassBool && selectionBool)
1428  {
1429 
1430  h1_electronCosTheta_SC_ -> Fill( ZeeKinematicTools::cosThetaElectrons_SC(zeeCandidates[myBestZ],ele1EnergyCorrection,ele2EnergyCorrection) );
1431  h1_electronCosTheta_TK_ -> Fill( ZeeKinematicTools::cosThetaElectrons_TK(zeeCandidates[myBestZ],ele1EnergyCorrection,ele2EnergyCorrection) );
1432  h1_electronCosTheta_SC_TK_ -> Fill( ZeeKinematicTools::cosThetaElectrons_SC(zeeCandidates[myBestZ],ele1EnergyCorrection,ele2EnergyCorrection)/ZeeKinematicTools::cosThetaElectrons_TK(zeeCandidates[myBestZ],ele1EnergyCorrection,ele2EnergyCorrection) - 1. );
1433 
1434  if (!mcProducer_.empty())
1435  {
1436  h1_zMassResol_ ->Fill(mass-myGenZMass);
1437 
1438  //reco-mc association map - begin
1439 
1440  std::map<HepMC::GenParticle*,const reco::GsfElectron*> myMCmap;
1441 
1442  std::vector<const reco::GsfElectron*> dauElectronCollection;
1443 
1444  dauElectronCollection.push_back(zeeCandidates[myBestZ].first->getRecoElectron() );
1445  dauElectronCollection.push_back(zeeCandidates[myBestZ].second->getRecoElectron() );
1446 
1447  fillMCmap(&dauElectronCollection,mcEle,myMCmap);
1448  fillEleInfo(mcEle,myMCmap);
1449  //h_DiffZMassDistr_[loopFlag_]->Fill( (mass-myGenZMass) );
1450  }
1451 
1452  //PUT f(eta) IN OUR Zee ALGORITHM
1453  theAlgorithm_->addEvent(zeeCandidates[myBestZ].first, zeeCandidates[myBestZ].second,MZ*sqrt(ele1EnergyCorrection*ele2EnergyCorrection) );
1454 
1455  h1_reco_ZMass_->Fill(ZeeKinematicTools::calculateZMass_withTK(zeeCandidates[myBestZ]));
1456 
1457  h1_reco_ZMassCorr_->Fill(ZeeKinematicTools::calculateZMassWithCorrectedElectrons_withTK(zeeCandidates[myBestZ],ele1EnergyCorrection,ele2EnergyCorrection));
1458 
1459  int c1st = zeeCandidates[myBestZ].first->getRecoElectron()->classification();
1460  int c2nd = zeeCandidates[myBestZ].second->getRecoElectron()->classification();
1461  if(c1st<100 && c2nd<100 )
1462  h1_reco_ZMassCorrBB_->Fill(ZeeKinematicTools::calculateZMassWithCorrectedElectrons_withTK(zeeCandidates[myBestZ],ele1EnergyCorrection,ele2EnergyCorrection));
1463 
1464 
1465  if(c1st>=100 && c2nd>=100 )
1466  h1_reco_ZMassCorrEE_->Fill(ZeeKinematicTools::calculateZMassWithCorrectedElectrons_withTK(zeeCandidates[myBestZ],ele1EnergyCorrection,ele2EnergyCorrection));
1467 
1468 
1469  mass4tree = ZeeKinematicTools::calculateZMassWithCorrectedElectrons_withTK(zeeCandidates[myBestZ],ele1EnergyCorrection,ele2EnergyCorrection);
1470 
1471  massDiff4tree = ZeeKinematicTools::calculateZMassWithCorrectedElectrons_withTK(zeeCandidates[myBestZ],ele1EnergyCorrection,ele2EnergyCorrection) - myGenZMass;
1472 
1473  // h_ZMassDistr_[loopFlag_]->Fill(ZeeKinematicTools::calculateZMassWithCorrectedElectrons_withTK(zeeCandidates[myBestZ],ele1EnergyCorrection,ele2EnergyCorrection));
1474 
1475  myTree->Fill();
1476 
1477  }
1478 
1479 
1480 
1481 #ifdef DEBUG
1482  std::cout << "Added event to algorithm" << std::endl;
1483 #endif
1484 
1485  return kContinue;
1486  }
std::string calibMode_
static void setCaloGeometry(const CaloGeometry *geometry)
std::string scIslandCollection_
std::string electronCollection_
int BARREL_ELECTRONS_AFTER_BORDER_CUT
TH1F * h1_eventsBeforeEWKSelection_
static float calculateZMassWithCorrectedElectrons_withTK(const std::pair< calib::CalibElectron *, calib::CalibElectron * > &aZCandidate, float ele1EnergyCorrection, float ele2EnergyCorrection)
float calibCoeff[250]
const self & getMap() const
static float cosThetaElectrons_TK(const std::pair< calib::CalibElectron *, calib::CalibElectron * > &aZCandidate, float ele1EnergyCorrection, float ele2EnergyCorrection)
void fillEleInfo(const reco::GsfElectronCollection *)
Definition: ZeePlots.cc:261
void fillEleMCInfo(const HepMC::GenEvent *)
Definition: ZeePlots.cc:210
int GOLDEN_ELECTRONS_IN_ENDCAP
void fillZMCInfo(const HepMC::GenEvent *)
Definition: ZeePlots.cc:158
TH1F * h1_eventsAfterBorderSelection_
edm::InputTag hlTriggerResults_
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
bool accept() const
Has at least one path accepted the event?
void fillMCmap(const std::vector< const reco::GsfElectron * > *electronCollection, const std::vector< HepMC::GenParticle * > &mcEle, std::map< HepMC::GenParticle *, const reco::GsfElectron * > &myMCmap)
static float calculateZMass_withTK(const std::pair< calib::CalibElectron *, calib::CalibElectron * > &aZCandidate)
#define MZ
bool addEvent(calib::CalibElectron *, calib::CalibElectron *, float)
TH1F * h1_eventsBeforeBorderSelection_
TH1F * h1_electronCosTheta_SC_
static float cosThetaElectrons_SC(const std::pair< calib::CalibElectron *, calib::CalibElectron * > &aZCandidate, float ele1EnergyCorrection, float ele2EnergyCorrection)
TH1F * h1_reco_ZMassCorr_
int GOLDEN_ELECTRONS_IN_BARREL
std::string endcapfile_
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
static std::vector< DetId > getDetIdsInRing(short aRingIndex)
Retrieve the DetIds in a phi-ring.
std::string rechitCollection_
U second(std::pair< T, U > const &p)
TH1F * h1_electronCosTheta_TK_
std::string rechitProducer_
const EcalIntercalibConstants & get()
std::string scIslandProducer_
int SILVER_ELECTRONS_IN_BARREL
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int TOTAL_ELECTRONS_IN_ENDCAP
int BARREL_ELECTRONS_BEFORE_BORDER_CUT
T sqrt(T t)
Definition: SSEVec.h:18
unsigned int size() const
Get number of paths stored.
void fillHLTInfo(edm::Handle< edm::TriggerResults >)
Definition: ZeePlots.cc:341
int SHOWER_ELECTRONS_IN_ENDCAP
std::string scProducer_
std::string erechitProducer_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ZIterativeAlgorithmWithFit * theAlgorithm_
unsigned int electronSelection_
bool isValid() const
Definition: HandleBase.h:74
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
bool xtalIsOnModuleBorder(EBDetId myEBDetId)
TH1F * h1_eventsAfterEWKSelection_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:416
static std::vector< DetId > getDetIdsInModule(short int)
TH1F * h1_electronCosTheta_SC_TK_
int k[5][pyjets_maxn]
std::string scCollection_
Definition: DetId.h:18
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:38
ZeePlots * myZeePlots_
T const * product() const
Definition: Handle.h:81
std::pair< DetId, double > getHottestDetId(const std::vector< std::pair< DetId, float > > &mySCRecHits, const EBRecHitCollection *ebhits, const EERecHitCollection *eehits)
const T & get() const
Definition: EventSetup.h:55
TH2F * h2_xtalMiscalibCoeffEndcapPlus_
static std::vector< DetId > getDetIdsInECAL()
float initCalibCoeff[250]
int SILVER_ELECTRONS_IN_ENDCAP
std::string mcProducer_
TH1F * h1_reco_ZMassCorrBB_
HLT enums.
TH1F * h1_reco_ZMassCorrEE_
size_type size() const
TH2F * h2_xtalMiscalibCoeffBarrel_
void fillZInfo(std::pair< calib::CalibElectron *, calib::CalibElectron * > myZeeCandidate)
Definition: ZeePlots.cc:118
void fillEleInfo(std::vector< HepMC::GenParticle * > &a, std::map< HepMC::GenParticle *, const reco::GsfElectron * > &b)
const_iterator find(uint32_t rawId) const
std::string barrelfile_
float calibCoeffError[250]
int CRACK_ELECTRONS_IN_ENDCAP
int CRACK_ELECTRONS_IN_BARREL
std::string electronProducer_
double getEtaCorrection(const reco::GsfElectron *)
bool aHLTResults[200]
std::string erechitCollection_
TH1F * h1_borderElectronClassification_
TH2F * h2_xtalMiscalibCoeffEndcapMinus_
int SHOWER_ELECTRONS_IN_BARREL
int TOTAL_ELECTRONS_IN_BARREL
std::shared_ptr< EcalIntercalibConstants > ical
void ZeeCalibration::endOfJob ( )
virtual

Called at end of job.

if not ETA_ET MODE - begin

if not ETA_ET MODE - end

Reimplemented from edm::EDLooperBase.

Definition at line 197 of file ZeeCalibration.cc.

References funct::abs(), calibCoeff, calibCoeffError, calibMode_, coefficientDistanceAtIteration, gather_cfg::cout, EcalBarrel, EcalEndcap, RemoveAddSevLevel::flag, ZIterativeAlgorithmWithFit::getHistos(), ZIterativeAlgorithmWithFit::getNumberOfChannels(), ZIterativeAlgorithmWithFit::getNumberOfIterations(), h1_borderElectronClassification_, h1_eleClasses_, h1_electronCosTheta_SC_, h1_electronCosTheta_SC_TK_, h1_electronCosTheta_TK_, h1_eleEtaResol_, h1_elePhiResol_, h1_eventsAfterBorderSelection_, h1_eventsAfterEWKSelection_, h1_eventsBeforeBorderSelection_, h1_eventsBeforeEWKSelection_, h1_mc_, h1_mcEB_, h1_mcEE_, h1_occupancy_, h1_occupancyBarrel_, h1_occupancyEndcap_, h1_occupancyVsEta_, h1_preshowerOverSC_, h1_reco_ZMass_, h1_reco_ZMassCorr_, h1_reco_ZMassCorrBB_, h1_reco_ZMassCorrEE_, h1_seedOverSC_, h1_weightSumMeanBarrel_, h1_weightSumMeanEndcap_, h1_ZCandMult_, h1_zEtaResol_, h1_zMassResol_, h1_zPhiResol_, h2_chi2_, h2_coeffVsEta_, h2_coeffVsEtaGrouped_, h2_coeffVsLoop_, h2_fEtaBarrelBad_, h2_fEtaBarrelGood_, h2_fEtaEndcapBad_, h2_fEtaEndcapGood_, h2_iterations_, h2_miscalRecal_, h2_miscalRecalEB_, h2_miscalRecalEE_, h2_residualSigma_, h2_xtalMiscalibCoeffBarrel_, h2_xtalMiscalibCoeffEndcapMinus_, h2_xtalMiscalibCoeffEndcapPlus_, h2_zMassDiffVsLoop_, h2_zMassVsLoop_, h2_zWidthVsLoop_, h_eleEffEta_, h_eleEffPhi_, h_eleEffPt_, h_ESCcorrEtrue_, h_ESCcorrEtrueVsEta_, h_ESCEtrue_, h_ESCEtrueVsEta_, mps_fire::i, cuy::ib, ical, hcalTTPDigis_cfi::id, initCalibCoeff, EEDetId::IX_MAX, EEDetId::IX_MIN, EEDetId::IY_MAX, EEDetId::IY_MIN, gen::k, loopArray, EBDetId::MAX_IETA, EBDetId::MAX_IPHI, RecoTauDiscriminantConfiguration::mean, EBDetId::MIN_IPHI, myTree, myZeePlots_, pileupDistInMC::num, outputFile_, funct::pow(), printStatistics(), DetId::rawId(), ringNumberCorrector(), RecoTauDiscriminantConfiguration::rms, sigmaArray, sigmaErrorArray, mathSSE::sqrt(), theAlgorithm_, theMaxLoops, EBDetId::validDetId(), EEDetId::validDetId(), ZIterativeAlgorithmWithFit::ZIterativeAlgorithmWithFitPlots::weightedRescaleFactor, ZeePlots::writeEleHistograms(), calibXMLwriter::writeLine(), ZeePlots::writeMCEleHistograms(), ZeePlots::writeMCZHistograms(), and ZeePlots::writeZHistograms().

Referenced by produce().

197  {
198 
199 
200  printStatistics();
201 
202  if(calibMode_ != "ETA_ET_MODE"){
203 
205 
206  //Writing out calibration coefficients
207  calibXMLwriter* barrelWriter = new calibXMLwriter(EcalBarrel);
208  for(int ieta=-EBDetId::MAX_IETA; ieta<=EBDetId::MAX_IETA ;++ieta) {
209  if(ieta==0) continue;
210  for(int iphi=EBDetId::MIN_IPHI; iphi<=EBDetId::MAX_IPHI; ++iphi) {
211  // make an EBDetId since we need EBDetId::rawId() to be used as the key for the pedestals
212  if (EBDetId::validDetId(ieta,iphi))
213  {
214  EBDetId ebid(ieta,iphi);
215  barrelWriter->writeLine(ebid,* (ical->getMap().find(ebid.rawId()) ));
216  }
217  }
218  }
219 
220 
221 
222  calibXMLwriter* endcapWriter = new calibXMLwriter(EcalEndcap);
223  for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
224  for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
225  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
226  if (EEDetId::validDetId(iX,iY,1))
227  {
228  EEDetId eeid(iX,iY,1);
229  endcapWriter->writeLine(eeid,*(ical->getMap().find(eeid.rawId()) ) );
230  }
231  if (EEDetId::validDetId(iX,iY,-1))
232  {
233  EEDetId eeid(iX,iY,-1);
234  endcapWriter->writeLine(eeid, *(ical->getMap().find(eeid.rawId())) );
235  }
236 
237  }
238  }
239 
240 
241  }
242 
243  std::cout<<"Writing histos..."<<std::endl;
244  outputFile_->cd();
245 
246  // zeeplts->Write();
247 
249  h1_eventsAfterEWKSelection_ ->Write();
250 
253 
255 
259 
260  h1_electronCosTheta_SC_->Write();
261  h1_electronCosTheta_TK_->Write();
263 
264  h1_zMassResol_->Write();
265  h1_zEtaResol_->Write();
266  h1_zPhiResol_->Write();
267  h1_eleEtaResol_->Write();
268  h1_elePhiResol_->Write();
269  h1_seedOverSC_ ->Write();
270  h1_preshowerOverSC_ ->Write();
271 
272  for(unsigned int i =0; i<25; i++){
273  if( i < theMaxLoops ){
274 
275  h_ESCEtrueVsEta_[i]->Write();
276  h_ESCEtrue_[i]->Write();
277 
278  h_ESCcorrEtrueVsEta_[i]->Write();
279  h_ESCcorrEtrue_[i]->Write();
280 
281  h2_chi2_[i]->Write();
282  h2_iterations_[i]->Write();
283 
284  // h_DiffZMassDistr_[i]->Write();
285 
286  //h_ZMassDistr_[i]->Write();
287  }
288  }
289 
290  h2_fEtaBarrelGood_->Write();
291  h2_fEtaBarrelBad_->Write();
292  h2_fEtaEndcapGood_->Write();
293  h2_fEtaEndcapBad_->Write();
294  h1_eleClasses_->Write();
295 
296  h_eleEffEta_[0]->Write();
297  h_eleEffPhi_[0]->Write();
298  h_eleEffPt_[0]->Write();
299 
300  h_eleEffEta_[1]->Write();
301  h_eleEffPhi_[1]->Write();
302  h_eleEffPt_[1]->Write();
303 
304 
305  int j = 0;
306 
307  int flag=0;
308 
309  Double_t mean[25] = {0.};
310  Double_t num[25] = {0.};
311  Double_t meanErr[25] = {0.};
312  Float_t rms[25] = {0.};
313  Float_t tempRms[10][25];
314 
315  for(int ia = 0; ia<10; ia++){
316  for(int ib = 0; ib<25; ib++){
317 
318  tempRms[ia][ib] = 0.;
319 
320  }
321  }
322 
323  int aa = 0;
324 
325  for( int k = 0; k<theAlgorithm_->getNumberOfChannels(); k++ )
326  {
327 
328 
329 
331  bool isNearCrack = false;
332 
333  if( calibMode_ == "RING"){
334 
335  isNearCrack = ( abs( ringNumberCorrector(k) ) == 1 || abs( ringNumberCorrector(k) ) == 25 ||
336  abs( ringNumberCorrector(k) ) == 26 || abs( ringNumberCorrector(k) ) == 45 ||
337  abs( ringNumberCorrector(k) ) == 46 || abs( ringNumberCorrector(k) ) == 65 ||
338  abs( ringNumberCorrector(k) ) == 66 || abs( ringNumberCorrector(k) ) == 85 ||
339  abs( ringNumberCorrector(k) ) == 86 || abs( ringNumberCorrector(k) ) == 124 );
340  }
341 
342  if(k<85)
343  {
344 
345  if((k+1)%5!=0)
346  {
347 
348  if(!isNearCrack){
349  mean[j]+=calibCoeff[k];
350  mean[j]+=calibCoeff[169 - k];
351 
352  num[j] += 2.;
353 
354  //meanErr[j]+= calibCoeffError[k];
355  //meanErr[j]+= calibCoeffError[169 - k];
356 
357  meanErr[j]+= 1./ pow ( calibCoeffError[k], 2 );
358  meanErr[j]+= 1./ pow ( calibCoeffError[169 - k], 2);
359 
360 
361  tempRms[aa][j]+=calibCoeff[k];
362  aa++;
363  tempRms[aa][j]+=calibCoeff[169 - k];
364  aa++;
365  }
366  }
367 
368  else {
369  if(!isNearCrack){
370  mean[j]+=calibCoeff[k];
371  mean[j]+=calibCoeff[169 - k];
372 
373  num[j] += 2.;
374 
375  //meanErr[j]+= calibCoeffError[k];
376  //meanErr[j]+= calibCoeffError[169 - k];
377 
378  meanErr[j]+= 1./ pow ( calibCoeffError[k], 2 );
379  meanErr[j]+= 1./ pow ( calibCoeffError[169 - k], 2);
380 
381  tempRms[aa][j]+=calibCoeff[k];
382  aa++;
383  tempRms[aa][j]+=calibCoeff[169 - k];
384  aa++;
385 
386  }
387  j++;
388  aa = 0;
389 
390  }
391 
392  }
393  //EE begin
394 
395 
396  if(k>=170 && k<=204){
397 
398  if(flag<4){
399  //make groups of 5 Xtals in #eta
400  mean[j]+=calibCoeff[k]/10.;
401  mean[j]+=calibCoeff[k+39]/10.;
402 
403  meanErr[j]+= calibCoeffError[k]/30.;
404  meanErr[j]+= calibCoeffError[k + 39]/30.;
405 
406 
407  tempRms[aa][j]+=calibCoeff[k];
408  aa++;
409  tempRms[aa][j]+=calibCoeff[k + 39];
410  aa++;
411 
412  flag++;
413  }
414 
415  else if(flag==4){
416  //make groups of 5 Xtals in #eta
417  mean[j]+=calibCoeff[k]/10.;
418  mean[j]+=calibCoeff[k+39]/10.;
419 
420  meanErr[j]+= calibCoeffError[k]/30.;
421  meanErr[j]+= calibCoeffError[k + 39]/30.;
422 
423  tempRms[aa][j]+=calibCoeff[k];
424  aa++;
425  tempRms[aa][j]+=calibCoeff[k + 39];
426  aa++;
427 
428  flag=0;
429  // std::cout<<" index(>85) "<<k<<" j is "<<j<<" mean[j] is "<<mean[j]<<std::endl;
430  j++;
431  aa = 0;
432 
433  }
434 
435  }
436  if(k>=205 && k<=208){
437  mean[j]+=calibCoeff[k]/8.;
438  mean[j]+=calibCoeff[k+39]/8.;
439 
440  meanErr[j]+= calibCoeffError[k]/30.;
441  meanErr[j]+= calibCoeffError[k + 39]/30.;
442 
443 
444  tempRms[aa][j]+=calibCoeff[k];
445  aa++;
446  tempRms[aa][j]+=calibCoeff[k + 39];
447  aa++;
448  }
449  //EE end
450 
451  /*
452  for(int jj =0; jj< 25; jj++){
453  if(meanErr[jj] > 0.)
454  std::cout<<" meanErr[jj] before sqrt: "<<meanErr[jj]<<std::endl;
455 
456  meanErr[jj] = 1./sqrt( meanErr[jj] );
457 
458  std::cout<<" meanErr[jj] after sqrt: "<<meanErr[jj]<<std::endl;
459  }
460  */
461 
462 
463 
464  if(!isNearCrack){
466  h2_miscalRecal_->Fill( initCalibCoeff[k], 1./calibCoeff[k] );
467  h1_mc_->Fill( initCalibCoeff[k]*calibCoeff[k] -1. );
468 
469 
470 
471  if(k<170){
472  h2_miscalRecalEB_->Fill( initCalibCoeff[k], 1./calibCoeff[k] );
473  h1_mcEB_->Fill( initCalibCoeff[k]*calibCoeff[k] -1. );
474  }
475 
476  if(k>=170){
477  h2_miscalRecalEE_->Fill( initCalibCoeff[k], 1./calibCoeff[k] );
478  h1_mcEE_->Fill( initCalibCoeff[k]*calibCoeff[k] -1. );
479  }
480 
481  }
482  }
483 
484  for(int ic = 0; ic< 17; ic++){
485 
486  mean[ic] = mean[ic] / num[ic]; //find mean of recalib coeff on group of rings
487  //meanErr[ic] = meanErr[ic] / ( sqrt( num[ic] ) * num[ic] ); //find mean of recalib coeff on group of rings
488  meanErr[ic] = 1. / sqrt(meanErr[ic]); //find mean of recalib coeff on group of rings
489 
490  }
491 
492 
493  //build array of RMS
494  for(int ic = 0; ic< 25; ic++){
495  for(int id = 0; id< 10; id++){
496 
497  if(tempRms[id][ic] > 0.){
498 
499  rms[ic] += (tempRms[id][ic] - mean[j])*(tempRms[id][ic] - mean[j]);
500 
501  }
502  }
503  rms[ic]/= 10.;//this is approximate
504  rms[ic] = sqrt(rms[ic]);
505  }
506 
507  //build array of RMS
508 
509 
510 
511  Double_t xtalEta[25] = {1.4425, 1.3567,1.2711,1.1855,
512  1.10,1.01,0.92,0.83,
513  0.7468,0.6612,0.5756,0.4897,0.3985,0.3117,0.2250,0.1384,0.0487,
514  1.546, 1.651, 1.771, 1.908, 2.071, 2.267, 2.516, 2.8};
515 
516  Double_t zero[25] = {0.026};//interval/sqrt(12)
517 
518  for(int j = 0; j <25; j++)
519  h2_coeffVsEtaGrouped_->Fill( xtalEta[j],mean[j]);
520 
521  // for(int sho = 0; sho <25; sho++)
522  //cout<<"xtalEta[j] "<< xtalEta[sho]<<" mean[j] "<<mean[sho]<<" err[j] "<<meanErr[sho]<<std::endl;
523 
524  TProfile *px = h2_coeffVsEta_->ProfileX("coeffVsEtaProfile");
525  px->SetXTitle("Eta channel");
526  px->SetYTitle("recalibCoeff");
527  px->Write();
528 
529  h2_coeffVsEta_->Write();
530  h2_coeffVsEtaGrouped_->Write();
531  h2_zMassVsLoop_->Write();
532  h2_zMassDiffVsLoop_->Write();
533  h2_zWidthVsLoop_->Write();
534  h2_coeffVsLoop_->Write();
535  h2_miscalRecal_->Write();
536  h1_mc_->Write();
537  h2_miscalRecalEB_->Write();
538  h1_mcEB_->Write();
539  h2_miscalRecalEE_->Write();
540  h1_mcEE_->Write();
541 
542  h2_residualSigma_->Write();
543 
545 
546  double weightSumMeanBarrel = 0.;
547  double weightSumMeanEndcap = 0.;
548 
549  for (int iIteration=0;iIteration<theAlgorithm_->getNumberOfIterations();iIteration++)
550  for (int iChannel=0;iChannel<theAlgorithm_->getNumberOfChannels();iChannel++)
551  {
552 
553  if( iIteration==(theAlgorithm_->getNumberOfIterations()-1) ){
554 
555  if(iChannel < 170)
556  weightSumMeanBarrel += algoHistos->weightedRescaleFactor[iIteration][iChannel]->Integral()/170.;
557 
558  if(iChannel >= 170)
559  weightSumMeanEndcap += algoHistos->weightedRescaleFactor[iIteration][iChannel]->Integral()/78.;
560 
561  h1_occupancyVsEta_->Fill((Double_t)ringNumberCorrector(iChannel), algoHistos->weightedRescaleFactor[iIteration][iChannel]->Integral() );
562 
563 
564  h1_occupancy_->Fill( algoHistos->weightedRescaleFactor[iIteration][iChannel]->Integral() );
565 
566  if(iChannel < 170)
567  h1_occupancyBarrel_->Fill( algoHistos->weightedRescaleFactor[iIteration][iChannel]->Integral() );
568 
569  if(iChannel >= 170)
570  h1_occupancyEndcap_->Fill( algoHistos->weightedRescaleFactor[iIteration][iChannel]->Integral() );
571 
572 #ifdef DEBUG
573  std::cout<<"Writing weighted integral for channel "<<ringNumberCorrector(iChannel)<<" ,value "<<algoHistos->weightedRescaleFactor[iIteration][iChannel]->Integral()<<std::endl;
574 #endif
575 
576  }
577 
578  }
579 
580  // std::cout<<"Done! Closing output file... "<<std::endl;
581 
582  h1_weightSumMeanBarrel_ ->Fill(weightSumMeanBarrel);
583  h1_weightSumMeanEndcap_ ->Fill(weightSumMeanEndcap);
584 
585  std::cout<<"Weight sum mean on channels in Barrel is :"<<weightSumMeanBarrel<<std::endl;
586  std::cout<<"Weight sum mean on channels in Endcap is :"<<weightSumMeanEndcap<<std::endl;
587 
588  h1_weightSumMeanBarrel_ ->Write();
589  h1_weightSumMeanEndcap_ ->Write();
590 
591  h1_occupancyVsEta_->Write();
592  h1_occupancy_->Write();
593  h1_occupancyBarrel_->Write();
594  h1_occupancyEndcap_->Write();
595 
596  myTree->Write();
597 
598  TGraphErrors* graph = new TGraphErrors(25,xtalEta,mean,zero,meanErr);
599  graph->Draw("APL");
600  graph->Write();
601 
602  double zero50[50] = { 0. };
603 
604  TGraphErrors* residualSigmaGraph = new TGraphErrors(50,loopArray,sigmaArray,zero50,sigmaErrorArray);
605  residualSigmaGraph->SetName("residualSigmaGraph");
606  residualSigmaGraph->Draw("APL");
607  residualSigmaGraph->Write();
608 
609  TGraphErrors* coefficientDistanceAtIterationGraph = new TGraphErrors(50,loopArray,coefficientDistanceAtIteration,zero50,zero50);
610  coefficientDistanceAtIterationGraph->SetName("coefficientDistanceAtIterationGraph");
611  coefficientDistanceAtIterationGraph->Draw("APL");
612  coefficientDistanceAtIterationGraph->Write();
613 
614  Float_t noError[250] = {0.};
615 
616  Float_t ringInd[250];
617  for(int i =0; i<250; i++)
618  ringInd[i]=ringNumberCorrector(i);
619 
620  TGraphErrors* graphCoeff = new TGraphErrors(theAlgorithm_->getNumberOfChannels(),ringInd,calibCoeff,noError,calibCoeffError);
621  graphCoeff->SetName("graphCoeff");
622  graphCoeff->Draw("APL");
623  graphCoeff->Write();
624 
625  // outputFile_->Write();//this automatically writes all histos on file
626 
627 
628  h1_ZCandMult_->Write();
629  h1_reco_ZMass_->Write();
630 
631  h1_reco_ZMassCorr_->Write();
632  h1_reco_ZMassCorrBB_->Write();
633  h1_reco_ZMassCorrEE_->Write();
634 
635  outputFile_->Close();
636 
641 
642  // myZeeRescaleFactorPlots_ = new ZeeRescaleFactorPlots("zeeRescaleFactorPlots.root");
643  //myZeeRescaleFactorPlots_->writeHistograms( theAlgorithm_ );
644 
645  // delete myZeeRescaleFactorPlots_;
646 
647 
648 
649 }
TH2F * h2_fEtaBarrelBad_
const ZIterativeAlgorithmWithFitPlots * getHistos() const
std::string calibMode_
static const int MIN_IPHI
Definition: EBDetId.h:142
TH1F * h_eleEffPhi_[2]
TH2F * h2_miscalRecal_
TH1F * h1_eventsBeforeEWKSelection_
float calibCoeff[250]
unsigned int theMaxLoops
TH1F * h_ESCEtrue_[25]
TH1F * h1_eventsAfterBorderSelection_
TH1F * h1_occupancyEndcap_
void writeMCEleHistograms()
Definition: ZeePlots.cc:300
TH1F * h1_eventsBeforeBorderSelection_
TH1F * h1_electronCosTheta_SC_
void writeMCZHistograms()
Definition: ZeePlots.cc:146
TH1F * h1_reco_ZMassCorr_
TH2F * h2_coeffVsEtaGrouped_
TH1F * h1_occupancyVsEta_
static const int IX_MIN
Definition: EEDetId.h:294
TH1F * h1_occupancyBarrel_
static const int IY_MIN
Definition: EEDetId.h:298
TH2F * h2_miscalRecalEE_
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:124
TH1F * h1_electronCosTheta_TK_
TH2F * h_ESCcorrEtrueVsEta_[25]
TH2F * h2_fEtaEndcapBad_
int ringNumberCorrector(int k)
double sigmaArray[50]
T sqrt(T t)
Definition: SSEVec.h:18
void writeZHistograms()
Definition: ZeePlots.cc:132
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ZIterativeAlgorithmWithFit * theAlgorithm_
TH1F * h1_elePhiResol_
TH1F * h1_eleEtaResol_
TH1F * h1_eventsAfterEWKSelection_
TH1F * h1_preshowerOverSC_
TH1F * h1_electronCosTheta_SC_TK_
double coefficientDistanceAtIteration[50]
TH1F * h_eleEffPt_[2]
int k[5][pyjets_maxn]
static const int IX_MAX
Definition: EEDetId.h:302
TH2F * h2_zMassDiffVsLoop_
static const int MAX_IPHI
Definition: EBDetId.h:144
ZeePlots * myZeePlots_
void writeEleHistograms()
Definition: ZeePlots.cc:283
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
TH2F * h2_miscalRecalEB_
TH1F * h_ESCcorrEtrue_[25]
double loopArray[50]
TH2F * h2_xtalMiscalibCoeffEndcapPlus_
static const int MAX_IETA
Definition: EBDetId.h:143
float initCalibCoeff[250]
TH1F * h1_reco_ZMassCorrBB_
void writeLine(EBDetId const &, float)
TH1F * h1_reco_ZMassCorrEE_
TH2F * h2_xtalMiscalibCoeffBarrel_
TH2F * h2_chi2_[25]
TH2F * h2_coeffVsLoop_
TH1F * h1_weightSumMeanBarrel_
TH2F * h_ESCEtrueVsEta_[25]
TH2F * h2_zMassVsLoop_
static const int IY_MAX
Definition: EEDetId.h:306
TH2F * h2_iterations_[25]
float calibCoeffError[250]
TH2F * h2_fEtaEndcapGood_
TH2F * h2_fEtaBarrelGood_
TH1F * h_eleEffEta_[2]
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
TH1F * h1_borderElectronClassification_
TH2F * h2_xtalMiscalibCoeffEndcapMinus_
TH2F * h2_zWidthVsLoop_
double sigmaErrorArray[50]
TH2F * h2_residualSigma_
ib
Definition: cuy.py:660
TH1F * h1_weightSumMeanEndcap_
std::shared_ptr< EcalIntercalibConstants > ical
edm::EDLooper::Status ZeeCalibration::endOfLoop ( const edm::EventSetup iSetup,
unsigned int  iLoop 
)
virtual

Called at end of loop.

Definition at line 1512 of file ZeeCalibration.cc.

References funct::abs(), calibCoeff, calibCoeffError, calibMode_, coefficientDistanceAtIteration, computeCoefficientDistanceAtIteration(), gather_cfg::cout, EcalBarrel, EcalEndcap, HcalObjRepresent::Fill(), ZIterativeAlgorithmWithFit::gausfit(), EcalRingCalibrationTools::getDetIdsInECAL(), EcalRingCalibrationTools::getDetIdsInModule(), EcalRingCalibrationTools::getDetIdsInRing(), ZIterativeAlgorithmWithFit::getNumberOfChannels(), ZIterativeAlgorithmWithFit::getOptimizedChiSquare(), ZIterativeAlgorithmWithFit::getOptimizedCoefficients(), ZIterativeAlgorithmWithFit::getOptimizedCoefficientsError(), ZIterativeAlgorithmWithFit::getOptimizedIterations(), h1_mcEBParz_, h1_mcEEParz_, h1_mcParz_, h1_reco_ZMass_, h2_chi2_, h2_iterations_, h2_residualSigma_, h2_xtalRecalibCoeffBarrel_, h2_xtalRecalibCoeffEndcapMinus_, h2_xtalRecalibCoeffEndcapPlus_, h2_zMassDiffVsLoop_, h2_zMassVsLoop_, h2_zWidthVsLoop_, ical, EBDetId::ieta(), initCalibCoeff, EBDetId::iphi(), ZIterativeAlgorithmWithFit::iterate(), EEDetId::ix(), EEDetId::iy(), gen::k, edm::EDLooperBase::kContinue, edm::EDLooperBase::kStop, loopArray, loopFlag_, MZ, NewCalibCoeff, outputFile_, funct::pow(), ringNumberCorrector(), sigmaArray, sigmaErrorArray, mathSSE::sqrt(), theAlgorithm_, theMaxLoops, and EEDetId::zside().

Referenced by produce().

1513 {
1514 
1515 
1516 
1517  double par[3];
1518  double errpar[3];
1519  double zChi2;
1520  int zIters;
1521 
1522  ZIterativeAlgorithmWithFit::gausfit(h1_reco_ZMass_,par,errpar,2.,2., &zChi2, &zIters );
1523 
1524  h2_zMassVsLoop_ -> Fill(loopFlag_, par[1] );
1525 
1526  h2_zMassDiffVsLoop_ -> Fill(loopFlag_, (par[1]-MZ)/MZ );
1527 
1528  h2_zWidthVsLoop_ -> Fill(loopFlag_, par[2] );
1529 
1530 
1532 
1533  std::cout<< "[ZeeCalibration] Ending loop " << iLoop<<std::endl;
1534  //RUN the algorithm
1536 
1537  const std::vector<float>& optimizedCoefficients = theAlgorithm_->getOptimizedCoefficients();
1538  const std::vector<float>& optimizedCoefficientsError = theAlgorithm_->getOptimizedCoefficientsError();
1539  //const std::vector<float>& weightSum = theAlgorithm_->getWeightSum();
1540  const std::vector<float>& optimizedChi2 = theAlgorithm_->getOptimizedChiSquare();
1541  const std::vector<int>& optimizedIterations = theAlgorithm_->getOptimizedIterations();
1542 
1543 
1544  //#ifdef DEBUG
1545  std::cout<< "Optimized coefficients " << optimizedCoefficients.size() <<std::endl;
1546  //#endif
1547 
1548  // h2_coeffVsLoop_->Fill(loopFlag_, optimizedCoefficients[75]); //show the evolution of just 1 ring coefficient (well chosen...)
1549 
1551  for (unsigned int ieta=0;ieta<optimizedCoefficients.size();ieta++)
1552  {
1553  NewCalibCoeff[ieta] = calibCoeff[ieta] * optimizedCoefficients[ieta];
1554 
1555  h2_chi2_[loopFlag_]->Fill( ringNumberCorrector( ieta ), optimizedChi2[ieta] );
1556  h2_iterations_[loopFlag_]->Fill( ringNumberCorrector( ieta ), optimizedIterations[ieta] );
1557 
1558  }
1560 
1561 
1563 
1564  std::cout<<"Iteration # : "<< loopFlag_ << " CoefficientDistanceAtIteration "<< coefficientDistanceAtIteration[loopFlag_] <<std::endl;
1565  std::cout<<"size "<<optimizedCoefficients.size()<<std::endl;
1566 
1567  for (unsigned int ieta=0;ieta<optimizedCoefficients.size();ieta++)
1568  {
1569  calibCoeff[ieta] *= optimizedCoefficients[ieta];
1570  calibCoeffError[ieta] = calibCoeff[ieta] * sqrt ( pow( optimizedCoefficientsError[ieta]/optimizedCoefficients[ieta], 2 ) + pow( calibCoeffError[ieta]/calibCoeff[ieta] , 2 ) );
1571  //calibCoeffError[ieta] = optimizedCoefficientsError[ieta];
1572 
1573 
1574 #ifdef DEBUG
1575  std::cout<< ieta << " " << optimizedCoefficients[ieta] <<std::endl;
1576 #endif
1577 
1578  std::vector<DetId> ringIds;
1579 
1580  if(calibMode_ == "RING")
1582 
1583  if(calibMode_ == "MODULE")
1585 
1586  if(calibMode_ == "ABS_SCALE" || calibMode_ == "ETA_ET_MODE" )
1588 
1589 
1590  for (unsigned int iid=0; iid<ringIds.size();++iid){
1591 
1592  if(ringIds[iid].subdetId() == EcalBarrel){
1593  EBDetId myEBDetId(ringIds[iid]);
1594  h2_xtalRecalibCoeffBarrel_[loopFlag_]->SetBinContent( myEBDetId.ieta() + 86, myEBDetId.iphi(), 100 * (calibCoeff[ieta]*initCalibCoeff[ieta] - 1.) );//fill TH2 with recalibCoeff
1595 
1596  }
1597 
1598  if(ringIds[iid].subdetId() == EcalEndcap){
1599  EEDetId myEEDetId(ringIds[iid]);
1600  if(myEEDetId.zside() < 0)
1601  h2_xtalRecalibCoeffEndcapMinus_[loopFlag_]->SetBinContent( myEEDetId.ix(), myEEDetId.iy(), 100 * (calibCoeff[ieta]*initCalibCoeff[ieta] - 1.) );//fill TH2 with recalibCoeff
1602 
1603  if(myEEDetId.zside() > 0)
1604  h2_xtalRecalibCoeffEndcapPlus_[loopFlag_]->SetBinContent( myEEDetId.ix(), myEEDetId.iy(), 100 * (calibCoeff[ieta]*initCalibCoeff[ieta] - 1.) );//fill TH2 with recalibCoeff
1605 
1606  }
1607 
1608 
1609  ical->setValue( ringIds[iid], *(ical->getMap().find(ringIds[iid]) ) * optimizedCoefficients[ieta] );
1610  }
1611 
1612  }
1613 
1614 
1616 
1617  for( int k = 0; k<theAlgorithm_->getNumberOfChannels(); k++ )
1618  {
1619  bool isNearCrack = ( abs( ringNumberCorrector(k) ) == 1 || abs( ringNumberCorrector(k) ) == 25 ||
1620  abs( ringNumberCorrector(k) ) == 26 || abs( ringNumberCorrector(k) ) == 45 ||
1621  abs( ringNumberCorrector(k) ) == 46 || abs( ringNumberCorrector(k) ) == 65 ||
1622  abs( ringNumberCorrector(k) ) == 66 || abs( ringNumberCorrector(k) ) == 85 ||
1623  abs( ringNumberCorrector(k) ) == 86 || abs( ringNumberCorrector(k) ) == 124 );
1624 
1625  if(!isNearCrack){
1626 
1627  // h2_miscalRecalParz_[iLoop]->Fill( initCalibCoeff[k], 1./calibCoeff[k] );
1628  h1_mcParz_[iLoop]->Fill( initCalibCoeff[k]*calibCoeff[k] -1. );
1629 
1630  if(k<170){
1631  //h2_miscalRecalEBParz_[iLoop]->Fill( initCalibCoeff[k], 1./calibCoeff[k] );
1632  h1_mcEBParz_[iLoop]->Fill( initCalibCoeff[k]*calibCoeff[k] -1. );
1633 
1634  }
1635 
1636  if(k>=170){
1637  //h2_miscalRecalEEParz_[iLoop]->Fill( initCalibCoeff[k], 1./calibCoeff[k] );
1638  h1_mcEEParz_[iLoop]->Fill( initCalibCoeff[k]*calibCoeff[k] -1. );
1639  }
1640 
1641  }
1642  }
1643 
1644 
1646  double parResidual[3];
1647  double errparResidual[3];
1648  double zResChi2;
1649  int zResIters;
1650 
1651  ZIterativeAlgorithmWithFit::gausfit(h1_mcParz_[iLoop],parResidual,errparResidual,3.,3., &zResChi2, &zResIters);
1652  //h1_mcParz_[iLoop]->Fit("gaus");
1653 
1654  h2_residualSigma_ -> Fill(loopFlag_ + 1, parResidual[2]);
1655  loopArray[loopFlag_] = loopFlag_ + 1;
1656  sigmaArray[loopFlag_] = parResidual[2];
1657  sigmaErrorArray[loopFlag_] = errparResidual[2];
1658 
1659  std::cout<<"Fit on residuals, sigma is "<<parResidual[2]<<" +/- "<<errparResidual[2]<<std::endl;
1660 
1662  outputFile_->cd();
1663 
1664 
1665  // h2_miscalRecalParz_[iLoop]->Write();
1666  h1_mcParz_[iLoop]->Write();
1667 
1668  //h2_miscalRecalEBParz_[iLoop]->Write();
1669  h1_mcEBParz_[iLoop]->Write();
1670 
1671  //h2_miscalRecalEEParz_[iLoop]->Write();
1672  h1_mcEEParz_[iLoop]->Write();
1676 
1678 
1679  loopFlag_++;
1680 
1681 #ifdef DEBUG
1682  std::cout<<" loopFlag_ is "<<loopFlag_<<std::endl;
1683 #endif
1684 
1685  if ( iLoop == theMaxLoops-1 || iLoop >= theMaxLoops ) return kStop;
1686  else return kContinue;
1687 }
TH1F * h1_mcEEParz_[25]
std::string calibMode_
float computeCoefficientDistanceAtIteration(float v1[250], float v2[250], int size)
float calibCoeff[250]
const std::vector< float > & getOptimizedChiSquare() const
unsigned int theMaxLoops
const std::vector< float > & getOptimizedCoefficients() const
#define MZ
static void gausfit(TH1F *histoou, double *par, double *errpar, float nsigmalow, float nsigmaup, double *mychi2, int *iterations)
static std::vector< DetId > getDetIdsInRing(short aRingIndex)
Retrieve the DetIds in a phi-ring.
int ringNumberCorrector(int k)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
double sigmaArray[50]
T sqrt(T t)
Definition: SSEVec.h:18
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TH1F * h1_mcEBParz_[25]
ZIterativeAlgorithmWithFit * theAlgorithm_
TH2F * h2_xtalRecalibCoeffBarrel_[25]
static std::vector< DetId > getDetIdsInModule(short int)
double coefficientDistanceAtIteration[50]
int k[5][pyjets_maxn]
TH2F * h2_zMassDiffVsLoop_
TH1F * h1_mcParz_[25]
const std::vector< float > & getOptimizedCoefficientsError() const
double loopArray[50]
static std::vector< DetId > getDetIdsInECAL()
float initCalibCoeff[250]
TH2F * h2_chi2_[25]
TH2F * h2_zMassVsLoop_
TH2F * h2_iterations_[25]
float NewCalibCoeff[250]
float calibCoeffError[250]
TH2F * h2_xtalRecalibCoeffEndcapPlus_[25]
TH2F * h2_xtalRecalibCoeffEndcapMinus_[25]
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
TH2F * h2_zWidthVsLoop_
double sigmaErrorArray[50]
TH2F * h2_residualSigma_
const std::vector< int > & getOptimizedIterations() const
std::shared_ptr< EcalIntercalibConstants > ical
float ZeeCalibration::EvalDPhi ( float  Phi,
float  Phi_ref 
)
private

Definition at line 2063 of file ZeeCalibration.cc.

References colinearityKinematic::Phi, and Pi.

Referenced by produce().

2064 {
2065  if (Phi<0) Phi = 2*TMath::Pi() + Phi;
2066  if (Phi_ref<0) Phi_ref = 2*TMath::Pi() + Phi_ref;
2067  return (Phi - Phi_ref);
2068 }
const double Pi
float ZeeCalibration::EvalDR ( float  Eta,
float  Eta_ref,
float  Phi,
float  Phi_ref 
)
private

Definition at line 2050 of file ZeeCalibration.cc.

References mitigatedMETSequence_cff::DPhi, colinearityKinematic::Phi, Pi, and mathSSE::sqrt().

Referenced by fillMCmap(), and produce().

2051 {
2052  if (Phi<0) Phi = 2*TMath::Pi() + Phi;
2053  if (Phi_ref<0) Phi_ref = 2*TMath::Pi() + Phi_ref;
2054  float DPhi = Phi - Phi_ref ;
2055  if (fabs(DPhi)>TMath::Pi()) DPhi = 2*TMath::Pi() - fabs(DPhi);
2056 
2057  float DEta = Eta - Eta_ref ;
2058 
2059  float DR = sqrt( DEta*DEta + DPhi*DPhi );
2060  return DR;
2061 }
const double Pi
T sqrt(T t)
Definition: SSEVec.h:18
double ZeeCalibration::fEtaBarrelBad ( double  scEta) const
private

Definition at line 1977 of file ZeeCalibration.cc.

References p1, p2, and x.

Referenced by getEtaCorrection(), and produce().

1977  {
1978 
1979  float p0 = 1.00153e+00;
1980  float p1 = 3.29331e-02;
1981  float p2 = 1.21187e-03;
1982 
1983  double x = (double) fabs(scEta);
1984 
1985  return 1. / ( p0 + p1*x*x + p2*x*x*x*x );
1986 
1987 }
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
double ZeeCalibration::fEtaBarrelGood ( double  scEta) const
private

Definition at line 2015 of file ZeeCalibration.cc.

References p1, p2, and x.

Referenced by getEtaCorrection(), and produce().

2015  {
2016 
2017  float p0 = 9.99782e-01 ;
2018  float p1 = 1.26983e-02;
2019  float p2 = 2.16344e-03;
2020 
2021  double x = (double) fabs(scEta);
2022 
2023  return 1. / ( p0 + p1*x*x + p2*x*x*x*x );
2024 
2025 }
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
double ZeeCalibration::fEtaEndcapBad ( double  scEta) const
private

Definition at line 2003 of file ZeeCalibration.cc.

References p1, p2, and x.

Referenced by getEtaCorrection(), and produce().

2003  {
2004 
2005  float p0 = 1.17382e+00;
2006  float p1 = -6.52319e-02;
2007  float p2 = 6.26108e-03;
2008 
2009  double x = (double) fabs(scEta);
2010 
2011  return 1. / ( p0 + p1*x*x + p2*x*x*x*x );
2012 
2013 }
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
double ZeeCalibration::fEtaEndcapGood ( double  scEta) const
private

Definition at line 1989 of file ZeeCalibration.cc.

References p1, p2, and x.

Referenced by getEtaCorrection(), and produce().

1989  {
1990 
1991  // f(eta) for the first 3 classes (100, 110 and 120)
1992  // Ivica's new corrections 01/06
1993  float p0 = 1.06819e+00;
1994  float p1 = -1.53189e-02;
1995  float p2 = 4.01707e-04 ;
1996 
1997  double x = (double) fabs(scEta);
1998 
1999  return 1. / ( p0 + p1*x*x + p2*x*x*x*x );
2000 
2001 }
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
void ZeeCalibration::fillEleInfo ( std::vector< HepMC::GenParticle * > &  a,
std::map< HepMC::GenParticle *, const reco::GsfElectron * > &  b 
)
private

Definition at line 2070 of file ZeeCalibration.cc.

References MillePedeFileConverter_cfg::e, reco::CaloCluster::energy(), reco::LeafCandidate::eta(), getEtaCorrection(), h1_eleEtaResol_, h1_elePhiResol_, h1_preshowerOverSC_, h1_seedOverSC_, h_eleEffEta_, h_eleEffPhi_, h_eleEffPt_, h_ESCcorrEtrue_, h_ESCcorrEtrueVsEta_, h_ESCEtrue_, h_ESCEtrueVsEta_, mps_fire::i, loopFlag_, perp(), phi, reco::LeafCandidate::phi(), reco::CaloCluster::position(), reco::SuperCluster::preshowerEnergy(), reco::SuperCluster::seed(), and reco::GsfElectron::superCluster().

Referenced by duringLoop(), and produce().

2071 {
2072 
2073  for (unsigned int i=0;i<mcEle.size();i++)
2074  {
2075 
2076  h_eleEffEta_[0]->Fill(fabs(mcEle[i]->momentum().pseudoRapidity()));
2077  h_eleEffPhi_[0]->Fill(mcEle[i]->momentum().phi());
2078  h_eleEffPt_[0]->Fill(mcEle[i]->momentum().perp());
2079 
2080  std::map<HepMC::GenParticle*,const reco::GsfElectron*>::const_iterator mIter = associationMap.find(mcEle[i]);
2081  if (mIter == associationMap.end() )
2082  continue;
2083 
2084  if((*mIter).second)
2085  {
2086  const reco::GsfElectron* myEle=(*mIter).second;
2087 
2088  h_eleEffEta_[1]->Fill(fabs(mcEle[i]->momentum().pseudoRapidity()));
2089  h_eleEffPhi_[1]->Fill(mcEle[i]->momentum().phi());
2090  h_eleEffPt_[1]->Fill(mcEle[i]->momentum().perp());
2091  h1_eleEtaResol_->Fill( myEle->eta() - mcEle[i]->momentum().eta() );
2092  h1_elePhiResol_->Fill( myEle->phi() - mcEle[i]->momentum().phi() );
2093 
2094  const reco::SuperCluster* mySC=&(*(myEle->superCluster()));
2095  if (/*fabs(mySC->position().eta()) < 2.4*/1)
2096  {
2097  // if(myEle->classification()>=100)std::cout<<"mySC->preshowerEnergy()"<<mySC->preshowerEnergy()<<std::endl;
2098 
2099  h_ESCEtrue_[loopFlag_]->Fill(mySC->energy()/mcEle[i]->momentum().e());
2100  h_ESCEtrueVsEta_[loopFlag_]->Fill(fabs(mySC->position().eta()),mySC->energy()/mcEle[i]->momentum().e());
2101 
2102  double corrSCenergy = ( mySC->energy() )/getEtaCorrection(myEle);
2103  h_ESCcorrEtrue_[loopFlag_]->Fill(corrSCenergy/mcEle[i]->momentum().e());
2104  h_ESCcorrEtrueVsEta_[loopFlag_]->Fill(fabs(mySC->position().eta()),corrSCenergy/mcEle[i]->momentum().e());
2105 
2106 // std::vector<DetId> mySCRecHits = mySC->seed()->getHitsByDetId();
2107 
2108  h1_seedOverSC_->Fill( mySC->seed()->energy() / mySC->energy() );
2109  h1_preshowerOverSC_->Fill( mySC->preshowerEnergy() / mySC->energy() );
2110 
2111  }
2112 
2113  }
2114  }
2115 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:129
TH1F * h_eleEffPhi_[2]
virtual double eta() const final
momentum pseudorapidity
TH1F * h_ESCEtrue_[25]
virtual double phi() const final
momentum azimuthal angle
TH2F * h_ESCcorrEtrueVsEta_[25]
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:184
double energy() const
cluster energy
Definition: CaloCluster.h:124
TH1F * h1_elePhiResol_
TH1F * h1_eleEtaResol_
TH1F * h1_preshowerOverSC_
TH1F * h_eleEffPt_[2]
TH1F * h_ESCcorrEtrue_[25]
T perp() const
Magnitude of transverse component.
TH2F * h_ESCEtrueVsEta_[25]
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
double preshowerEnergy() const
energy deposited in preshower
Definition: SuperCluster.h:50
double getEtaCorrection(const reco::GsfElectron *)
TH1F * h_eleEffEta_[2]
void ZeeCalibration::fillMCInfo ( HepMC::GenParticle *  mcele)
private

Referenced by produce().

void ZeeCalibration::fillMCmap ( const std::vector< const reco::GsfElectron * > *  electronCollection,
const std::vector< HepMC::GenParticle * > &  mcEle,
std::map< HepMC::GenParticle *, const reco::GsfElectron * > &  myMCmap 
)
private

Definition at line 2030 of file ZeeCalibration.cc.

References runTauDisplay::dr, PVValHelper::eta, EvalDR(), mps_fire::i, heepIdVarValueMapProducer_cfi::minDR, and phi.

Referenced by duringLoop(), and produce().

2031 {
2032  for (unsigned int i=0;i<mcEle.size();i++)
2033  {
2034  float minDR=0.1;
2035  const reco::GsfElectron* myMatchEle=0;
2036  for (unsigned int j=0;j<electronCollection->size();j++)
2037  {
2038  float dr=EvalDR(mcEle[i]->momentum().pseudoRapidity(),(*(*electronCollection)[j]).eta(),mcEle[i]->momentum().phi(),(*(*electronCollection)[j]).phi());
2039  if (dr < minDR )
2040  {
2041  myMatchEle = (*electronCollection)[j];
2042  minDR = dr;
2043  }
2044  }
2045  myMCmap.insert(std::pair<HepMC::GenParticle*,const reco::GsfElectron*>(mcEle[i],myMatchEle));
2046 
2047  }
2048 }
float EvalDR(float Eta, float Eta_ref, float Phi, float Phi_ref)
double ZeeCalibration::getEtaCorrection ( const reco::GsfElectron ele)
private

Definition at line 2145 of file ZeeCalibration.cc.

References EnergyCorrector::c, reco::GsfElectron::classification(), fEtaBarrelBad(), fEtaBarrelGood(), fEtaEndcapBad(), fEtaEndcapGood(), and reco::GsfElectron::superCluster().

Referenced by duringLoop(), fillEleInfo(), and produce().

2145  {
2146 
2147  double correction(1.);
2148 
2149  int c = ele->classification();
2150  if(c ==0 ||
2151  c ==10 ||
2152  c ==20)
2153  correction = fEtaBarrelGood(ele->superCluster()->eta());
2154 
2155  if(c ==100 ||
2156  c ==110 ||
2157  c ==120)
2158  correction = fEtaEndcapGood(ele->superCluster()->eta());
2159 
2160  if(c ==30 ||
2161  c ==31 ||
2162  c ==32 ||
2163  c ==33 ||
2164  c ==34)
2165  correction = fEtaBarrelBad(ele->superCluster()->eta());
2166 
2167 
2168  if(c ==130 ||
2169  c ==131 ||
2170  c ==132 ||
2171  c ==133 ||
2172  c ==134)
2173  correction = fEtaEndcapBad(ele->superCluster()->eta());
2174 
2175  return correction;
2176 }
double fEtaEndcapGood(double scEta) const
double fEtaBarrelBad(double scEta) const
double fEtaEndcapBad(double scEta) const
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:184
Classification classification() const
Definition: GsfElectron.h:746
double fEtaBarrelGood(double scEta) const
std::pair< DetId, double > ZeeCalibration::getHottestDetId ( const std::vector< std::pair< DetId, float > > &  mySCRecHits,
const EBRecHitCollection ebhits,
const EERecHitCollection eehits 
)
private

Definition at line 2178 of file ZeeCalibration.cc.

References gather_cfg::cout, EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), EcalRecHit::energy(), edm::SortedCollection< T, SORT >::find(), EcalRecHit::id(), and particleFlowClusterECALTimeSelected_cfi::maxEnergy.

Referenced by duringLoop(), and produce().

2178  {
2179 
2180 
2181  double maxEnergy = -9999.;
2182  const EcalRecHit* hottestRecHit=0;
2183 
2184  std::pair<DetId, double> myPair (DetId(0), -9999.);
2185 
2186 
2187  for( std::vector<std::pair<DetId,float> >::const_iterator idIt=mySCRecHits.begin(); idIt != mySCRecHits.end(); idIt++){
2188 
2189  if (idIt->first.subdetId() == EcalBarrel )
2190  {
2191  hottestRecHit = & (* ( ebhits->find((*idIt).first) ) );
2192 
2193  if( hottestRecHit == & (*( ebhits->end())) )
2194  {
2195  std::cout<<"@@@@@@@@@@@@@@@@@@@@@@@@@@@ NO RECHIT FOUND SHOULD NEVER HAPPEN"<<std::endl;
2196  continue;
2197  }
2198  }
2199  else if (idIt->first.subdetId() == EcalEndcap )
2200  {
2201  hottestRecHit = & (* ( eehits->find((*idIt).first) ) );
2202  if( hottestRecHit == & (*( eehits->end())) )
2203  {
2204  std::cout<<"@@@@@@@@@@@@@@@@@@@@@@@@@@@ NO RECHIT FOUND SHOULD NEVER HAPPEN"<<std::endl;
2205  continue;
2206  }
2207  }
2208 
2209  //std::cout<<"[getHottestDetId] hottestRecHit->energy() "<<hottestRecHit->energy()<<std::endl;
2210 
2211  if(hottestRecHit && hottestRecHit->energy() > maxEnergy){
2212 
2213  maxEnergy = hottestRecHit->energy();
2214 
2215  myPair.first = hottestRecHit ->id();
2216  myPair.second = maxEnergy;
2217 
2218  }
2219 
2220  }//end loop to find hottest RecHit
2221 
2222  //std::cout<<"[ZeeCalibration::getHottestDetId] going to return..."<<std::endl;
2223 
2224  return myPair;
2225 
2226 }
float energy() const
Definition: EcalRecHit.h:68
const_iterator end() const
Definition: DetId.h:18
DetId id() const
get the id
Definition: EcalRecHit.h:77
iterator find(key_type k)
void ZeeCalibration::printStatistics ( )
private

Definition at line 2369 of file ZeeCalibration.cc.

References BARREL_ELECTRONS_AFTER_BORDER_CUT, BARREL_ELECTRONS_BEFORE_BORDER_CUT, BBZN, BBZN_gg, BBZN_t0, BBZN_tt, gather_cfg::cout, CRACK_ELECTRONS_IN_BARREL, CRACK_ELECTRONS_IN_ENDCAP, EBZN, EBZN_gg, EBZN_t0, EBZN_tt, EEZN, EEZN_gg, EEZN_t0, EEZN_tt, objects.autophobj::float, groupFilesInBlocks::fout, GOLDEN_ELECTRONS_IN_BARREL, GOLDEN_ELECTRONS_IN_ENDCAP, MCZBB, MCZEB, MCZEE, NEVT, SHOWER_ELECTRONS_IN_BARREL, SHOWER_ELECTRONS_IN_ENDCAP, SILVER_ELECTRONS_IN_BARREL, SILVER_ELECTRONS_IN_ENDCAP, TOTAL_ELECTRONS_IN_BARREL, and TOTAL_ELECTRONS_IN_ENDCAP.

Referenced by endOfJob(), and produce().

2369  {
2370 
2371 
2372  std::cout<< "[ CHECK ON BARREL ELECTRON NUMBER ]"<<" first "<<BARREL_ELECTRONS_BEFORE_BORDER_CUT<<" second "<<TOTAL_ELECTRONS_IN_BARREL << std::endl;
2373 
2374 
2375  std::cout<< "[ EFFICIENCY OF THE BORDER SELECTION ]" << (float)BARREL_ELECTRONS_AFTER_BORDER_CUT / (float) BARREL_ELECTRONS_BEFORE_BORDER_CUT << std::endl;
2376 
2377  std::cout<< "[ EFFICIENCY OF THE GOLDEN SELECTION ] BARREL: " << (float)GOLDEN_ELECTRONS_IN_BARREL / (float) TOTAL_ELECTRONS_IN_BARREL << " ENDCAP: "<< (float)GOLDEN_ELECTRONS_IN_ENDCAP / (float) TOTAL_ELECTRONS_IN_ENDCAP << std::endl;
2378 
2379  std::cout<< "[ EFFICIENCY OF THE SILVER SELECTION ] BARREL: " << (float)SILVER_ELECTRONS_IN_BARREL / (float) TOTAL_ELECTRONS_IN_BARREL << " ENDCAP: "<< (float)SILVER_ELECTRONS_IN_ENDCAP / (float) TOTAL_ELECTRONS_IN_ENDCAP << std::endl;
2380 
2381  std::cout<< "[ EFFICIENCY OF THE SHOWER SELECTION ] BARREL: " << (float)SHOWER_ELECTRONS_IN_BARREL / (float) TOTAL_ELECTRONS_IN_BARREL << " ENDCAP: "<< (float)SHOWER_ELECTRONS_IN_ENDCAP / (float) TOTAL_ELECTRONS_IN_ENDCAP << std::endl;
2382 
2383  std::cout<< "[ EFFICIENCY OF THE CRACK SELECTION ] BARREL: " << (float)CRACK_ELECTRONS_IN_BARREL / (float) TOTAL_ELECTRONS_IN_BARREL << " ENDCAP: "<< (float)CRACK_ELECTRONS_IN_ENDCAP / (float) TOTAL_ELECTRONS_IN_ENDCAP << std::endl;
2384 
2385 
2386 
2387  std::ofstream fout("ZeeStatistics.txt");
2388 
2389  if(!fout) {
2390  std::cout << "Cannot open output file.\n";
2391  }
2392 
2393  fout<<"ZeeStatistics"<<std::endl;
2394 
2395  fout<<"##########################RECO#########################"<<std::endl;
2396  fout<<"##################Zee with Barrel-Barrel electrons: "<<BBZN<<std::endl;
2397 
2398  fout<<"Golden-Golden fraction: "<<(float)BBZN_gg/BBZN<<" 3-3 fraction is "<<(float)BBZN_tt/BBZN<<" 3-whatever fraction is "<<(float)BBZN_t0/BBZN<<std::endl;
2399  fout<<"##################Zee with Barrel-Endcap electrons: "<<EBZN<<std::endl;
2400  fout<<"Golden-Golden fraction: "<<(float)EBZN_gg/EBZN<<" 3-3 fraction is "<<(float)EBZN_tt/EBZN<<" 3-whatever fraction is "<<(float)EBZN_t0/EBZN<<std::endl;
2401  fout<<"##################Zee with Endcap-Endcap electrons: "<<EEZN<<std::endl;
2402  fout<<"Golden-Golden fraction: "<<(float)EEZN_gg/EEZN<<" 3-3 fraction is "<<(float)EEZN_tt/EEZN<<" 3-whatever fraction is "<<(float)EEZN_t0/EEZN<<std::endl;
2403 
2404  fout<<"\n"<<std::endl;
2405 
2406  fout<<"##########################GEN#########################"<<std::endl;
2407  fout<<"##################Zee with Barrel-Barrel electrons: "<<(float)MCZBB/NEVT<<std::endl;
2408  fout<<"##################Zee with Barrel-Endcap electrons: "<<(float)MCZEB/NEVT<<std::endl;
2409  fout<<"##################Zee with Endcap-Endcap electrons: "<<(float)MCZEE/NEVT<<std::endl;
2410 
2411  fout.close();
2412 
2413 
2414 
2415 }
3: Bad ECAL shower shape
Definition: ParticleCode.h:36
int BARREL_ELECTRONS_AFTER_BORDER_CUT
int GOLDEN_ELECTRONS_IN_ENDCAP
int GOLDEN_ELECTRONS_IN_BARREL
int SILVER_ELECTRONS_IN_BARREL
int TOTAL_ELECTRONS_IN_ENDCAP
int BARREL_ELECTRONS_BEFORE_BORDER_CUT
int SHOWER_ELECTRONS_IN_ENDCAP
int SILVER_ELECTRONS_IN_ENDCAP
if(dp >Float(M_PI)) dp-
int CRACK_ELECTRONS_IN_ENDCAP
int CRACK_ELECTRONS_IN_BARREL
int SHOWER_ELECTRONS_IN_BARREL
int TOTAL_ELECTRONS_IN_BARREL
virtual void ZeeCalibration::produce ( edm::Event ,
const edm::EventSetup  
)
inlinevirtual
std::shared_ptr< EcalIntercalibConstants > ZeeCalibration::produceEcalIntercalibConstants ( const EcalIntercalibConstantsRcd iRecord)
virtual

Produce Ecal interCalibrations.

Definition at line 184 of file ZeeCalibration.cc.

References gather_cfg::cout, and ical.

Referenced by produce(), and ZeeCalibration().

185 {
186  std::cout << "@SUB=ZeeCalibration::produceEcalIntercalibConstants" << std::endl;
187  return ical;
188 }
std::shared_ptr< EcalIntercalibConstants > ical
void ZeeCalibration::resetHistograms ( )
private

Definition at line 2321 of file ZeeCalibration.cc.

References h1_eleClasses_, h1_electronCosTheta_SC_, h1_electronCosTheta_SC_TK_, h1_electronCosTheta_TK_, h1_eleEtaResol_, h1_elePhiResol_, h1_eventsAfterBorderSelection_, h1_eventsAfterEWKSelection_, h1_eventsBeforeBorderSelection_, h1_eventsBeforeEWKSelection_, h1_occupancy_, h1_occupancyBarrel_, h1_occupancyEndcap_, h1_occupancyVsEta_, h1_preshowerOverSC_, h1_reco_ZMass_, h1_reco_ZMassCorr_, h1_reco_ZMassCorrBB_, h1_reco_ZMassCorrEE_, h1_seedOverSC_, h1_ZCandMult_, h1_zMassResol_, h2_fEtaBarrelBad_, h2_fEtaBarrelGood_, h2_fEtaEndcapBad_, h2_fEtaEndcapGood_, h_eleEffEta_, h_eleEffPhi_, h_eleEffPt_, mps_fire::i, and HcalObjRepresent::Reset().

Referenced by produce(), and startingNewLoop().

2321  {
2322 
2323  h1_eventsBeforeEWKSelection_ ->Reset();
2324  h1_eventsAfterEWKSelection_ ->Reset();
2325 
2328 
2329  for (int i=0;i<2;i++)
2330  {
2331  h_eleEffEta_[i] ->Reset();
2332  h_eleEffPhi_[i] ->Reset();
2333  h_eleEffPt_[i] ->Reset();
2334  }
2335 
2336  h1_seedOverSC_ ->Reset();
2337  h1_preshowerOverSC_ ->Reset();
2338 
2339  h1_eleEtaResol_->Reset();
2340  h1_elePhiResol_->Reset();
2341 
2342  h1_zMassResol_->Reset();
2343 
2344  h1_electronCosTheta_TK_->Reset();
2345  h1_electronCosTheta_SC_->Reset();
2346  h1_electronCosTheta_SC_TK_->Reset();
2347 
2348  h2_fEtaBarrelGood_->Reset();
2349  h2_fEtaBarrelBad_->Reset();
2350  h2_fEtaEndcapGood_->Reset();
2351  h2_fEtaEndcapBad_->Reset();
2352  h1_eleClasses_->Reset();
2353 
2354  h1_ZCandMult_-> Reset();
2355  h1_reco_ZMass_-> Reset();
2360  h1_occupancy_-> Reset();
2363 
2364  return;
2365 
2366 }
TH2F * h2_fEtaBarrelBad_
TH1F * h_eleEffPhi_[2]
TH1F * h1_eventsBeforeEWKSelection_
TH1F * h1_eventsAfterBorderSelection_
TH1F * h1_occupancyEndcap_
TH1F * h1_eventsBeforeBorderSelection_
TH1F * h1_electronCosTheta_SC_
TH1F * h1_reco_ZMassCorr_
TH1F * h1_occupancyVsEta_
TH1F * h1_occupancyBarrel_
TH1F * h1_electronCosTheta_TK_
TH2F * h2_fEtaEndcapBad_
TH1F * h1_elePhiResol_
TH1F * h1_eleEtaResol_
TH1F * h1_eventsAfterEWKSelection_
TH1F * h1_preshowerOverSC_
TH1F * h1_electronCosTheta_SC_TK_
TH1F * h_eleEffPt_[2]
TH1F * h1_reco_ZMassCorrBB_
TH1F * h1_reco_ZMassCorrEE_
void Reset(std::vector< TH2F > &depth)
TH2F * h2_fEtaEndcapGood_
TH2F * h2_fEtaBarrelGood_
TH1F * h_eleEffEta_[2]
void ZeeCalibration::resetVariables ( )
private

Definition at line 2283 of file ZeeCalibration.cc.

References BARREL_ELECTRONS_AFTER_BORDER_CUT, BARREL_ELECTRONS_BEFORE_BORDER_CUT, BBZN, BBZN_gg, BBZN_t0, BBZN_tt, CRACK_ELECTRONS_IN_BARREL, CRACK_ELECTRONS_IN_ENDCAP, EBZN, EBZN_gg, EBZN_t0, EBZN_tt, EEZN, EEZN_gg, EEZN_t0, EEZN_tt, GOLDEN_ELECTRONS_IN_BARREL, GOLDEN_ELECTRONS_IN_ENDCAP, SHOWER_ELECTRONS_IN_BARREL, SHOWER_ELECTRONS_IN_ENDCAP, SILVER_ELECTRONS_IN_BARREL, SILVER_ELECTRONS_IN_ENDCAP, TOTAL_ELECTRONS_IN_BARREL, and TOTAL_ELECTRONS_IN_ENDCAP.

Referenced by produce(), and startingNewLoop().

2283  {
2284 
2285  BBZN=0;
2286  EBZN=0;
2287  EEZN=0;
2288  BBZN_gg=0;
2289  EBZN_gg=0;
2290  EEZN_gg=0;
2291 
2292  BBZN_tt=0;
2293  EBZN_tt=0;
2294  EEZN_tt=0;
2295 
2296  BBZN_t0=0;
2297  EBZN_t0=0;
2298  EEZN_t0=0;
2299 
2302 
2311 
2312 
2315 
2316  return;
2317 
2318 }
int BARREL_ELECTRONS_AFTER_BORDER_CUT
int GOLDEN_ELECTRONS_IN_ENDCAP
int GOLDEN_ELECTRONS_IN_BARREL
int SILVER_ELECTRONS_IN_BARREL
int TOTAL_ELECTRONS_IN_ENDCAP
int BARREL_ELECTRONS_BEFORE_BORDER_CUT
int SHOWER_ELECTRONS_IN_ENDCAP
int SILVER_ELECTRONS_IN_ENDCAP
int CRACK_ELECTRONS_IN_ENDCAP
int CRACK_ELECTRONS_IN_BARREL
int SHOWER_ELECTRONS_IN_BARREL
int TOTAL_ELECTRONS_IN_BARREL
int ZeeCalibration::ringNumberCorrector ( int  k)
private

Definition at line 2117 of file ZeeCalibration.cc.

References calibMode_, and diffTreeTool::index.

Referenced by computeCoefficientDistanceAtIteration(), endOfJob(), endOfLoop(), and produce().

2118 {
2119 
2120  int index=-999;
2121 
2122  if( calibMode_ == "RING"){
2123  if(k>=0 && k<=84)index = k - 85;
2124 
2125  if(k>=85 && k<=169)index = k - 84;
2126 
2127  if(k>=170 && k<=208)index = - k + 84;
2128 
2129  if(k>=209 && k<=247)index = k - 123;
2130 
2131  }
2132 
2133  else if( calibMode_ == "MODULE"){
2134 
2135  if(k>=0 && k<=71)index = k - 72;
2136 
2137  if(k>=72 && k<=143)index = k - 71;
2138 
2139  }
2140  return index;
2141 
2142 }
std::string calibMode_
int k[5][pyjets_maxn]
void ZeeCalibration::startingNewLoop ( unsigned int  iLoop)
virtual

Called at beginning of loop.

Implements edm::EDLooperBase.

Definition at line 1491 of file ZeeCalibration.cc.

References gather_cfg::cout, resetHistograms(), ZIterativeAlgorithmWithFit::resetIteration(), resetVariables(), and theAlgorithm_.

Referenced by produce().

1492 {
1493 
1494 std::cout<< "[ZeeCalibration] Starting loop number " << iLoop<<std::endl;
1495 
1497 
1498  resetVariables();
1499 
1500  resetHistograms();
1501 
1502 #ifdef DEBUG
1503  std::cout<< "[ZeeCalibration] exiting from startingNewLoop" << std::endl;
1504 #endif
1505 
1506 }
ZIterativeAlgorithmWithFit * theAlgorithm_
bool ZeeCalibration::xtalIsOnModuleBorder ( EBDetId  myEBDetId)
private

Definition at line 2229 of file ZeeCalibration.cc.

References funct::abs(), mps_fire::i, EBDetId::ieta(), and EBDetId::iphi().

Referenced by duringLoop(), and produce().

2229  {
2230 
2231  bool myBool(false);
2232 
2233  short ieta = myEBDetId.ieta();
2234  short iphi = myEBDetId.iphi();
2235 
2236  // std::cout<<"[xtalIsOnModuleBorder] ieta: "<<ieta<<" iphi "<<iphi<<std::endl;
2237 
2238  myBool = ( abs( ieta ) == 1 || abs( ieta ) == 25
2239  || abs( ieta ) ==26 || abs( ieta ) == 45
2240  || abs( ieta ) ==46 || abs( ieta ) == 65
2241  || abs( ieta ) ==66 || abs( ieta ) == 85 );
2242 
2243  for(int i = 0; i < 19; i++){
2244 
2245  if(iphi == ( 20*i + 1 ) || iphi == 20*i )
2246  myBool = true;
2247 
2248  }
2249 
2250  return myBool;
2251 }
int iphi() const
get the crystal iphi
Definition: EBDetId.h:53
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int ieta() const
get the crystal ieta
Definition: EBDetId.h:51

Member Data Documentation

char ZeeCalibration::aHLTNames[6000]
private

Definition at line 366 of file ZeeCalibration.h.

bool ZeeCalibration::aHLTResults[200]
private

Definition at line 369 of file ZeeCalibration.h.

Referenced by duringLoop().

TString ZeeCalibration::aNames[200]
private

Definition at line 368 of file ZeeCalibration.h.

char ZeeCalibration::aTriggerNames[200][30]
private

Definition at line 362 of file ZeeCalibration.h.

bool ZeeCalibration::aTriggerResults[200]
private

Definition at line 363 of file ZeeCalibration.h.

int ZeeCalibration::BARREL_ELECTRONS_AFTER_BORDER_CUT
private

Definition at line 328 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

int ZeeCalibration::BARREL_ELECTRONS_BEFORE_BORDER_CUT
private

Definition at line 327 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

std::string ZeeCalibration::barrelfile_
private

Definition at line 176 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

Int_t ZeeCalibration::BBZN
private

Definition at line 311 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

Int_t ZeeCalibration::BBZN_gg
private

Definition at line 311 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

Int_t ZeeCalibration::BBZN_t0
private

Definition at line 311 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

Int_t ZeeCalibration::BBZN_tt
private

Definition at line 311 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

float ZeeCalibration::calibCoeff[250]
private

Definition at line 190 of file ZeeCalibration.h.

Referenced by duringLoop(), endOfJob(), and endOfLoop().

float ZeeCalibration::calibCoeffError[250]
private

Definition at line 192 of file ZeeCalibration.h.

Referenced by duringLoop(), endOfJob(), and endOfLoop().

std::string ZeeCalibration::calibMode_
private
double ZeeCalibration::coefficientDistanceAtIteration[50]
private

Definition at line 325 of file ZeeCalibration.h.

Referenced by endOfJob(), endOfLoop(), and ZeeCalibration().

int ZeeCalibration::CRACK_ELECTRONS_IN_BARREL
private

Definition at line 342 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

int ZeeCalibration::CRACK_ELECTRONS_IN_ENDCAP
private

Definition at line 343 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

Int_t ZeeCalibration::EBZN
private

Definition at line 311 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

Int_t ZeeCalibration::EBZN_gg
private

Definition at line 311 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

Int_t ZeeCalibration::EBZN_t0
private

Definition at line 311 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

Int_t ZeeCalibration::EBZN_tt
private

Definition at line 311 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

Int_t ZeeCalibration::EEZN
private

Definition at line 311 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

Int_t ZeeCalibration::EEZN_gg
private

Definition at line 311 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

Int_t ZeeCalibration::EEZN_t0
private

Definition at line 311 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

Int_t ZeeCalibration::EEZN_tt
private

Definition at line 311 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

std::string ZeeCalibration::electronCollection_
private

Definition at line 164 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

std::string ZeeCalibration::electronProducer_
private

Definition at line 163 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

unsigned int ZeeCalibration::electronSelection_
private

Definition at line 320 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

std::string ZeeCalibration::endcapfile_
private

Definition at line 177 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

std::string ZeeCalibration::erechitCollection_
private

Definition at line 153 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

std::string ZeeCalibration::erechitProducer_
private

Definition at line 152 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

unsigned int ZeeCalibration::etaBins_
private

Definition at line 168 of file ZeeCalibration.h.

Referenced by ZeeCalibration().

double ZeeCalibration::etaMax_
private

Definition at line 173 of file ZeeCalibration.h.

Referenced by ZeeCalibration().

double ZeeCalibration::etaMin_
private

Definition at line 171 of file ZeeCalibration.h.

Referenced by ZeeCalibration().

unsigned int ZeeCalibration::etBins_
private

Definition at line 169 of file ZeeCalibration.h.

Referenced by ZeeCalibration().

double ZeeCalibration::etMax_
private

Definition at line 174 of file ZeeCalibration.h.

Referenced by ZeeCalibration().

double ZeeCalibration::etMin_
private

Definition at line 172 of file ZeeCalibration.h.

Referenced by ZeeCalibration().

int ZeeCalibration::GOLDEN_ELECTRONS_IN_BARREL
private

Definition at line 333 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

int ZeeCalibration::GOLDEN_ELECTRONS_IN_ENDCAP
private

Definition at line 334 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

TH1F* ZeeCalibration::h1_borderElectronClassification_
private

Definition at line 308 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), and endOfJob().

TH1F* ZeeCalibration::h1_eleClasses_
private

Definition at line 220 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_electronCosTheta_SC_
private

Definition at line 305 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_electronCosTheta_SC_TK_
private

Definition at line 306 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_electronCosTheta_TK_
private

Definition at line 304 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_eleERecoOverEtrue_
private

Definition at line 242 of file ZeeCalibration.h.

TH1F* ZeeCalibration::h1_eleEtaResol_
private

Definition at line 244 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), fillEleInfo(), and resetHistograms().

TH1F* ZeeCalibration::h1_elePhiResol_
private

Definition at line 245 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), fillEleInfo(), and resetHistograms().

TH1F* ZeeCalibration::h1_eventsAfterBorderSelection_
private

Definition at line 212 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_eventsAfterEWKSelection_
private

Definition at line 209 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_eventsBeforeBorderSelection_
private

Definition at line 211 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_eventsBeforeEWKSelection_
private

Definition at line 208 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_mc_
private

Definition at line 265 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfJob().

TH1F* ZeeCalibration::h1_mcEB_
private

Definition at line 274 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfJob().

TH1F* ZeeCalibration::h1_mcEBParz_[25]
private

Definition at line 275 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfLoop().

TH1F* ZeeCalibration::h1_mcEE_
private

Definition at line 278 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfJob().

TH1F* ZeeCalibration::h1_mcEEParz_[25]
private

Definition at line 279 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfLoop().

TH1F* ZeeCalibration::h1_mcParz_[25]
private

Definition at line 266 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfLoop().

TH1F* ZeeCalibration::h1_nEleReco_
private

Definition at line 219 of file ZeeCalibration.h.

Referenced by bookHistograms().

TH1F* ZeeCalibration::h1_occupancy_
private

Definition at line 300 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_occupancyBarrel_
private

Definition at line 301 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_occupancyEndcap_
private

Definition at line 302 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_occupancyVsEta_
private

Definition at line 295 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_occupancyVsEtaCrack_
private

Definition at line 298 of file ZeeCalibration.h.

TH1F* ZeeCalibration::h1_occupancyVsEtaGold_
private

Definition at line 296 of file ZeeCalibration.h.

TH1F* ZeeCalibration::h1_occupancyVsEtaShower_
private

Definition at line 299 of file ZeeCalibration.h.

TH1F* ZeeCalibration::h1_occupancyVsEtaSilver_
private

Definition at line 297 of file ZeeCalibration.h.

TH1F* ZeeCalibration::h1_preshowerOverSC_
private

Definition at line 227 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), fillEleInfo(), and resetHistograms().

TH1F* ZeeCalibration::h1_reco_ZMass_
private

Definition at line 232 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), endOfJob(), endOfLoop(), and resetHistograms().

TH1F* ZeeCalibration::h1_reco_ZMassBad_
private

Definition at line 238 of file ZeeCalibration.h.

TH1F* ZeeCalibration::h1_reco_ZMassCorr_
private

Definition at line 234 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_reco_ZMassCorrBB_
private

Definition at line 235 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_reco_ZMassCorrEE_
private

Definition at line 236 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_reco_ZMassGood_
private

Definition at line 237 of file ZeeCalibration.h.

TH1F* ZeeCalibration::h1_RMin_
private

Definition at line 240 of file ZeeCalibration.h.

TH1F* ZeeCalibration::h1_RMinZ_
private

Definition at line 241 of file ZeeCalibration.h.

TH1F* ZeeCalibration::h1_seedOverSC_
private

Definition at line 226 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), fillEleInfo(), and resetHistograms().

TH1F* ZeeCalibration::h1_weightSumMeanBarrel_
private

Definition at line 292 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfJob().

TH1F* ZeeCalibration::h1_weightSumMeanEndcap_
private

Definition at line 293 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfJob().

TH1F* ZeeCalibration::h1_ZCandMult_
private

Definition at line 239 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_zEtaResol_
private

Definition at line 230 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfJob().

TH1F* ZeeCalibration::h1_zMassResol_
private

Definition at line 229 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), endOfJob(), and resetHistograms().

TH1F* ZeeCalibration::h1_zPhiResol_
private

Definition at line 231 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfJob().

TH2F* ZeeCalibration::h2_chi2_[25]
private

Definition at line 281 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and endOfLoop().

TH2F* ZeeCalibration::h2_coeffVsEta_
private

Definition at line 256 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfJob().

TH2F* ZeeCalibration::h2_coeffVsEtaGrouped_
private

Definition at line 257 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfJob().

TH2F* ZeeCalibration::h2_coeffVsLoop_
private

Definition at line 261 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfJob().

TH2F* ZeeCalibration::h2_fEtaBarrelBad_
private

Definition at line 216 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and resetHistograms().

TH2F* ZeeCalibration::h2_fEtaBarrelGood_
private

Definition at line 215 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and resetHistograms().

TH2F* ZeeCalibration::h2_fEtaEndcapBad_
private

Definition at line 218 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and resetHistograms().

TH2F* ZeeCalibration::h2_fEtaEndcapGood_
private

Definition at line 217 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and resetHistograms().

TH2F* ZeeCalibration::h2_iterations_[25]
private

Definition at line 282 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and endOfLoop().

TH2F* ZeeCalibration::h2_miscalRecal_
private

Definition at line 263 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfJob().

TH2F* ZeeCalibration::h2_miscalRecalEB_
private

Definition at line 272 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfJob().

TH2F* ZeeCalibration::h2_miscalRecalEE_
private

Definition at line 276 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfJob().

TH2F* ZeeCalibration::h2_residualSigma_
private

Definition at line 271 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and endOfLoop().

TH2F* ZeeCalibration::h2_xtalMiscalibCoeffBarrel_
private

Definition at line 288 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), and endOfJob().

TH2F* ZeeCalibration::h2_xtalMiscalibCoeffEndcapMinus_
private

Definition at line 289 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), and endOfJob().

TH2F* ZeeCalibration::h2_xtalMiscalibCoeffEndcapPlus_
private

Definition at line 290 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), and endOfJob().

TH2F* ZeeCalibration::h2_xtalRecalibCoeffBarrel_[25]
private

Definition at line 284 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfLoop().

TH2F* ZeeCalibration::h2_xtalRecalibCoeffEndcapMinus_[25]
private

Definition at line 285 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfLoop().

TH2F* ZeeCalibration::h2_xtalRecalibCoeffEndcapPlus_[25]
private

Definition at line 286 of file ZeeCalibration.h.

Referenced by bookHistograms(), and endOfLoop().

TH2F* ZeeCalibration::h2_zMassDiffVsLoop_
private

Definition at line 259 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and endOfLoop().

TH2F* ZeeCalibration::h2_zMassVsLoop_
private

Definition at line 258 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and endOfLoop().

TH2F* ZeeCalibration::h2_zWidthVsLoop_
private

Definition at line 260 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and endOfLoop().

TH1F* ZeeCalibration::h_eleEffEta[2]
private

Definition at line 222 of file ZeeCalibration.h.

TH1F* ZeeCalibration::h_eleEffEta_[2]
private

Definition at line 247 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), fillEleInfo(), and resetHistograms().

TH1F* ZeeCalibration::h_eleEffPhi[2]
private

Definition at line 223 of file ZeeCalibration.h.

TH1F* ZeeCalibration::h_eleEffPhi_[2]
private

Definition at line 248 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), fillEleInfo(), and resetHistograms().

TH1F* ZeeCalibration::h_eleEffPt[2]
private

Definition at line 224 of file ZeeCalibration.h.

TH1F* ZeeCalibration::h_eleEffPt_[2]
private

Definition at line 249 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), fillEleInfo(), and resetHistograms().

TH1F* ZeeCalibration::h_ESCcorrEtrue_[25]
private

Definition at line 253 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and fillEleInfo().

TH2F* ZeeCalibration::h_ESCcorrEtrueVsEta_[25]
private

Definition at line 254 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and fillEleInfo().

TH1F* ZeeCalibration::h_ESCEtrue_[25]
private

Definition at line 250 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and fillEleInfo().

TH2F* ZeeCalibration::h_ESCEtrueVsEta_[25]
private

Definition at line 251 of file ZeeCalibration.h.

Referenced by bookHistograms(), endOfJob(), and fillEleInfo().

std::vector<unsigned int> ZeeCalibration::hlAccept_
private

Definition at line 355 of file ZeeCalibration.h.

std::vector<unsigned int> ZeeCalibration::hlErrors_
private

Definition at line 356 of file ZeeCalibration.h.

std::vector<std::string> ZeeCalibration::hlNames_
private

Definition at line 358 of file ZeeCalibration.h.

Int_t ZeeCalibration::hltCount
private

Definition at line 365 of file ZeeCalibration.h.

Referenced by duringLoop().

Int_t ZeeCalibration::hltNamesLen
private

Definition at line 367 of file ZeeCalibration.h.

edm::InputTag ZeeCalibration::hlTriggerResults_
private

Definition at line 346 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

std::vector<unsigned int> ZeeCalibration::hlWasRun_
private

Definition at line 354 of file ZeeCalibration.h.

std::shared_ptr<EcalIntercalibConstants> ZeeCalibration::ical
private

Definition at line 195 of file ZeeCalibration.h.

Referenced by duringLoop(), endOfJob(), endOfLoop(), and produceEcalIntercalibConstants().

bool ZeeCalibration::init_
private

Definition at line 359 of file ZeeCalibration.h.

Referenced by duringLoop().

float ZeeCalibration::initCalibCoeff[250]
private

Definition at line 193 of file ZeeCalibration.h.

Referenced by duringLoop(), endOfJob(), and endOfLoop().

bool ZeeCalibration::isfirstcall_
private

Definition at line 371 of file ZeeCalibration.h.

Referenced by beginOfJob(), and duringLoop().

double ZeeCalibration::loopArray[50]
private

Definition at line 322 of file ZeeCalibration.h.

Referenced by endOfJob(), endOfLoop(), and ZeeCalibration().

int ZeeCalibration::loopFlag_
private

Definition at line 188 of file ZeeCalibration.h.

Referenced by duringLoop(), endOfLoop(), and fillEleInfo().

double ZeeCalibration::mass
private
float ZeeCalibration::mass4tree
private

Definition at line 183 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

float ZeeCalibration::massDiff4tree
private

Definition at line 184 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

double ZeeCalibration::maxInvMassCut_
private

Definition at line 180 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

std::string ZeeCalibration::mcProducer_
private

Definition at line 160 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

Int_t ZeeCalibration::MCZBB
private

Definition at line 312 of file ZeeCalibration.h.

Referenced by duringLoop(), and printStatistics().

Int_t ZeeCalibration::MCZEB
private

Definition at line 312 of file ZeeCalibration.h.

Referenced by duringLoop(), and printStatistics().

Int_t ZeeCalibration::MCZEE
private

Definition at line 312 of file ZeeCalibration.h.

Referenced by duringLoop(), and printStatistics().

double ZeeCalibration::minInvMassCut_
private

Definition at line 179 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

TTree* ZeeCalibration::myTree
private

Definition at line 146 of file ZeeCalibration.h.

Referenced by duringLoop(), endOfJob(), and ZeeCalibration().

ZeePlots* ZeeCalibration::myZeePlots_
private

Definition at line 199 of file ZeeCalibration.h.

Referenced by bookHistograms(), duringLoop(), and endOfJob().

ZeeRescaleFactorPlots* ZeeCalibration::myZeeRescaleFactorPlots_
private

Definition at line 200 of file ZeeCalibration.h.

unsigned int ZeeCalibration::nAccept_
private

Definition at line 351 of file ZeeCalibration.h.

unsigned int ZeeCalibration::nErrors_
private

Definition at line 352 of file ZeeCalibration.h.

unsigned int ZeeCalibration::nEvents_
private

Definition at line 348 of file ZeeCalibration.h.

Int_t ZeeCalibration::NEVT
private

Definition at line 312 of file ZeeCalibration.h.

Referenced by duringLoop(), and printStatistics().

float ZeeCalibration::NewCalibCoeff[250]
private

Definition at line 191 of file ZeeCalibration.h.

Referenced by endOfLoop().

unsigned int ZeeCalibration::nWasRun_
private

Definition at line 350 of file ZeeCalibration.h.

TFile* ZeeCalibration::outputFile_
private

Definition at line 314 of file ZeeCalibration.h.

Referenced by duringLoop(), endOfJob(), endOfLoop(), and ZeeCalibration().

std::string ZeeCalibration::outputFileName_
private

Definition at line 148 of file ZeeCalibration.h.

Referenced by ZeeCalibration().

int ZeeCalibration::read_events
private

Definition at line 186 of file ZeeCalibration.h.

Referenced by duringLoop().

std::string ZeeCalibration::RecalibBarrelHits_
private

Definition at line 166 of file ZeeCalibration.h.

std::string ZeeCalibration::rechitCollection_
private

Definition at line 151 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

std::string ZeeCalibration::rechitProducer_
private

Definition at line 150 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

std::string ZeeCalibration::scCollection_
private

Definition at line 155 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

std::string ZeeCalibration::scIslandCollection_
private

Definition at line 158 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

std::string ZeeCalibration::scIslandProducer_
private

Definition at line 157 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

std::string ZeeCalibration::scProducer_
private

Definition at line 154 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().

int ZeeCalibration::SHOWER_ELECTRONS_IN_BARREL
private

Definition at line 339 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

int ZeeCalibration::SHOWER_ELECTRONS_IN_ENDCAP
private

Definition at line 340 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

double ZeeCalibration::sigmaArray[50]
private

Definition at line 323 of file ZeeCalibration.h.

Referenced by endOfJob(), endOfLoop(), and ZeeCalibration().

double ZeeCalibration::sigmaErrorArray[50]
private

Definition at line 324 of file ZeeCalibration.h.

Referenced by endOfJob(), endOfLoop(), and ZeeCalibration().

int ZeeCalibration::SILVER_ELECTRONS_IN_BARREL
private

Definition at line 336 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

int ZeeCalibration::SILVER_ELECTRONS_IN_ENDCAP
private

Definition at line 337 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

ZIterativeAlgorithmWithFit* ZeeCalibration::theAlgorithm_
private

Definition at line 197 of file ZeeCalibration.h.

Referenced by duringLoop(), endOfJob(), endOfLoop(), startingNewLoop(), and ZeeCalibration().

unsigned int ZeeCalibration::theMaxLoops
private

Definition at line 316 of file ZeeCalibration.h.

Referenced by endOfJob(), endOfLoop(), and ZeeCalibration().

edm::ParameterSet ZeeCalibration::theParameterSet
private

Definition at line 204 of file ZeeCalibration.h.

Referenced by ZeeCalibration().

int ZeeCalibration::TOTAL_ELECTRONS_IN_BARREL
private

Definition at line 330 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

int ZeeCalibration::TOTAL_ELECTRONS_IN_ENDCAP
private

Definition at line 331 of file ZeeCalibration.h.

Referenced by duringLoop(), printStatistics(), and resetVariables().

Int_t ZeeCalibration::triggerCount
private

Definition at line 361 of file ZeeCalibration.h.

bool ZeeCalibration::wantEtaCorrection_
private

Definition at line 318 of file ZeeCalibration.h.

Referenced by duringLoop(), and ZeeCalibration().