CMS 3D CMS Logo

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

#include <Pi0FixedMassWindowCalibration.h>

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

Public Member Functions

void beginOfJob () override
 Called at beginning of job. More...
 
Status duringLoop (const edm::Event &, const edm::EventSetup &) override
 Called at each event. More...
 
void endOfJob () override
 Called at end of job. More...
 
Status endOfLoop (const edm::EventSetup &, unsigned int iLoop) override
 Called at end of loop. More...
 
 Pi0FixedMassWindowCalibration (const edm::ParameterSet &iConfig)
 Constructor. More...
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 Dummy implementation (job done in duringLoop) More...
 
void startingNewLoop (unsigned int iLoop) override
 Called at beginning of loop. More...
 
 ~Pi0FixedMassWindowCalibration () override
 Destructor. More...
 
- Public Member Functions inherited from edm::ESProducerLooper
 ESProducerLooper ()
 
std::set< eventsetup::EventSetupRecordKeymodifyingRecords () const override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- 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
 
 ~EDLooper () override
 
- 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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Attributes

std::vector< DetIdbarrelCells
 
std::string barrelClusterCollection_
 
std::string barrelClusterShapeAssociation_
 
std::string barrelHitCollection_
 
std::string barrelHitProducer_
 
std::string barrelHits_
 
std::string clustershapecollectionEB_
 
std::string ecalHitsProducer_
 
const EcalRecHitCollectionecalRecHitBarrelCollection
 
bool isfirstcall_
 
IslandClusterAlgoisland_p
 
double mwxtals [85][360][2]
 
int nevent
 
double newCalibs_barl [85][360][2]
 
double oldCalibs_barl [85][360][2]
 
PositionCalc posCalculator_
 
const EcalRecHitCollectionrecalibEcalRecHitCollection
 
std::map< DetId, EcalRecHit > * recHitsEB_map
 
double selePi0DetaBelt_
 
double selePi0DRBelt_
 
double selePi0EtBeltIsoRatioMax_
 
double selePi0MinvMeanFixed_
 
double selePi0MinvSigmaFixed_
 
double selePi0PtGammaOneMin_
 
double selePi0PtGammaTwoMin_
 
double selePi0PtPi0Min_
 
double selePi0S4S9GammaOneMin_
 
double selePi0S4S9GammaTwoMin_
 
double selePi0S9S25GammaOneMin_
 
double selePi0S9S25GammaTwoMin_
 
ClusterShapeAlgo shapeAlgo_
 
TFile * theFile
 
unsigned int theMaxLoops
 
edm::ParameterSet theParameterSet
 
IslandClusterAlgo::VerbosityLevel verbosity
 
double wxtals [85][360][2]
 

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 }
 
- Protected Member Functions inherited from edm::ESProducerLooper
void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string()) override
 
void setIntervalFor (const eventsetup::EventSetupRecordKey &iKey, const IOVSyncValue &iTime, ValidityInterval &oInterval) override
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollector setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 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

Definition at line 59 of file Pi0FixedMassWindowCalibration.h.

Constructor & Destructor Documentation

Pi0FixedMassWindowCalibration::Pi0FixedMassWindowCalibration ( const edm::ParameterSet iConfig)

Constructor.

Definition at line 35 of file Pi0FixedMassWindowCalibration.cc.

References barrelClusterCollection_, barrelClusterShapeAssociation_, clustershapecollectionEB_, gather_cfg::cout, edm::ParameterSet::getParameter(), island_p, IslandClusterAlgo::pDEBUG, IslandClusterAlgo::pERROR, IslandClusterAlgo::pINFO, cleanAndMergeSuperClusters_cfi::posCalcParameters, posCalculator_, IslandClusterAlgo::pWARNING, selePi0DetaBelt_, selePi0DRBelt_, selePi0EtBeltIsoRatioMax_, selePi0MinvMeanFixed_, selePi0MinvSigmaFixed_, selePi0PtGammaOneMin_, selePi0PtGammaTwoMin_, selePi0PtPi0Min_, selePi0S4S9GammaOneMin_, selePi0S4S9GammaTwoMin_, selePi0S9S25GammaOneMin_, selePi0S9S25GammaTwoMin_, shapeAlgo_, AlCaHLTBitMon_QueryRunRegistry::string, theParameterSet, and verbosity.

35  :
36  theMaxLoops( iConfig.getUntrackedParameter<unsigned int>("maxLoops",0) ),
37  ecalHitsProducer_( iConfig.getParameter< std::string > ("ecalRecHitsProducer") ),
38  barrelHits_( iConfig.getParameter< std::string > ("barrelHitCollection") )
39 {
40 
41  std::cout << "[Pi0FixedMassWindowCalibration] Constructor "<<std::endl;
42  // The verbosity level
43  std::string verbosityString = iConfig.getParameter<std::string>("VerbosityLevel");
44  if (verbosityString == "DEBUG") verbosity = IslandClusterAlgo::pDEBUG;
45  else if (verbosityString == "WARNING") verbosity = IslandClusterAlgo::pWARNING;
46  else if (verbosityString == "INFO") verbosity = IslandClusterAlgo::pINFO;
48 
49  // The names of the produced cluster collections
50  barrelClusterCollection_ = iConfig.getParameter<std::string>("barrelClusterCollection");
51 
52  // Island algorithm parameters
53  double barrelSeedThreshold = iConfig.getParameter<double>("IslandBarrelSeedThr");
54  double endcapSeedThreshold = iConfig.getParameter<double>("IslandEndcapSeedThr");
55 
56 
57  // Selection algorithm parameters
58  selePi0PtGammaOneMin_ = iConfig.getParameter<double>("selePi0PtGammaOneMin");
59  selePi0PtGammaTwoMin_ = iConfig.getParameter<double>("selePi0PtGammaTwoMin");
60 
61  selePi0DRBelt_ = iConfig.getParameter<double>("selePi0DRBelt");
62  selePi0DetaBelt_ = iConfig.getParameter<double>("selePi0DetaBelt");
63 
64  selePi0PtPi0Min_ = iConfig.getParameter<double>("selePi0PtPi0Min");
65 
66  selePi0S4S9GammaOneMin_ = iConfig.getParameter<double>("selePi0S4S9GammaOneMin");
67  selePi0S4S9GammaTwoMin_ = iConfig.getParameter<double>("selePi0S4S9GammaTwoMin");
68  selePi0S9S25GammaOneMin_ = iConfig.getParameter<double>("selePi0S9S25GammaOneMin");
69  selePi0S9S25GammaTwoMin_ = iConfig.getParameter<double>("selePi0S9S25GammaTwoMin");
70 
71  selePi0EtBeltIsoRatioMax_ = iConfig.getParameter<double>("selePi0EtBeltIsoRatioMax");
72 
73  selePi0MinvMeanFixed_ = iConfig.getParameter<double>("selePi0MinvMeanFixed");
74  selePi0MinvSigmaFixed_ = iConfig.getParameter<double>("selePi0MinvSigmaFixed");
75 
76  // Parameters for the position calculation:
78  iConfig.getParameter<edm::ParameterSet>("posCalcParameters");
79  posCalculator_ = PositionCalc(posCalcParameters);
80  shapeAlgo_ = ClusterShapeAlgo(posCalcParameters);
81  clustershapecollectionEB_ = iConfig.getParameter<std::string>("clustershapecollectionEB");
82 
83  //AssociationMap
84  barrelClusterShapeAssociation_ = iConfig.getParameter<std::string>("barrelShapeAssociation");
85 
86  const std::vector<std::string> seedflagnamesEB = iConfig.getParameter<std::vector<std::string> >("SeedRecHitFlagToBeExcludedEB");
87  const std::vector<int> seedflagsexclEB = StringToEnumValue<EcalRecHit::Flags>(seedflagnamesEB);
88 
89  const std::vector<std::string> seedflagnamesEE = iConfig.getParameter<std::vector<std::string> >("SeedRecHitFlagToBeExcludedEE");
90  const std::vector<int> seedflagsexclEE = StringToEnumValue<EcalRecHit::Flags>(seedflagnamesEE);
91 
92  const std::vector<std::string> flagnamesEB = iConfig.getParameter<std::vector<std::string> >("RecHitFlagToBeExcludedEB");
93  const std::vector<int> flagsexclEB = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
94 
95  const std::vector<std::string> flagnamesEE = iConfig.getParameter<std::vector<std::string> >("RecHitFlagToBeExcludedEE");
96  const std::vector<int> flagsexclEE = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
97 
98  island_p = new IslandClusterAlgo(barrelSeedThreshold, endcapSeedThreshold, posCalculator_, seedflagsexclEB, seedflagsexclEE, flagsexclEB, flagsexclEE, verbosity);
99 
100  theParameterSet=iConfig;
101 
102 
103 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
IslandClusterAlgo::VerbosityLevel verbosity
Pi0FixedMassWindowCalibration::~Pi0FixedMassWindowCalibration ( )
override

Destructor.

Definition at line 109 of file Pi0FixedMassWindowCalibration.cc.

References island_p.

110 {
111  delete island_p;
112 }

Member Function Documentation

void Pi0FixedMassWindowCalibration::beginOfJob ( )
overridevirtual

Called at beginning of job.

Reimplemented from edm::EDLooperBase.

Definition at line 169 of file Pi0FixedMassWindowCalibration.cc.

References isfirstcall_.

Referenced by produce().

170 {
171 
172  //std::cout << "[Pi0FixedMassWindowCalibration] beginOfJob "<<std::endl;
173 
174  isfirstcall_=true;
175 
176 
177 
178 }
edm::EDLooper::Status Pi0FixedMassWindowCalibration::duringLoop ( const edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

Called at each event.

Implements edm::EDLooper.

Definition at line 280 of file Pi0FixedMassWindowCalibration.cc.

References funct::abs(), IslandClusterAlgo::barrel, barrelCells, barrelHits_, edm::SortedCollection< T, SORT >::begin(), ClusterShapeAlgo::Calculate(), calib, MessageLogger_cfi::cerr, funct::cos(), gather_cfg::cout, DetId::Ecal, EcalBarrel, ecalHitsProducer_, EcalPreshower, ecalRecHitBarrelCollection, EcalCondObjectContainer< T >::end(), edm::SortedCollection< T, SORT >::end(), cppFunctionSkipper::exception, JetChargeProducer_cfi::exp, EcalCondObjectContainer< T >::find(), edm::EventSetup::get(), EcalCondObjectContainer< T >::getMap(), CaloGeometry::getSubdetectorGeometry(), CaloGeometry::getValidDetIds(), hfClusterShapes_cfi::hits, mps_fire::i, EBDetId::ieta(), createfilelist::int, EBDetId::iphi(), isfirstcall_, island_p, gen::k, edm::EDLooperBase::kContinue, GetRecoTauVFromDQM_MC_cff::kk, cmsBatch::log, IslandClusterAlgo::makeClusters(), mwxtals, nevent, newCalibs_barl, oldCalibs_barl, edm::Handle< T >::product(), edm::ESHandle< T >::product(), DetId::rawId(), recalibEcalRecHitCollection, recHitsEB_map, selePi0DetaBelt_, selePi0DRBelt_, selePi0EtBeltIsoRatioMax_, selePi0MinvMeanFixed_, selePi0MinvSigmaFixed_, selePi0PtGammaOneMin_, selePi0PtPi0Min_, selePi0S4S9GammaOneMin_, selePi0S4S9GammaTwoMin_, selePi0S9S25GammaOneMin_, selePi0S9S25GammaTwoMin_, shapeAlgo_, Validation_hcalonly_cfi::sign, funct::sin(), EcalCondObjectContainer< T >::size(), edm::SortedCollection< T, SORT >::size(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, funct::tan(), wxtals, and EBDetId::zside().

Referenced by produce().

282 {
283  using namespace edm;
284  using namespace std;
285 
286  // this chunk used to belong to beginJob(isetup). Moved here
287  // with the beginJob without arguments migration
288 
289  if (isfirstcall_){
290  // initialize arrays
291 
292  for (int sign=0; sign<2; sign++) {
293  for (int ieta=0; ieta<85; ieta++) {
294  for (int iphi=0; iphi<360; iphi++) {
295  oldCalibs_barl[ieta][iphi][sign]=0.;
296  newCalibs_barl[ieta][iphi][sign]=0.;
297  wxtals[ieta][iphi][sign]=0.;
298  mwxtals[ieta][iphi][sign]=0.;
299  }
300  }
301  }
302 
303  // get initial constants out of DB
304 
307 
308  try {
309  setup.get<EcalIntercalibConstantsRcd>().get(pIcal);
310  std::cout << "Taken EcalIntercalibConstants" << std::endl;
311  imap = pIcal.product()->getMap();
312  std::cout << "imap.size() = " << imap.size() << std::endl;
313  } catch ( std::exception& ex ) {
314  std::cerr << "Error! can't get EcalIntercalibConstants " << std::endl;
315  }
316 
317  // get the ecal geometry:
318  edm::ESHandle<CaloGeometry> geoHandle;
319  setup.get<CaloGeometryRecord>().get(geoHandle);
320  const CaloGeometry& geometry = *geoHandle;
321  //const CaloSubdetectorGeometry *barrelGeometry = geometry.getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
322 
323  // loop over all barrel crystals
325  std::vector<DetId>::const_iterator barrelIt;
326  for (barrelIt=barrelCells.begin(); barrelIt!=barrelCells.end(); barrelIt++) {
327  EBDetId eb(*barrelIt);
328 
329  // get the initial calibration constants
330  EcalIntercalibConstantMap::const_iterator itcalib = imap.find(eb.rawId());
331  if ( itcalib == imap.end() ) {
332  // FIXME -- throw error
333  }
334  EcalIntercalibConstant calib = (*itcalib);
335  int sign = eb.zside()>0 ? 1 : 0;
336  oldCalibs_barl[abs(eb.ieta())-1][eb.iphi()-1][sign] = calib;
337  if (eb.iphi()==1) std::cout << "Read old constant for crystal "
338  << " (" << eb.ieta() << "," << eb.iphi()
339  << ") : " << calib << std::endl;
340 
341 
342 
343  }
344  isfirstcall_=false;
345  }
346 
347 
348 
349  nevent++;
350 
351  if ((nevent<100 && nevent%10==0)
352  ||(nevent<1000 && nevent%100==0)
353  ||(nevent<10000 && nevent%100==0)
354  ||(nevent<100000 && nevent%1000==0)
355  ||(nevent<10000000 && nevent%1000==0))
356  std::cout << "[Pi0FixedMassWindowCalibration] Events processed: "<<nevent<<std::endl;
357 
358  recHitsEB_map = new std::map<DetId, EcalRecHit>();
359 
361 
362  int nRecHitsEB=0;
363  Handle<EcalRecHitCollection> pEcalRecHitBarrelCollection;
364  event.getByLabel(ecalHitsProducer_, barrelHits_, pEcalRecHitBarrelCollection);
365  const EcalRecHitCollection* ecalRecHitBarrelCollection = pEcalRecHitBarrelCollection.product();
366  cout << " ECAL Barrel RecHits # "<< ecalRecHitBarrelCollection->size() <<endl;
367  for(EcalRecHitCollection::const_iterator aRecHitEB = ecalRecHitBarrelCollection->begin(); aRecHitEB != ecalRecHitBarrelCollection->end(); aRecHitEB++) {
368  //cout << " ECAL Barrel RecHit #,E,time,det,subdetid: "<<nRecHitsEB<<" "<<aRecHitEB->energy()<<" "<<aRecHitEB->time()<<" "<<aRecHitEB->detid().det()<<" "<<aRecHitEB->detid().subdetId()<<endl;
369 
370 
371  EBDetId ebrhdetid = aRecHitEB->detid();
372  //cout << " EBDETID: z,ieta,iphi "<<ebrhdetid.zside()<<" "<<ebrhdetid.ieta()<<" "<<ebrhdetid.iphi()<<endl;
373  //cout << " EBDETID: tower_ieta,tower_iphi "<<ebrhdetid.tower_ieta()<<" "<<ebrhdetid.tower_iphi()<<endl;
374  //cout << " EBDETID: iSM, ic "<<ebrhdetid.ism()<<" "<<ebrhdetid.ic()<<endl;
375 
376  int sign = ebrhdetid.zside()>0 ? 1 : 0;
377  EcalRecHit aHit(aRecHitEB->id(),aRecHitEB->energy()*oldCalibs_barl[abs(ebrhdetid.ieta())-1][ebrhdetid.iphi()-1][sign],aRecHitEB->time());
379 
380  nRecHitsEB++;
381 
382  }
383 
384  // cout<<" Recalib size: "<<recalibEcalRecHitCollection->size()<<endl;
385  int irecalib=0;
387  //cout << " [recalibrated] ECAL Barrel RecHit #,E,time,det,subdetid: "<<irecalib<<" "<<aRecHitEB->energy()<<" "<<aRecHitEB->time()<<" "<<aRecHitEB->detid().det()<<" "<<aRecHitEB->detid().subdetId()<<endl;
388 
389  // EBDetId ebrhdetid = aRecHitEB->detid();
390  //cout << " [recalibrated] EBDETID: z,ieta,iphi "<<ebrhdetid.zside()<<" "<<ebrhdetid.ieta()<<" "<<ebrhdetid.iphi()<<endl;
391  //cout << " [recalibrated] EBDETID: tower_ieta,tower_iphi "<<ebrhdetid.tower_ieta()<<" "<<ebrhdetid.tower_iphi()<<endl;
392  //cout << " [recalibrated] EBDETID: iSM, ic "<<ebrhdetid.ism()<<" "<<ebrhdetid.ic()<<endl;
393 
394  std::pair<DetId, EcalRecHit> map_entry(aRecHitEB->id(), *aRecHitEB);
395  recHitsEB_map->insert(map_entry);
396 
397 
398  irecalib++;
399 
400  }
401 
402 
403  // get the geometry and topology from the event setup:
404  edm::ESHandle<CaloGeometry> geoHandle;
405  setup.get<CaloGeometryRecord>().get(geoHandle);
406 
407  const CaloSubdetectorGeometry *geometry_p;
408  CaloSubdetectorTopology *topology_p;
409 
410  std::string clustershapetag;
411  geometry_p = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
412  topology_p = new EcalBarrelTopology(geoHandle);
413 
414  const CaloSubdetectorGeometry *geometryES_p;
415  geometryES_p = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalPreshower);
416 
417  /*
418  reco::BasicClusterCollection clusters;
419  clusters = island_p->makeClusters(ecalRecHitBarrelCollection,geometry_p,topology_p,geometryES_p,IslandClusterAlgo::barrel);
420 
421  //Create associated ClusterShape objects.
422  std::vector <reco::ClusterShape> ClusVec;
423  for (int erg=0;erg<int(clusters.size());++erg){
424  reco::ClusterShape TestShape = shapeAlgo_.Calculate(clusters[erg],ecalRecHitBarrelCollection,geometry_p,topology_p);
425  ClusVec.push_back(TestShape);
426  }
427 
428  //Put clustershapes in event, but retain a Handle on them.
429  std::unique_ptr<reco::ClusterShapeCollection> clustersshapes_p(new reco::ClusterShapeCollection);
430  clustersshapes_p->assign(ClusVec.begin(), ClusVec.end());
431 
432  cout<<"[Pi0Calibration] Basic Cluster collection size: "<<clusters.size()<<endl;
433  cout<<"[Pi0Calibration] Basic Cluster Shape Collection size: "<<clustersshapes_p->size()<<endl;
434 
435  int iClus=0;
436  for(reco::BasicClusterCollection::const_iterator aClus = clusters.begin(); aClus != clusters.end(); aClus++) {
437  cout<<" CLUSTER : #,NHits,e,et,eta,phi,e2x2,e3x3,e5x5: "<<iClus<<" "<<aClus->getHitsByDetId().size()<<" "<<aClus->energy()<<" "<<aClus->energy()*sin(aClus->position().theta())<<" "<<aClus->position().eta()<<" "<<aClus->position().phi()<<" "<<(*clustersshapes_p)[iClus].e2x2()<<" "<<(*clustersshapes_p)[iClus].e3x3()<<" "<<(*clustersshapes_p)[iClus].e5x5()<<endl;
438  iClus++;
439  }
440  */
441 
442  // recalibrated clusters
443  reco::BasicClusterCollection clusters_recalib;
444  clusters_recalib = island_p->makeClusters(recalibEcalRecHitCollection,geometry_p,topology_p,geometryES_p,IslandClusterAlgo::barrel);
445 
446  //Create associated ClusterShape objects.
447  std::vector <reco::ClusterShape> ClusVec_recalib;
448  for (int erg=0;erg<int(clusters_recalib.size());++erg){
449  reco::ClusterShape TestShape_recalib = shapeAlgo_.Calculate(clusters_recalib[erg],recalibEcalRecHitCollection,geometry_p,topology_p);
450  ClusVec_recalib.push_back(TestShape_recalib);
451  }
452 
453  //Put clustershapes in event, but retain a Handle on them.
454  std::unique_ptr<reco::ClusterShapeCollection> clustersshapes_p_recalib(new reco::ClusterShapeCollection);
455  clustersshapes_p_recalib->assign(ClusVec_recalib.begin(), ClusVec_recalib.end());
456 
457  cout<<"[Pi0FixedMassWindowCalibration][recalibration] Basic Cluster collection size: "<<clusters_recalib.size()<<endl;
458  cout<<"[Pi0FixedMassWindowCalibration][recalibration] Basic Cluster Shape Collection size: "<<clustersshapes_p_recalib->size()<<endl;
459 
460 
461  // pizero selection
462 
463  // Get ECAL Barrel Island Basic Clusters collection
464  // ECAL Barrel Island Basic Clusters
465  static const int MAXBCEB = 200;
466  static const int MAXBCEBRH = 200;
467  int nIslandBCEB;
468  float eIslandBCEB[MAXBCEB];
469  float etIslandBCEB[MAXBCEB];
470  float etaIslandBCEB[MAXBCEB];
471  float phiIslandBCEB[MAXBCEB];
472  float e2x2IslandBCEB[MAXBCEB];
473  float e3x3IslandBCEB[MAXBCEB];
474  float e5x5IslandBCEB[MAXBCEB];
475  // indexes to the RecHits assiciated with
476  // ECAL Barrel Island Basic Clusters
477  int nIslandBCEBRecHits[MAXBCEB];
478  // int indexIslandBCEBRecHits[MAXBCEB][MAXBCEBRH];
479  int ietaIslandBCEBRecHits[MAXBCEB][MAXBCEBRH];
480  int iphiIslandBCEBRecHits[MAXBCEB][MAXBCEBRH];
481  int zsideIslandBCEBRecHits[MAXBCEB][MAXBCEBRH];
482  float eIslandBCEBRecHits[MAXBCEB][MAXBCEBRH];
483 
484  nIslandBCEB=0;
485  for(int i=0; i<MAXBCEB; i++){
486  eIslandBCEB[i] = 0;
487  etIslandBCEB[i] = 0;
488  etaIslandBCEB[i] = 0;
489  phiIslandBCEB[i] = 0;
490  e2x2IslandBCEB[i] = 0;
491  e3x3IslandBCEB[i] = 0;
492  e5x5IslandBCEB[i] = 0;
493  nIslandBCEBRecHits[i] = 0;
494  for(int j=0;j<MAXBCEBRH;j++){
495  // indexIslandBCEBRecHits[i][j] = 0;
496  ietaIslandBCEBRecHits[i][j] = 0;
497  iphiIslandBCEBRecHits[i][j] = 0;
498  zsideIslandBCEBRecHits[i][j] = 0;
499  eIslandBCEBRecHits[i][j] = 0;
500  }
501  }
502 
503 
504  int iClus_recalib=0;
505  for(reco::BasicClusterCollection::const_iterator aClus = clusters_recalib.begin(); aClus != clusters_recalib.end(); aClus++) {
506  cout<<" CLUSTER [recalibration] : #,NHits,e,et,eta,phi,e2x2,e3x3,e5x5: "<<iClus_recalib<<" "<<aClus->size()<<" "<<aClus->energy()<<" "<<aClus->energy()*sin(aClus->position().theta())<<" "<<aClus->position().eta()<<" "<<aClus->position().phi()<<" "<<(*clustersshapes_p_recalib)[iClus_recalib].e2x2()<<" "<<(*clustersshapes_p_recalib)[iClus_recalib].e3x3()<<" "<<(*clustersshapes_p_recalib)[iClus_recalib].e5x5()<<endl;
507 
508  eIslandBCEB[nIslandBCEB] = aClus->energy();
509  etIslandBCEB[nIslandBCEB] = aClus->energy()*sin(aClus->position().theta());
510  etaIslandBCEB[nIslandBCEB] = aClus->position().eta();
511  phiIslandBCEB[nIslandBCEB] = aClus->position().phi();
512 
513  e2x2IslandBCEB[nIslandBCEB] = (*clustersshapes_p_recalib)[nIslandBCEB].e2x2();
514  e3x3IslandBCEB[nIslandBCEB] = (*clustersshapes_p_recalib)[nIslandBCEB].e3x3();
515  e5x5IslandBCEB[nIslandBCEB] = (*clustersshapes_p_recalib)[nIslandBCEB].e5x5();
516 
517  nIslandBCEBRecHits[nIslandBCEB] = aClus->size();
518 
519  std::vector<std::pair< DetId,float> > hits = aClus->hitsAndFractions();
520  std::vector<std::pair< DetId,float> >::iterator hit;
521  std::map<DetId, EcalRecHit>::iterator aHit;
522 
523  int irhcount=0;
524  for(hit = hits.begin(); hit != hits.end(); hit++)
525  {
526  // need to get hit by DetID in order to get energy
527  aHit = recHitsEB_map->find((*hit).first);
528  //cout << " RecHit #: "<<irhcount<<" from Basic Cluster with Energy: "<<aHit->second.energy()<<endl;
529 
530  EBDetId sel_rh = aHit->second.detid();
531  //cout << " RecHit: z,ieta,iphi "<<sel_rh.zside()<<" "<<sel_rh.ieta()<<" "<<sel_rh.iphi()<<endl;
532  //cout << " RecHit: tower_ieta,tower_iphi "<<sel_rh.tower_ieta()<<" "<<sel_rh.tower_iphi()<<endl;
533  //cout << " RecHit: iSM, ic "<<sel_rh.ism()<<" "<<sel_rh.ic()<<endl;
534 
535  ietaIslandBCEBRecHits[nIslandBCEB][irhcount] = sel_rh.ieta();
536  iphiIslandBCEBRecHits[nIslandBCEB][irhcount] = sel_rh.iphi();
537  zsideIslandBCEBRecHits[nIslandBCEB][irhcount] = sel_rh.zside();
538  eIslandBCEBRecHits[nIslandBCEB][irhcount] = aHit->second.energy();
539 
540  irhcount++;
541  }
542  nIslandBCEB++;
543  iClus_recalib++;
544 
545 
546  }
547 
548  // Selection, based on ECAL Barrel Basic Clusters
549 
550  if (nIslandBCEB > 1)
551  {
552  for(int i=0 ; i<nIslandBCEB ; i++)
553  {
554  for(int j=i+1 ; j<nIslandBCEB ; j++)
555  {
556 
557  if( etIslandBCEB[i]>selePi0PtGammaOneMin_ && etIslandBCEB[j]>selePi0PtGammaOneMin_)
558  {
559 
560  float theta_0 = 2. * atan(exp(-etaIslandBCEB[i]));
561  float theta_1 = 2. * atan(exp(-etaIslandBCEB[j]));
562 
563  float p0x = eIslandBCEB[i] * sin(theta_0) * cos(phiIslandBCEB[i]);
564  float p1x = eIslandBCEB[j] * sin(theta_1) * cos(phiIslandBCEB[j]);
565 
566  float p0y = eIslandBCEB[i] * sin(theta_0) * sin(phiIslandBCEB[i]);
567  float p1y = eIslandBCEB[j] * sin(theta_1) * sin(phiIslandBCEB[j]);
568 
569  float p0z = eIslandBCEB[i] * cos(theta_0);
570  float p1z = eIslandBCEB[j] * cos(theta_1);
571 
572  float pi0_px = p0x + p1x;
573  float pi0_py = p0y + p1y;
574  float pi0_pz = p0z + p1z;
575 
576  float pi0_ptot = sqrt (pi0_px*pi0_px + pi0_py*pi0_py + pi0_pz*pi0_pz);
577 
578  float pi0_theta = acos(pi0_pz/pi0_ptot);
579  float pi0_eta = -log(tan(pi0_theta/2));
580  float pi0_phi = atan(pi0_py/pi0_px);
581  //cout << " pi0_theta, pi0_eta, pi0_phi "<<pi0_theta<<" "<<pi0_eta<<" "<<pi0_phi<<endl;
582 
583  // belt isolation
584 
585  float et_belt=0;
586  for(Int_t k=0 ; k<nIslandBCEB ; k++)
587  {
588  if( (k != i) && (k != j) )
589  {
590  float dr_pi0_k = sqrt( (etaIslandBCEB[k]-pi0_eta)*(etaIslandBCEB[k]-pi0_eta) + (phiIslandBCEB[k]-pi0_phi)*(phiIslandBCEB[k]-pi0_phi) );
591  float deta_pi0_k = fabs(etaIslandBCEB[k]-pi0_eta);
592  if ( (dr_pi0_k<selePi0DRBelt_) && (deta_pi0_k<selePi0DetaBelt_) ) et_belt = et_belt + etIslandBCEB[k];
593  }
594  }
595 
596 
597  float pt_pi0 = sqrt( (p0x+p1x)*(p0x+p1x) + (p0y+p1y)*(p0y+p1y));
598  //float dr_pi0 = sqrt ( (etaIslandBCEB[i]-etaIslandBCEB[j])*(etaIslandBCEB[i]-etaIslandBCEB[j]) + (phiIslandBCEB[i]-phiIslandBCEB[j])*(phiIslandBCEB[i]-phiIslandBCEB[j]) );
599 
600  //cout <<" pi0 pt,dr: "<<pt_pi0<<" "<<dr_pi0<<endl;
601  if (pt_pi0 > selePi0PtPi0Min_)
602  {
603  float m_inv = sqrt ( (eIslandBCEB[i] + eIslandBCEB[j])*(eIslandBCEB[i] + eIslandBCEB[j]) - (p0x+p1x)*(p0x+p1x) - (p0y+p1y)*(p0y+p1y) - (p0z+p1z)*(p0z+p1z) );
604  cout <<" pi0 (pt>2.5 GeV) m_inv = "<<m_inv<<endl;
605 
606  float s4s9_1 = e2x2IslandBCEB[i]/e3x3IslandBCEB[i];
607  float s4s9_2 = e2x2IslandBCEB[j]/e3x3IslandBCEB[j];
608 
609  float s9s25_1 = e3x3IslandBCEB[i]/e5x5IslandBCEB[i];
610  float s9s25_2 = e3x3IslandBCEB[j]/e5x5IslandBCEB[j];
611 
612  //float s9Esc_1 = e3x3IslandBCEB[i]/eIslandBCEB[i];
613  //float s9Esc_2 = e3x3IslandBCEB[j]/eIslandBCEB[j];
614 
616  {
617  //good pizero candidate
619  {
620  //fill wxtals and mwxtals weights
621  cout<<" Pi0 Good candidate : minv = "<<m_inv<<endl;
622  for(int kk=0 ; kk<nIslandBCEBRecHits[i] ; kk++)
623  {
624  int ieta_xtal = ietaIslandBCEBRecHits[i][kk];
625  int iphi_xtal = iphiIslandBCEBRecHits[i][kk];
626  int sign = zsideIslandBCEBRecHits[i][kk]>0 ? 1 : 0;
627  wxtals[abs(ieta_xtal)-1][iphi_xtal-1][sign] = wxtals[abs(ieta_xtal)-1][iphi_xtal-1][sign] + eIslandBCEBRecHits[i][kk]/e3x3IslandBCEB[i];
628  mwxtals[abs(ieta_xtal)-1][iphi_xtal-1][sign] = mwxtals[abs(ieta_xtal)-1][iphi_xtal-1][sign] + (selePi0MinvMeanFixed_/m_inv)*(selePi0MinvMeanFixed_/m_inv)*(eIslandBCEBRecHits[i][kk]/e3x3IslandBCEB[i]);
629  cout<< "[Pi0FixedMassWindowCalibration] eta, phi, sign, e, e3x3, wxtals and mwxtals: "<<ieta_xtal<<" "<<iphi_xtal<<" "<<sign<<" "<<eIslandBCEBRecHits[i][kk]<<" "<<e3x3IslandBCEB[i]<<" "<<wxtals[abs(ieta_xtal)-1][iphi_xtal-1][sign]<<" "<<mwxtals[abs(ieta_xtal)-1][iphi_xtal-1][sign]<<endl;
630  }
631 
632  for(int kk=0 ; kk<nIslandBCEBRecHits[j] ; kk++)
633  {
634  int ieta_xtal = ietaIslandBCEBRecHits[j][kk];
635  int iphi_xtal = iphiIslandBCEBRecHits[j][kk];
636  int sign = zsideIslandBCEBRecHits[j][kk]>0 ? 1 : 0;
637  wxtals[abs(ieta_xtal)-1][iphi_xtal-1][sign] = wxtals[abs(ieta_xtal)-1][iphi_xtal-1][sign] + eIslandBCEBRecHits[j][kk]/e3x3IslandBCEB[j];
638  mwxtals[abs(ieta_xtal)-1][iphi_xtal-1][sign] = mwxtals[abs(ieta_xtal)-1][iphi_xtal-1][sign] + (selePi0MinvMeanFixed_/m_inv)*(selePi0MinvMeanFixed_/m_inv)*(eIslandBCEBRecHits[j][kk]/e3x3IslandBCEB[j]);
639  cout<< "[Pi0FixedMassWindowCalibration] eta, phi, sign, e, e3x3, wxtals and mwxtals: "<<ieta_xtal<<" "<<iphi_xtal<<" "<<sign<<" "<<eIslandBCEBRecHits[j][kk]<<" "<<e3x3IslandBCEB[j]<<" "<<wxtals[abs(ieta_xtal)-1][iphi_xtal-1][sign]<<" "<<mwxtals[abs(ieta_xtal)-1][iphi_xtal-1][sign]<<endl;
640  }
641 
642  }
643  }
644  }
645  }
646 
647 
648  } // End of the "j" loop over BCEB
649  } // End of the "i" loop over BCEB
650 
651 
652  } else {
653  cout<< " Not enough ECAL Barrel Basic Clusters: "<<nIslandBCEB<<endl;
654  }
655 
656 
657 
658 
659 
660 
661  return kContinue;
662 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
const self & getMap() const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< EcalRecHit >::const_iterator const_iterator
void push_back(T const &t)
std::vector< ClusterShape > ClusterShapeCollection
collection of ClusterShape objects
int iphi() const
get the crystal iphi
Definition: EBDetId.h:53
reco::ClusterShape Calculate(const reco::BasicCluster &passedCluster, const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry, const CaloSubdetectorTopology *topology)
MVATrainerComputer * calib
Definition: MVATrainer.cc:64
T sqrt(T t)
Definition: SSEVec.h:18
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int ieta() const
get the crystal ieta
Definition: EBDetId.h:51
const EcalRecHitCollection * ecalRecHitBarrelCollection
int k[5][pyjets_maxn]
const_iterator end() const
std::vector< reco::BasicCluster > makeClusters(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry, const CaloSubdetectorTopology *topology_p, const CaloSubdetectorGeometry *geometryES_p, EcalPart ecalPart, bool regional=false, const std::vector< RectangularEtaPhiRegion > &regions=std::vector< RectangularEtaPhiRegion >())
T const * product() const
Definition: Handle.h:81
std::vector< Item >::const_iterator const_iterator
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
HLT enums.
size_type size() const
T get() const
Definition: EventSetup.h:68
const_iterator find(uint32_t rawId) const
const_iterator end() const
std::map< DetId, EcalRecHit > * recHitsEB_map
T const * product() const
Definition: ESHandle.h:84
const EcalRecHitCollection * recalibEcalRecHitCollection
const_iterator begin() const
int zside() const
get the z-side of the crystal (1/-1)
Definition: EBDetId.h:47
float EcalIntercalibConstant
void Pi0FixedMassWindowCalibration::endOfJob ( )
overridevirtual

Called at end of job.

Reimplemented from edm::EDLooperBase.

Definition at line 181 of file Pi0FixedMassWindowCalibration.cc.

References funct::abs(), barrelCells, gather_cfg::cout, EcalBarrel, EBDetId::ieta(), EBDetId::iphi(), newCalibs_barl, Validation_hcalonly_cfi::sign, Pi0CalibXMLwriter::writeLine(), and EBDetId::zside().

Referenced by produce().

182 {
183 
184  std::cout << "[Pi0FixedMassWindowCalibration] endOfJob"<<endl;
185 
186  // Write new calibration constants
187 
188  Pi0CalibXMLwriter barrelWriter(EcalBarrel,99);
189 
190  std::vector<DetId>::const_iterator barrelIt=barrelCells.begin();
191  for (; barrelIt!=barrelCells.end(); barrelIt++) {
192  EBDetId eb(*barrelIt);
193  int ieta = eb.ieta();
194  int iphi = eb.iphi();
195  int sign = eb.zside()>0 ? 1 : 0;
196  barrelWriter.writeLine(eb,newCalibs_barl[abs(ieta)-1][iphi-1][sign]);
197  }
198 
199 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDLooper::Status Pi0FixedMassWindowCalibration::endOfLoop ( const edm::EventSetup iSetup,
unsigned int  iLoop 
)
override

Called at end of loop.

Definition at line 223 of file Pi0FixedMassWindowCalibration.cc.

References funct::abs(), barrelCells, gather_cfg::cout, EcalBarrel, EBDetId::ieta(), EBDetId::iphi(), edm::EDLooperBase::kContinue, edm::EDLooperBase::kStop, mwxtals, newCalibs_barl, oldCalibs_barl, Validation_hcalonly_cfi::sign, theMaxLoops, Pi0CalibXMLwriter::writeLine(), wxtals, and EBDetId::zside().

Referenced by produce().

224 {
225  std::cout << "[Pi0FixedMassWindowCalibration] Ending loop " << iLoop<<std::endl;
226 
227  for (int sign=0; sign<2; sign++) {
228  for (int ieta=0; ieta<85; ieta++) {
229  for (int iphi=0; iphi<360; iphi++) {
230 
231  if (wxtals[ieta][iphi][sign] == 0 )
232  {
233  newCalibs_barl[ieta][iphi][sign]=oldCalibs_barl[ieta][iphi][sign];
234  } else {
235  newCalibs_barl[ieta][iphi][sign]=oldCalibs_barl[ieta][iphi][sign]*(mwxtals[ieta][iphi][sign]/wxtals[ieta][iphi][sign]);
236  }
237  cout<< " New calibration constant: ieta iphi sign - old,mwxtals,wxtals,new: "<<ieta<<" "<<iphi<<" "<<sign<<" - "<<oldCalibs_barl[ieta][iphi][sign]<<" "<<mwxtals[ieta][iphi][sign]<<" "<<wxtals[ieta][iphi][sign]<<" "<<newCalibs_barl[ieta][iphi][sign]<<endl;
238 
239  }
240  }
241  }
242 
243  Pi0CalibXMLwriter barrelWriter(EcalBarrel,iLoop+1);
244 
245  std::vector<DetId>::const_iterator barrelIt=barrelCells.begin();
246  for (; barrelIt!=barrelCells.end(); barrelIt++) {
247  EBDetId eb(*barrelIt);
248  int ieta = eb.ieta();
249  int iphi = eb.iphi();
250  int sign = eb.zside()>0 ? 1 : 0;
251  barrelWriter.writeLine(eb,newCalibs_barl[abs(ieta)-1][iphi-1][sign]);
252  if (iphi==1) {
253  std::cout << "Calib constant for barrel crystal "
254  << " (" << ieta << "," << iphi << ") changed from "
255  << oldCalibs_barl[abs(ieta)-1][iphi-1][sign] << " to "
256  << newCalibs_barl[abs(ieta)-1][iphi-1][sign] << std::endl;
257  }
258  }
259 
260  // replace old calibration constants with new one
261 
262  for (int sign=0; sign<2; sign++) {
263  for (int ieta=0; ieta<85; ieta++) {
264  for (int iphi=0; iphi<360; iphi++) {
265  oldCalibs_barl[ieta][iphi][sign]=newCalibs_barl[ieta][iphi][sign];
266  newCalibs_barl[ieta][iphi][sign]=0;
267  }
268  }
269  }
270 
271 
272  if ( iLoop == theMaxLoops-1 || iLoop >= theMaxLoops ) return kStop;
273  else return kContinue;
274 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void Pi0FixedMassWindowCalibration::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 114 of file Pi0FixedMassWindowCalibration.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), cleanAndMergeSuperClusters_cfi::posCalcParameters, and AlCaHLTBitMon_QueryRunRegistry::string.

114  {
115 
117 
118  desc.add<unsigned int>("maxLoops", 0);
119  desc.add<std::string>("ecalRecHitsProducer", "");
120  desc.add<std::string>("barrelHitCollection", "");
121 
122  desc.add<std::string>("VerbosityLevel", "");
123  desc.add<std::string>("barrelClusterCollection", "");
124 
125  desc.add<double>("IslandBarrelSeedThr", 0);
126  desc.add<double>("IslandEndcapSeedThr", 0);
127 
128  desc.add<double>("selePi0PtGammaOneMin", 0);
129  desc.add<double>("selePi0PtGammaTwoMin", 0);
130 
131  desc.add<double>("selePi0DRBelt", 0);
132  desc.add<double>("selePi0DetaBelt", 0);
133 
134  desc.add<double>("selePi0PtPi0Min", 0);
135 
136  desc.add<double>("selePi0S4S9GammaOneMin", 0);
137  desc.add<double>("selePi0S4S9GammaTwoMin", 0);
138  desc.add<double>("selePi0S9S25GammaOneMin", 0);
139  desc.add<double>("selePi0S9S25GammaTwoMin", 0);
140 
141  desc.add<double>("selePi0EtBeltIsoRatioMax", 0);
142 
143  desc.add<double>("selePi0MinvMeanFixed", 0);
144  desc.add<double>("selePi0MinvSigmaFixed", 0);
145 
147  posCalcParameters.add<bool>("LogWeighted", true);
148  posCalcParameters.add<double>("T0_barl", 7.4);
149  posCalcParameters.add<double>("T0_endc", 3.1);
150  posCalcParameters.add<double>("T0_endcPresh", 1.2);
151  posCalcParameters.add<double>("W0", 4.2);
152  posCalcParameters.add<double>("X0", 0.89);
153  desc.add<edm::ParameterSetDescription>("posCalcParameters", posCalcParameters);
154 
155  desc.add<std::string>("clustershapecollectionEB", "islandBarrelShape");
156  desc.add<std::string>("barrelShapeAssociation", "islandBarrelShapeAssoc");
157 
158  desc.add<std::vector<std::string>>("SeedRecHitFlagToBeExcludedEB", {});
159  desc.add<std::vector<std::string>>("SeedRecHitFlagToBeExcludedEE", {});
160  desc.add<std::vector<std::string>>("RecHitFlagToBeExcludedEB", {});
161  desc.add<std::vector<std::string>>("RecHitFlagToBeExcludedEE", {});
162 
163  descriptions.add("Pi0FixedMassWindowCalibration", desc);
164 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void Pi0FixedMassWindowCalibration::produce ( edm::Event ,
const edm::EventSetup  
)
inlinevirtual

Dummy implementation (job done in duringLoop)

Definition at line 73 of file Pi0FixedMassWindowCalibration.h.

References beginOfJob(), duringLoop(), endOfJob(), endOfLoop(), and startingNewLoop().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

73 {};
void Pi0FixedMassWindowCalibration::startingNewLoop ( unsigned int  iLoop)
overridevirtual

Called at beginning of loop.

Implements edm::EDLooperBase.

Definition at line 203 of file Pi0FixedMassWindowCalibration.cc.

References gather_cfg::cout, mwxtals, Validation_hcalonly_cfi::sign, and wxtals.

Referenced by produce().

204 {
205 
206  for (int sign=0; sign<2; sign++) {
207  for (int ieta=0; ieta<85; ieta++) {
208  for (int iphi=0; iphi<360; iphi++) {
209  wxtals[ieta][iphi][sign]=0.;
210  mwxtals[ieta][iphi][sign]=0.;
211  }
212  }
213  }
214  std::cout << "[Pi0FixedMassWindowCalibration] Starting loop number " << iLoop<<std::endl;
215 
216 }

Member Data Documentation

std::vector<DetId> Pi0FixedMassWindowCalibration::barrelCells
private

Definition at line 134 of file Pi0FixedMassWindowCalibration.h.

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

std::string Pi0FixedMassWindowCalibration::barrelClusterCollection_
private

Definition at line 105 of file Pi0FixedMassWindowCalibration.h.

Referenced by Pi0FixedMassWindowCalibration().

std::string Pi0FixedMassWindowCalibration::barrelClusterShapeAssociation_
private

Definition at line 107 of file Pi0FixedMassWindowCalibration.h.

Referenced by Pi0FixedMassWindowCalibration().

std::string Pi0FixedMassWindowCalibration::barrelHitCollection_
private

Definition at line 104 of file Pi0FixedMassWindowCalibration.h.

std::string Pi0FixedMassWindowCalibration::barrelHitProducer_
private

Definition at line 103 of file Pi0FixedMassWindowCalibration.h.

std::string Pi0FixedMassWindowCalibration::barrelHits_
private

Definition at line 98 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop().

std::string Pi0FixedMassWindowCalibration::clustershapecollectionEB_
private

Definition at line 106 of file Pi0FixedMassWindowCalibration.h.

Referenced by Pi0FixedMassWindowCalibration().

std::string Pi0FixedMassWindowCalibration::ecalHitsProducer_
private

Definition at line 97 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop().

const EcalRecHitCollection* Pi0FixedMassWindowCalibration::ecalRecHitBarrelCollection
private

Definition at line 152 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop().

bool Pi0FixedMassWindowCalibration::isfirstcall_
private

Definition at line 159 of file Pi0FixedMassWindowCalibration.h.

Referenced by beginOfJob(), and duringLoop().

IslandClusterAlgo* Pi0FixedMassWindowCalibration::island_p
private
double Pi0FixedMassWindowCalibration::mwxtals[85][360][2]
private

Definition at line 140 of file Pi0FixedMassWindowCalibration.h.

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

int Pi0FixedMassWindowCalibration::nevent
private

Definition at line 94 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop().

double Pi0FixedMassWindowCalibration::newCalibs_barl[85][360][2]
private

Definition at line 138 of file Pi0FixedMassWindowCalibration.h.

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

double Pi0FixedMassWindowCalibration::oldCalibs_barl[85][360][2]
private

Definition at line 137 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop(), and endOfLoop().

PositionCalc Pi0FixedMassWindowCalibration::posCalculator_
private

Definition at line 109 of file Pi0FixedMassWindowCalibration.h.

Referenced by Pi0FixedMassWindowCalibration().

const EcalRecHitCollection* Pi0FixedMassWindowCalibration::recalibEcalRecHitCollection
private

Definition at line 153 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop().

std::map<DetId, EcalRecHit>* Pi0FixedMassWindowCalibration::recHitsEB_map
private

Definition at line 150 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop().

double Pi0FixedMassWindowCalibration::selePi0DetaBelt_
private

Definition at line 118 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop(), and Pi0FixedMassWindowCalibration().

double Pi0FixedMassWindowCalibration::selePi0DRBelt_
private

Definition at line 117 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop(), and Pi0FixedMassWindowCalibration().

double Pi0FixedMassWindowCalibration::selePi0EtBeltIsoRatioMax_
private

Definition at line 127 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop(), and Pi0FixedMassWindowCalibration().

double Pi0FixedMassWindowCalibration::selePi0MinvMeanFixed_
private

Definition at line 129 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop(), and Pi0FixedMassWindowCalibration().

double Pi0FixedMassWindowCalibration::selePi0MinvSigmaFixed_
private

Definition at line 130 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop(), and Pi0FixedMassWindowCalibration().

double Pi0FixedMassWindowCalibration::selePi0PtGammaOneMin_
private

Definition at line 114 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop(), and Pi0FixedMassWindowCalibration().

double Pi0FixedMassWindowCalibration::selePi0PtGammaTwoMin_
private

Definition at line 115 of file Pi0FixedMassWindowCalibration.h.

Referenced by Pi0FixedMassWindowCalibration().

double Pi0FixedMassWindowCalibration::selePi0PtPi0Min_
private

Definition at line 120 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop(), and Pi0FixedMassWindowCalibration().

double Pi0FixedMassWindowCalibration::selePi0S4S9GammaOneMin_
private

Definition at line 122 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop(), and Pi0FixedMassWindowCalibration().

double Pi0FixedMassWindowCalibration::selePi0S4S9GammaTwoMin_
private

Definition at line 123 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop(), and Pi0FixedMassWindowCalibration().

double Pi0FixedMassWindowCalibration::selePi0S9S25GammaOneMin_
private

Definition at line 124 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop(), and Pi0FixedMassWindowCalibration().

double Pi0FixedMassWindowCalibration::selePi0S9S25GammaTwoMin_
private

Definition at line 125 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop(), and Pi0FixedMassWindowCalibration().

ClusterShapeAlgo Pi0FixedMassWindowCalibration::shapeAlgo_
private

Definition at line 110 of file Pi0FixedMassWindowCalibration.h.

Referenced by duringLoop(), and Pi0FixedMassWindowCalibration().

TFile* Pi0FixedMassWindowCalibration::theFile
private

Definition at line 157 of file Pi0FixedMassWindowCalibration.h.

unsigned int Pi0FixedMassWindowCalibration::theMaxLoops
private

Definition at line 96 of file Pi0FixedMassWindowCalibration.h.

Referenced by endOfLoop().

edm::ParameterSet Pi0FixedMassWindowCalibration::theParameterSet
private

Definition at line 144 of file Pi0FixedMassWindowCalibration.h.

Referenced by Pi0FixedMassWindowCalibration().

IslandClusterAlgo::VerbosityLevel Pi0FixedMassWindowCalibration::verbosity
private

Definition at line 101 of file Pi0FixedMassWindowCalibration.h.

Referenced by Pi0FixedMassWindowCalibration().

double Pi0FixedMassWindowCalibration::wxtals[85][360][2]
private

Definition at line 139 of file Pi0FixedMassWindowCalibration.h.

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