CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
EopElecTreeWriter Class Reference
Inheritance diagram for EopElecTreeWriter:
edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 EopElecTreeWriter (const edm::ParameterSet &)
 
 ~EopElecTreeWriter () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endJob () override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 

Private Attributes

const edm::ESGetToken< CaloGeometry, CaloGeometryRecordcaloGeomToken_
 
bool debugTriggerSelection_
 
edm::Service< TFileServicefs_
 
TH1D * h_counter1
 
TH1D * h_counter2
 
TH1D * h_cut_OneSCmatch
 
TH1D * h_cut_Ptmin
 
TH1D * h_distToClosestSC
 
TH1D * h_distToClosestSCgsf
 
TH1D * h_EcalEnergy
 
TH1D * h_Eop_InnerNegative
 
TH1D * h_Eop_InnerPositive
 
TH1D * h_fBREM
 
TH1D * h_Momentum
 
TH1D * h_nEvents
 
TH1D * h_nEvents2Elec
 
TH1D * h_nEventsHLTelectron
 
TH1D * h_nEventsHLTFilter
 
TH1D * h_nEventsHLTrejected
 
TH1D * h_nEventsTriggered
 
TH1D * h_nEventsWithVertex
 
TH1D * h_nHLTelectrons
 
TH1D * h_nTracks
 
TH1D * h_nTracksFiltered
 
TH1D * h_nTrkRejectedPerEvt
 
TH1D * h_nTrkSelectedPerEvt
 
TH1D * HcalEnergy
 
TH2D * HcalVSEcal
 
HLTConfigProvider hltConfig_
 
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmagFieldToken_
 
MultiTrajectoryStateTransformmtsTransform_
 
const edm::EDGetTokenT< reco::SuperClusterCollectiontheBarrelSupClusCollectionToken_
 
const edm::EDGetTokenT< EcalRecHitCollectiontheEcalRecHitCollectionToken_
 
const edm::EDGetTokenT< reco::SuperClusterCollectiontheEndCapSupClusCollectionToken_
 
std::string theFilter_
 
const edm::EDGetTokenT< reco::GsfElectronCoreCollectiontheGsfElectronCoreCollectionToken_
 
const edm::EDGetTokenT< reco::GsfTrackCollectiontheGsfTrackCollectionToken_
 
const edm::EDGetTokenT< HBHERecHitCollectiontheHBHERecHitCollectionToken_
 
std::string theTrigger_
 
const edm::EDGetTokenT< trigger::TriggerEventtheTriggerEventToken_
 
const edm::EDGetTokenT< edm::TriggerResultstheTriggerResultsToken_
 
const edm::EDGetTokenT< reco::VertexCollectiontheVertexCollectionToken_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtkGeomToken_
 
TTree * tree_
 
EopElecVariablestreeMemPtr_
 
std::vector< std::string > triggerNames_
 

Static Private Attributes

static constexpr float k_etaBarrel = 1.55
 
static constexpr float k_etaEndcap = 1.44
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 101 of file EopElecTreeWriter.cc.

Constructor & Destructor Documentation

◆ EopElecTreeWriter()

EopElecTreeWriter::EopElecTreeWriter ( const edm::ParameterSet iConfig)
explicit

Definition at line 222 of file EopElecTreeWriter.cc.

References fs_, h_counter1, h_counter2, h_cut_OneSCmatch, h_cut_Ptmin, h_distToClosestSC, h_distToClosestSCgsf, h_EcalEnergy, h_Eop_InnerNegative, h_Eop_InnerPositive, h_fBREM, h_Momentum, h_nEvents, h_nEvents2Elec, h_nEventsHLTelectron, h_nEventsHLTFilter, h_nEventsHLTrejected, h_nEventsTriggered, h_nEventsWithVertex, h_nHLTelectrons, h_nTracks, h_nTracksFiltered, h_nTrkRejectedPerEvt, h_nTrkSelectedPerEvt, HcalEnergy, HcalVSEcal, TFileService::kSharedResource, TFileService::make(), tree_, and treeMemPtr_.

226  theVertexCollectionToken_(consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"))),
227  theHBHERecHitCollectionToken_(consumes<HBHERecHitCollection>(edm::InputTag("hbhereco", ""))),
228  theEcalRecHitCollectionToken_(consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit", "EcalRecHitsEB"))),
230  consumes<reco::SuperClusterCollection>(edm::InputTag("hybridSuperClusters", ""))),
231  theEndCapSupClusCollectionToken_(consumes<reco::SuperClusterCollection>(
232  edm::InputTag("multi5x5SuperClusters", "multi5x5EndcapSuperClusters"))),
233  theTriggerResultsToken_(consumes<edm::TriggerResults>(edm::InputTag("TriggerResults", "", "HLT"))),
234  theTriggerEventToken_(consumes<trigger::TriggerEvent>(edm::InputTag("hltTriggerSummaryAOD"))),
235  theGsfTrackCollectionToken_(consumes<reco::GsfTrackCollection>(iConfig.getParameter<edm::InputTag>("src"))),
237  consumes<reco::GsfElectronCoreCollection>(edm::InputTag("gedGsfElectronCores"))),
238  theTrigger_(iConfig.getParameter<std::string>("triggerPath")),
239  theFilter_(iConfig.getParameter<std::string>("hltFilter")),
240  debugTriggerSelection_(iConfig.getParameter<bool>("debugTriggerSelection")) {
241  usesResource(TFileService::kSharedResource);
242 
243  // TTree creation
244  tree_ = fs_->make<TTree>("EopTree", "EopTree");
246  tree_->Branch("EopElecVariables", &treeMemPtr_); // address of pointer!
247 
248  // Control histograms declaration
249  h_distToClosestSC = fs_->make<TH1D>("distToClosestSC", "distToClosestSC", 100, 0, 0.1);
250  h_distToClosestSCgsf = fs_->make<TH1D>("distToClosestSCgsf", "distToClosestSCgsf", 100, 0, 0.1);
251  h_EcalEnergy = fs_->make<TH1D>("EcalEnergy", "EcalEnergy", 100, 0, 200);
252  h_Momentum = fs_->make<TH1D>("Momentum", "Momentum", 100, 0, 200);
253  HcalEnergy = fs_->make<TH1D>("HcalEnergy", "HcalEnergy", 100, 0, 40);
254  h_fBREM = fs_->make<TH1D>("fBREM", "fBREM", 100, -0.2, 1);
255  h_Eop_InnerNegative = fs_->make<TH1D>("Eop_InnerNegative", "Eop_InnerNegative", 100, 0, 3);
256  h_Eop_InnerPositive = fs_->make<TH1D>("Eop_InnerPositive", "Eop_InnerPositive", 100, 0, 3);
257  HcalVSEcal = fs_->make<TH2D>("HcalVSEcal", "HcalVSEcal", 100, 0, 160, 100, 0, 10);
258 
259  h_nEvents = fs_->make<TH1D>("nEvents", "nEvents", 1, 0, 1);
260  h_nEventsWithVertex = fs_->make<TH1D>("nEventsWithVertex", "nEventsWithVertex", 1, 0, 1);
261  h_nEventsTriggered = fs_->make<TH1D>("nEventsTriggered", "nEventsTriggered", 1, 0, 1);
262  h_nEventsHLTFilter = fs_->make<TH1D>("nEventsHLTFilter", "nEventsHLTFilter", 1, 0, 1);
263  h_nEventsHLTelectron = fs_->make<TH1D>("nEventsHLTelectron", "nEventsHLTelectron", 1, 0, 1);
264  h_nEventsHLTrejected = fs_->make<TH1D>("nEventsHLTrejected", "nEventsHLTrejected", 1, 0, 1);
265  h_nEvents2Elec = fs_->make<TH1D>("nEvents2Elec", "nEvents2Elec", 1, 0, 1);
266 
267  h_nHLTelectrons = fs_->make<TH1D>("nHLTelectrons", "nHLTelectrons", 20, 0, 20);
268  h_nTrkRejectedPerEvt = fs_->make<TH1D>("nTrkRejectedPerEvt", "nTrkRejectedPerEvt", 20, 0, 20);
269  h_nTrkSelectedPerEvt = fs_->make<TH1D>("nTrkSelectedPerEvt", "nTrkSelectedPerEvt", 20, 0, 20);
270 
271  h_nTracks = fs_->make<TH1D>("nTracks", "nTracks", 1, 0, 1);
272  h_nTracksFiltered = fs_->make<TH1D>("nTracksFiltered", "nTracksFiltered", 1, 0, 1);
273  h_cut_Ptmin = fs_->make<TH1D>("cut_Ptmin", "cut_Ptmin", 1, 0, 1);
274  h_cut_OneSCmatch = fs_->make<TH1D>("cut_OneSCmatch", "cut_OneSCmatch", 1, 0, 1);
275 
276  h_counter1 = fs_->make<TH1D>("counter1", "counter1", 1, 0, 1);
277  h_counter2 = fs_->make<TH1D>("counter2", "counter2", 1, 0, 1);
278 }
static const std::string kSharedResource
Definition: TFileService.h:76
const edm::EDGetTokenT< reco::SuperClusterCollection > theEndCapSupClusCollectionToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::EDGetTokenT< HBHERecHitCollection > theHBHERecHitCollectionToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
EopElecVariables * treeMemPtr_
const edm::EDGetTokenT< EcalRecHitCollection > theEcalRecHitCollectionToken_
const edm::EDGetTokenT< reco::SuperClusterCollection > theBarrelSupClusCollectionToken_
edm::Service< TFileService > fs_
const edm::EDGetTokenT< reco::GsfElectronCoreCollection > theGsfElectronCoreCollectionToken_
const edm::EDGetTokenT< reco::VertexCollection > theVertexCollectionToken_
const edm::EDGetTokenT< edm::TriggerResults > theTriggerResultsToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
const edm::EDGetTokenT< trigger::TriggerEvent > theTriggerEventToken_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
const edm::EDGetTokenT< reco::GsfTrackCollection > theGsfTrackCollectionToken_

◆ ~EopElecTreeWriter()

EopElecTreeWriter::~EopElecTreeWriter ( )
override

Definition at line 280 of file EopElecTreeWriter.cc.

References h_distToClosestSC, h_distToClosestSCgsf, h_EcalEnergy, h_Eop_InnerNegative, h_Eop_InnerPositive, h_Momentum, HcalEnergy, and HcalVSEcal.

280  {
281  // control histograms
282  h_distToClosestSC->SetXTitle("distance from track to closest SuperCluster in eta-phi plan (weighted matching)");
283  h_distToClosestSC->SetYTitle("# Tracks");
284 
285  h_distToClosestSCgsf->SetXTitle("distance from track to closest SuperCluster in eta-phi plan (gsfElectronCore)");
286  h_distToClosestSCgsf->SetYTitle("# Tracks");
287 
288  h_EcalEnergy->SetXTitle("Ecal energy deposit (GeV)");
289  h_EcalEnergy->SetYTitle("# tracks");
290 
291  HcalEnergy->SetXTitle("Hcal energy deposit (GeV)");
292  HcalEnergy->SetYTitle("# tracks");
293 
294  h_Momentum->SetXTitle("Momentum magnitude (GeV)");
295  h_Momentum->SetYTitle("# tracks");
296 
297  h_Eop_InnerNegative->SetXTitle("E/p");
298  h_Eop_InnerNegative->SetYTitle("# tracks");
299 
300  h_Eop_InnerPositive->SetXTitle("E/p");
301  h_Eop_InnerPositive->SetYTitle("# tracks");
302 
303  HcalVSEcal->SetXTitle("Ecal energy (GeV)");
304  HcalVSEcal->SetYTitle("Hcal energy (GeV)");
305 }

Member Function Documentation

◆ analyze()

void EopElecTreeWriter::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 311 of file EopElecTreeWriter.cc.

References funct::abs(), edm::HLTGlobalStatus::accept(), SuperClusterShapeAlgo::Calculate_Covariances(), caloGeomToken_, EopElecVariables::charge, EopElecVariables::chi2, debugTriggerSelection_, reco::deltaR(), HGC3DClusterGenMatchSelector_cfi::dR, EopElecVariables::dRto1stSC, EopElecVariables::dRto2ndSC, DetId::Ecal, EcalBarrel, eopUtils::ecalEta(), pwdgSkimBPark_cfi::electrons, edm::HLTGlobalStatus::error(), PVValHelper::eta, EopElecVariables::eta, PV3DBase< T, PVType, FrameType >::eta(), EopElecVariables::etaIn, EopElecVariables::etaOut, SuperClusterShapeAlgo::etaWidth(), electrons_cff::etaWidth, EopElecVariables::EvtNumber, EopElecVariables::fbrem, electrons_cff::fbrem, filters, EopTriggerType::fired, edm::EventSetup::getData(), CaloGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), h_counter1, h_counter2, h_cut_OneSCmatch, h_cut_Ptmin, h_distToClosestSC, h_distToClosestSCgsf, h_EcalEnergy, h_Eop_InnerNegative, h_Eop_InnerPositive, h_fBREM, h_Momentum, h_nEvents, h_nEvents2Elec, h_nEventsHLTelectron, h_nEventsHLTFilter, h_nEventsHLTrejected, h_nEventsTriggered, h_nEventsWithVertex, h_nHLTelectrons, h_nTracks, h_nTracksFiltered, h_nTrkRejectedPerEvt, h_nTrkSelectedPerEvt, HcalEnergy, EopElecVariables::HcalEnergyIn01, EopElecVariables::HcalEnergyIn02, EopElecVariables::HcalEnergyIn03, EopElecVariables::HcalEnergyIn04, EopElecVariables::HcalEnergyIn05, HcalVSEcal, hltConfig_, mps_fire::i, iEvent, EopTriggerType::index, EopElecVariables::innerOk, MultiTrajectoryStateTransform::innerStateOnSurface(), PixelPluginsPhase0_cfi::isBarrel, EopElecVariables::isEcalDriven, electrons_cff::isEcalDriven, GeomDetEnumerators::isEndcap(), edm::Ref< C, T, F >::isNull(), EopElecVariables::isTrackerDriven, TrajectoryStateOnSurface::isValid(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmiolumiharvest::j, k_etaBarrel, k_etaEndcap, PV3DBase< T, PVType, FrameType >::mag(), magFieldToken_, EopElecVariables::MaxPtIn01, EopElecVariables::MaxPtIn02, EopElecVariables::MaxPtIn03, EopElecVariables::MaxPtIn04, EopElecVariables::MaxPtIn05, HLTConfigProvider::moduleLabels(), multiTrajectoryStateMode::momentumFromModePPhiEta(), EopElecVariables::nHits, EopElecVariables::nLostHits, EopElecVariables::normalizedChi2, EopElecVariables::NoTrackIn0015, EopElecVariables::NoTrackIn0020, EopElecVariables::NoTrackIn0025, EopElecVariables::NoTrackIn0030, EopElecVariables::NoTrackIn0035, EopElecVariables::NoTrackIn0040, EopElecVariables::outerRadius, MultiTrajectoryStateTransform::outerStateOnSurface(), EopElecVariables::p, EopElecVariables::p_rejected_track, phi, PV3DBase< T, PVType, FrameType >::phi(), EopElecVariables::phi, EopElecVariables::phiIn, EopElecVariables::phiOut, SuperClusterShapeAlgo::phiWidth(), electrons_cff::phiWidth, EopElecVariables::pIn, reco::Vertex::position(), EopElecVariables::pOut, EopTriggerType::prescale, HLTConfigProvider::prescaleSize(), HLTConfigProvider::prescaleValue(), DiDispStaMuonMonitor_cfi::pt, EopElecVariables::pt, EopElecVariables::ptError, EopElecVariables::px, EopElecVariables::px_rejected_track, EopElecVariables::py, EopElecVariables::py_rejected_track, EopElecVariables::pz, EopElecVariables::pz_rejected_track, rho, EopElecVariables::RunNumber, EopElecVariables::SC_algoID, EopElecVariables::SC_energy, EopElecVariables::SC_eta, EopElecVariables::SC_etaWidth, EopElecVariables::SC_isBarrel, EopElecVariables::SC_isEndcap, EopElecVariables::SC_nBasicClus, EopElecVariables::SC_phi, EopElecVariables::SC_phiWidth, fileCollector::seed, AlCaHLTBitMon_QueryRunRegistry::string, EopElecVariables::SumPtIn01, EopElecVariables::SumPtIn02, EopElecVariables::SumPtIn03, EopElecVariables::SumPtIn04, EopElecVariables::SumPtIn05, theBarrelSupClusCollectionToken_, theEcalRecHitCollectionToken_, theEndCapSupClusCollectionToken_, theFilter_, theGsfElectronCoreCollectionToken_, theGsfTrackCollectionToken_, theHBHERecHitCollectionToken_, EopElecVariables::theta, theTrigger_, theTriggerEventToken_, theTriggerResultsToken_, theVertexCollectionToken_, tkGeomToken_, HLT_2024v14_cff::track, DiMuonV_cfg::tracks, tree_, treeMemPtr_, PDWG_DiPhoton_SD_cff::triggerEvent, HLTConfigProvider::triggerIndex(), PDWG_DiPhoton_SD_cff::triggerName, triggerNames_, ewkElecDQM_cfi::TrigTag, bphysicsOniaDQM_cfi::vertex, edm::HLTGlobalStatus::wasrun(), and reco::Vertex::z().

311  {
312  using namespace edm;
313  h_nEvents->Fill(0.5);
314 
315  Double_t EnergyHcalIn01;
316  Double_t EnergyHcalIn02;
317  Double_t EnergyHcalIn03;
318  Double_t EnergyHcalIn04;
319  Double_t EnergyHcalIn05;
320  Double_t etaWidth;
321  Double_t phiWidth;
322  Int_t algo_ID;
323  Double_t EnergyEcal;
324  Double_t fbrem;
325  Double_t pin;
326  Double_t etaIn;
327  Double_t phiIn;
328  Double_t pout;
329  Double_t etaOut;
330  Double_t phiOut;
331  Double_t MaxPtIn01;
332  Double_t SumPtIn01;
333  Bool_t NoTrackIn0015;
334  Double_t MaxPtIn02;
335  Double_t SumPtIn02;
336  Bool_t NoTrackIn0020;
337  Double_t MaxPtIn03;
338  Double_t SumPtIn03;
339  Bool_t NoTrackIn0025;
340  Double_t MaxPtIn04;
341  Double_t SumPtIn04;
342  Bool_t NoTrackIn0030;
343  Double_t MaxPtIn05;
344  Double_t SumPtIn05;
345  Bool_t NoTrackIn0035;
346  Bool_t NoTrackIn0040;
347  Double_t dRSC_first;
348  Double_t dRSC_second;
349  Double_t etaSC;
350  Double_t phiSC;
351  Int_t nbSC; //to count the nb of SuperCluster matching with a given track
352  Int_t nBasicClus; //to count the nb of basic cluster in a given superCluster
353  Bool_t isEcalDriven;
354  Bool_t isTrackerDriven;
355  Bool_t isBarrel;
356  Bool_t isEndcap;
357  Bool_t TrigTag;
358 
359  //--------------- for GsfTrack propagation through tracker ---------------
360 
361  const MagneticField* magField_ = &iSetup.getData(magFieldToken_);
362  const TrackerGeometry* trackerGeom_ = &iSetup.getData(tkGeomToken_);
363  MultiTrajectoryStateTransform mtsTransform(trackerGeom_, magField_);
364 
365  //--------------- Super Cluster -----------------
366 
367  // getting primary vertex (necessary to convert eta track to eta detector
369 
370  if (vertex.empty()) {
371  edm::LogError("EopElecTreeWriter") << "Error: no primary vertex found!";
372  return;
373  }
374  const reco::Vertex& vert = vertex.front();
375  h_nEventsWithVertex->Fill(0.5);
376 
377  // getting calorimeter geometry
378  const CaloGeometry* geo = &iSetup.getData(caloGeomToken_);
380  if (subGeo == nullptr)
381  edm::LogError("EopElecTreeWriter") << "ERROR: unable to find SubDetector geometry!!!";
382 
383  // getting Hcal rechits
385 
386  // getting Ecal rechits
388  if (rhc == nullptr)
389  edm::LogError("EopElecTreeWriter") << "ERROR: unable to find the EcalRecHit collection !!!";
390 
391  // getting SuperCluster
392  const reco::SuperClusterCollection* BarrelSupClusCollection = &iEvent.get(theBarrelSupClusCollectionToken_);
393  const reco::SuperClusterCollection* EndcapSupClusCollection = &iEvent.get(theEndCapSupClusCollectionToken_);
394 
395  // necessary to re-calculate phi and eta width of SuperClusters
396  SuperClusterShapeAlgo SCShape(rhc, subGeo);
397 
398  //--------------- Trigger -----------------
399  TrigTag = false;
400  const edm::TriggerResults* trigRes = &iEvent.get(theTriggerResultsToken_);
401 
402  // trigger event
404 
405  // our trigger table
406  std::map<std::string, EopTriggerType> HLTpaths;
407  for (const auto& triggerName : triggerNames_) {
408  if (triggerName.find(theTrigger_) != 0)
409  continue;
410  EopTriggerType myTrigger;
411 
412  const unsigned int prescaleSize = hltConfig_.prescaleSize();
413  for (unsigned int ps = 0; ps < prescaleSize; ps++) {
414  auto const prescaleValue = hltConfig_.prescaleValue<double>(ps, triggerName);
415  if (prescaleValue != 1) {
416  myTrigger.prescale = prescaleValue;
417  }
418  }
419 
421  if (myTrigger.index == -1)
422  continue;
423  myTrigger.fired =
424  trigRes->wasrun(myTrigger.index) && trigRes->accept(myTrigger.index) && !trigRes->error(myTrigger.index);
425  HLTpaths[triggerName] = myTrigger;
426  }
427 
428  // First cut : trigger cut
429  std::string firstFiredPath = "";
430  for (const auto& it : HLTpaths) {
431  if (it.second.fired) {
432  TrigTag = true;
433  firstFiredPath = it.first;
434  break;
435  }
436  }
437  if (!TrigTag)
438  return;
439  h_nEventsTriggered->Fill(0.5);
440 
441  // Displaying filters label from the first fired trigger
442  // Useful for finding the good filter label
443  std::vector<std::string> filters = hltConfig_.moduleLabels(firstFiredPath);
444 
446  edm::LogInfo("EopElecTreeWriter") << "filters : ";
447  for (unsigned int i = 0; i < filters.size(); i++) {
448  edm::LogInfo("EopElecTreeWriter") << filters[i] << " ";
449  }
450  }
451 
452  // Getting HLT electrons
453  edm::InputTag testTag(theFilter_, "", "HLT");
454  int testindex = triggerEvent->filterIndex(testTag);
455 
456  if (testindex >= triggerEvent->sizeFilters())
457  return;
458  h_nEventsHLTFilter->Fill(0.5);
459 
460  const trigger::Keys& KEYS_el(triggerEvent->filterKeys(testindex));
461 
462  std::vector<const trigger::TriggerObject*> HLTelectrons;
463  for (unsigned int i = 0; i != KEYS_el.size(); ++i) {
464  const trigger::TriggerObject* triggerObject_el = &(triggerEvent->getObjects().at(KEYS_el[i]));
465  HLTelectrons.push_back(triggerObject_el);
466  }
467 
468  h_nHLTelectrons->Fill(HLTelectrons.size());
469 
470  if (HLTelectrons.empty())
471  return;
472  h_nEventsHLTelectron->Fill(0.5);
473 
474  // finding the HLT electron with highest pt and saving the corresponding index
475  unsigned int HighPtIndex = 0;
476  double maxPtHLT = -5.;
477  for (unsigned int j = 0; j < HLTelectrons.size(); j++) {
478  if (HLTelectrons[j]->pt() > maxPtHLT) {
479  maxPtHLT = HLTelectrons[j]->pt();
480  HighPtIndex = j;
481  }
482  }
483 
484  //----------------- Tracks -------------------
485 
486  // getting GsfTrack
488 
489  // filtering track
490  int nRejected = 0;
491  int nSelected = 0;
492  std::vector<const reco::GsfTrack*> filterTracks;
493  for (const auto& track : tracks) {
494  h_nTracks->Fill(0.5);
495  double deltar =
496  reco::deltaR(track.eta(), track.phi(), HLTelectrons[HighPtIndex]->eta(), HLTelectrons[HighPtIndex]->phi());
497  // remove the triggered electron with highest pt
498  if (deltar < 0.025) {
503  nRejected++;
504  continue;
505  }
506  filterTracks.push_back(&track); // we use all the others
507  nSelected++;
508  h_nTracksFiltered->Fill(0.5);
509  }
510  h_nTrkRejectedPerEvt->Fill(nRejected);
511  h_nTrkSelectedPerEvt->Fill(nSelected);
512 
513  if (nRejected == 0)
514  return;
515  h_nEventsHLTrejected->Fill(0.5);
516 
517  if (filterTracks.empty())
518  return;
519  h_nEvents2Elec->Fill(0.5);
520 
521  //-------- test:Matching SC/track using gsfElectonCore collection --------
522 
524  for (const auto& elec : *electrons) {
525  double etaGSF = eopUtils::ecalEta((elec.gsfTrack())->eta(), vert.z(), (vert.position()).rho());
526  if ((elec.gsfTrack())->pt() < 10.)
527  continue;
528 
529  double DELTAR = 0;
530  DELTAR = reco::deltaR((elec.superCluster())->eta(), (elec.superCluster())->phi(), etaGSF, (elec.gsfTrack())->phi());
531 
532  if (DELTAR < 0.1)
533  h_distToClosestSCgsf->Fill(DELTAR);
534  }
535 
536  //------------------------------------------------------------
537  //-------------- Loop on tracks -------------------------
538 
539  for (const auto& track : filterTracks) {
540  // initializing variables
541  isEcalDriven = false;
542  isTrackerDriven = false;
543  isBarrel = false;
544  isEndcap = false;
545  etaWidth = 0;
546  phiWidth = 0;
547  etaSC = 0;
548  phiSC = 0;
549  fbrem = 0;
550  pin = 0;
551  etaIn = 0;
552  phiIn = 0;
553  pout = 0;
554  etaOut = 0;
555  phiOut = 0;
556  algo_ID = 0;
557  EnergyEcal = 0;
558  dRSC_first = 999;
559  dRSC_second = 9999;
560  nbSC = 0;
561  nBasicClus = 0;
562 
563  // First cut on momentum magnitude
564  h_Momentum->Fill(track->p());
565  if (track->pt() < 10.)
566  continue;
567  h_cut_Ptmin->Fill(0.5);
568 
569  // calculating track parameters at innermost and outermost for Gsf tracks
570  TrajectoryStateOnSurface inTSOS = mtsTransform.innerStateOnSurface(*track);
571  TrajectoryStateOnSurface outTSOS = mtsTransform.outerStateOnSurface(*track);
572  if (inTSOS.isValid() && outTSOS.isValid()) {
573  GlobalVector inMom;
574  //multiTrajectoryStateMode::momentumFromModeCartesian(inTSOS, inMom_);
576  pin = inMom.mag();
577  etaIn = inMom.eta();
578  phiIn = inMom.phi();
579  GlobalVector outMom;
580  //multiTrajectoryStateMode::momentumFromModeCartesian(outTSOS, outMom_);
582  pout = outMom.mag();
583  etaOut = outMom.eta();
584  phiOut = outMom.phi();
585  fbrem = (pin - pout) / pin;
586  h_fBREM->Fill(fbrem);
587  }
588 
589  // Matching track with Hcal rec hits
590  EnergyHcalIn01 = 0;
591  EnergyHcalIn02 = 0;
592  EnergyHcalIn03 = 0;
593  EnergyHcalIn04 = 0;
594  EnergyHcalIn05 = 0;
595 
596  //for (std::vector<HBHERecHit>::const_iterator hcal = (*HcalHits).begin(); hcal != (*HcalHits).end(); hcal++) {
597  for (const auto& hcal : *HcalHits) {
598  GlobalPoint posH = geo->getPosition(hcal.detid());
599  double phihit = posH.phi();
600  double etahit = posH.eta();
601  double dR = reco::deltaR(etahit, phihit, etaOut, phiOut);
602 
603  // saving Hcal energy deposit measured for different eta-phi radius
604  if (dR < 0.1)
605  EnergyHcalIn01 += hcal.energy();
606  if (dR < 0.2)
607  EnergyHcalIn02 += hcal.energy();
608  if (dR < 0.3)
609  EnergyHcalIn03 += hcal.energy();
610  if (dR < 0.4)
611  EnergyHcalIn04 += hcal.energy();
612  if (dR < 0.5)
613  EnergyHcalIn05 += hcal.energy();
614  }
615 
616  HcalEnergy->Fill(EnergyHcalIn02);
617 
618  //Isolation against charged particles
619  MaxPtIn01 = 0.;
620  SumPtIn01 = 0.;
621  NoTrackIn0015 = true;
622  MaxPtIn02 = 0.;
623  SumPtIn02 = 0.;
624  NoTrackIn0020 = true;
625  MaxPtIn03 = 0.;
626  SumPtIn03 = 0.;
627  NoTrackIn0025 = true;
628  MaxPtIn04 = 0.;
629  SumPtIn04 = 0.;
630  NoTrackIn0030 = true;
631  MaxPtIn05 = 0.;
632  SumPtIn05 = 0.;
633  NoTrackIn0035 = true;
634  NoTrackIn0040 = true;
635 
636  for (const auto& track1 : filterTracks) {
637  if (track == track1)
638  continue;
639 
640  double etaIn1 = 0.;
641  double phiIn1 = 0.;
642 
643  TrajectoryStateOnSurface inTSOS1 = mtsTransform.innerStateOnSurface(*track1);
644  if (inTSOS1.isValid()) {
645  GlobalVector inMom1;
647  etaIn1 = inMom1.eta();
648  phiIn1 = inMom1.phi();
649  }
650 
651  if (etaIn1 == 0 && phiIn1 == 0)
652  continue;
653 
654  double dR = reco::deltaR(etaIn1, phiIn1, etaIn, phiIn);
655 
656  // different radius of inner isolation cone
657  if (dR < 0.015)
658  NoTrackIn0015 = false;
659  if (dR < 0.020)
660  NoTrackIn0020 = false;
661  if (dR < 0.025)
662  NoTrackIn0025 = false;
663  if (dR < 0.030)
664  NoTrackIn0030 = false;
665  if (dR < 0.035)
666  NoTrackIn0035 = false;
667  if (dR < 0.040)
668  NoTrackIn0040 = false;
669 
670  //calculate maximum Pt and sum Pt inside cones of different radius
671  if (dR < 0.1) {
672  SumPtIn01 += track1->pt();
673  if (track1->pt() > MaxPtIn01) {
674  MaxPtIn01 = track1->pt();
675  }
676  }
677 
678  if (dR < 0.2) {
679  SumPtIn02 += track1->pt();
680  if (track1->pt() > MaxPtIn02) {
681  MaxPtIn02 = track1->pt();
682  }
683  }
684  if (dR < 0.3) {
685  SumPtIn03 += track1->pt();
686  if (track1->pt() > MaxPtIn03) {
687  MaxPtIn03 = track1->pt();
688  }
689  }
690  if (dR < 0.4) {
691  SumPtIn04 += track1->pt();
692  if (track1->pt() > MaxPtIn04) {
693  MaxPtIn04 = track1->pt();
694  }
695  }
696  if (dR < 0.5) {
697  SumPtIn05 += track1->pt();
698  if (track1->pt() > MaxPtIn05) {
699  MaxPtIn05 = track1->pt();
700  }
701  }
702  }
703 
704  // Track-SuperCluster matching
705 
706  double dRSC;
707  double etaAtEcal = 0; // to convert eta from track to detector frame
708  etaAtEcal = eopUtils::ecalEta(etaIn, vert.z(), (vert.position()).rho());
709 
710  //Barrel
711  if (std::abs(track->eta()) < k_etaBarrel) {
712  for (const auto& SC : *BarrelSupClusCollection) {
713  dRSC = reco::deltaR(SC.eta(), SC.phi(), etaAtEcal, phiIn);
714 
715  if (dRSC < dRSC_first) {
716  dRSC_first = dRSC;
717  } // distance in eta-phi plan to closest SC
718  else if (dRSC < dRSC_second) {
719  dRSC_second = dRSC;
720  } // to next closest SC
721 
722  if (dRSC < 0.09) {
723  //Calculate phiWidth & etaWidth for associated SuperClusters
724  SCShape.Calculate_Covariances(SC);
725  phiWidth = SCShape.phiWidth();
726  etaWidth = SCShape.etaWidth();
727 
728  etaSC = SC.eta();
729  phiSC = SC.phi();
730 
731  algo_ID = SC.algoID();
732  EnergyEcal = SC.energy();
733  nBasicClus = SC.clustersSize();
734  nbSC++;
735  isBarrel = true;
736  }
737  }
738  }
739 
740  // Endcap
741  if (std::abs(track->eta()) > k_etaEndcap) {
742  for (const auto& SC : *EndcapSupClusCollection) {
743  dRSC = reco::deltaR(SC.eta(), SC.phi(), etaAtEcal, phiIn);
744 
745  if (dRSC < dRSC_first) {
746  dRSC_first = dRSC;
747  } // distance in eta-phi plan to closest SC
748  else if (dRSC < dRSC_second) {
749  dRSC_second = dRSC;
750  } // to next closest SC
751 
752  if (dRSC < 0.09) {
753  //Calculate phiWidth & etaWidth for associated SuperClusters
754  SCShape.Calculate_Covariances(SC);
755  phiWidth = SCShape.phiWidth();
756  etaWidth = SCShape.etaWidth();
757 
758  etaSC = SC.eta();
759  phiSC = SC.phi();
760 
761  algo_ID = SC.algoID();
762  EnergyEcal = SC.energy();
763  nBasicClus = SC.clustersSize();
764  nbSC++;
765  isEndcap = true;
766  }
767  }
768  }
769 
770  if (dRSC_first < 0.1)
771  h_distToClosestSC->Fill(dRSC_first);
772  if (nbSC == 1)
773  h_counter1->Fill(0.5);
774  if (nbSC == 0)
775  h_counter2->Fill(0.5);
776 
777  if (nbSC > 1 || nbSC == 0)
778  continue;
779  h_cut_OneSCmatch->Fill(0.5);
780 
781  if (isBarrel && isEndcap) {
782  edm::LogError("EopElecTreeWriter") << "Error: Super Cluster double matching!";
783  return;
784  }
785 
786  h_EcalEnergy->Fill(EnergyEcal);
787  HcalVSEcal->Fill(EnergyEcal, EnergyHcalIn02);
788 
789  // E over p plots
790  if (track->charge() < 0)
791  h_Eop_InnerNegative->Fill(EnergyEcal / pin);
792  if (track->charge() > 0)
793  h_Eop_InnerPositive->Fill(EnergyEcal / pin);
794 
795  //Check if track-SuperCluster matching is Ecal or Tracker driven
796  edm::RefToBase<TrajectorySeed> seed = track->extra()->seedRef();
797  if (seed.isNull()) {
798  edm::LogError("GsfElectronCore") << "The GsfTrack has no seed ?!";
799  } else {
801  if (elseed.isNull()) {
802  edm::LogError("GsfElectronCore") << "The GsfTrack seed is not an ElectronSeed ?!";
803  } else {
804  isEcalDriven = elseed->isEcalDriven();
805  isTrackerDriven = elseed->isTrackerDriven();
806  }
807  }
808 
809  treeMemPtr_->charge = track->charge();
810  treeMemPtr_->nHits = track->numberOfValidHits();
811  treeMemPtr_->nLostHits = track->numberOfLostHits();
812  treeMemPtr_->innerOk = track->innerOk();
813  treeMemPtr_->outerRadius = track->outerRadius();
814  treeMemPtr_->chi2 = track->chi2();
815  treeMemPtr_->normalizedChi2 = track->normalizedChi2();
816  treeMemPtr_->px = track->px();
817  treeMemPtr_->py = track->py();
818  treeMemPtr_->pz = track->pz();
819  treeMemPtr_->p = track->p();
820  treeMemPtr_->pIn = pin;
821  treeMemPtr_->etaIn = etaIn;
822  treeMemPtr_->phiIn = phiIn;
823  treeMemPtr_->pOut = pout;
824  treeMemPtr_->etaOut = etaOut;
825  treeMemPtr_->phiOut = phiOut;
826  treeMemPtr_->pt = track->pt();
827  treeMemPtr_->ptError = track->ptError();
828  treeMemPtr_->theta = track->theta();
829  treeMemPtr_->eta = track->eta();
830  treeMemPtr_->phi = track->phi();
832  treeMemPtr_->MaxPtIn01 = MaxPtIn01;
833  treeMemPtr_->SumPtIn01 = SumPtIn01;
834  treeMemPtr_->NoTrackIn0015 = NoTrackIn0015;
835  treeMemPtr_->MaxPtIn02 = MaxPtIn02;
836  treeMemPtr_->SumPtIn02 = SumPtIn02;
837  treeMemPtr_->NoTrackIn0020 = NoTrackIn0020;
838  treeMemPtr_->MaxPtIn03 = MaxPtIn03;
839  treeMemPtr_->SumPtIn03 = SumPtIn03;
840  treeMemPtr_->NoTrackIn0025 = NoTrackIn0025;
841  treeMemPtr_->MaxPtIn04 = MaxPtIn04;
842  treeMemPtr_->SumPtIn04 = SumPtIn04;
843  treeMemPtr_->NoTrackIn0030 = NoTrackIn0030;
844  treeMemPtr_->MaxPtIn05 = MaxPtIn05;
845  treeMemPtr_->SumPtIn05 = SumPtIn05;
846  treeMemPtr_->NoTrackIn0035 = NoTrackIn0035;
847  treeMemPtr_->NoTrackIn0040 = NoTrackIn0040;
848  treeMemPtr_->SC_algoID = algo_ID;
849  treeMemPtr_->SC_energy = EnergyEcal;
850  treeMemPtr_->SC_nBasicClus = nBasicClus;
853  treeMemPtr_->SC_eta = etaSC;
854  treeMemPtr_->SC_phi = phiSC;
857  treeMemPtr_->dRto1stSC = dRSC_first;
858  treeMemPtr_->dRto2ndSC = dRSC_second;
859  treeMemPtr_->HcalEnergyIn01 = EnergyHcalIn01;
860  treeMemPtr_->HcalEnergyIn02 = EnergyHcalIn02;
861  treeMemPtr_->HcalEnergyIn03 = EnergyHcalIn03;
862  treeMemPtr_->HcalEnergyIn04 = EnergyHcalIn04;
863  treeMemPtr_->HcalEnergyIn05 = EnergyHcalIn05;
865  treeMemPtr_->isTrackerDriven = isTrackerDriven;
866  treeMemPtr_->RunNumber = iEvent.id().run();
867  treeMemPtr_->EvtNumber = iEvent.id().event();
868 
869  tree_->Fill();
870 
871  } // loop on tracks
872 } // analyze
bool accept() const
Has at least one path accepted the event?
const edm::EDGetTokenT< reco::SuperClusterCollection > theEndCapSupClusCollectionToken_
unsigned int prescaleSize() const
bool error() const
Has any path encountered an error (exception)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:26
double z() const
z coordinate
Definition: Vertex.h:134
Double_t px_rejected_track
const edm::EDGetTokenT< HBHERecHitCollection > theHBHERecHitCollectionToken_
std::vector< std::string > triggerNames_
const Point & position() const
position
Definition: Vertex.h:128
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T eta() const
Definition: PV3DBase.h:73
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
float ecalEta(float EtaParticle, float Zvertex, float RhoVertex)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
Log< level::Error, false > LogError
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
EopElecVariables * treeMemPtr_
std::vector< TPRegexp > filters
Definition: eve_filter.cc:22
bool wasrun() const
Was at least one path run?
T prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
const edm::EDGetTokenT< EcalRecHitCollection > theEcalRecHitCollectionToken_
const edm::EDGetTokenT< reco::SuperClusterCollection > theBarrelSupClusCollectionToken_
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
int iEvent
Definition: GenABIO.cc:224
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
const edm::EDGetTokenT< reco::GsfElectronCoreCollection > theGsfElectronCoreCollectionToken_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
static constexpr float k_etaBarrel
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< GsfElectronCore > GsfElectronCoreCollection
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
T mag() const
Definition: PV3DBase.h:64
const edm::EDGetTokenT< reco::VertexCollection > theVertexCollectionToken_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const edm::EDGetTokenT< edm::TriggerResults > theTriggerResultsToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
HLTConfigProvider hltConfig_
Double_t p_rejected_track
bool isNull() const
Checks for null.
Definition: Ref.h:235
bool isEndcap(GeomDetEnumerators::SubDetector m)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
Log< level::Info, false > LogInfo
const edm::EDGetTokenT< trigger::TriggerEvent > theTriggerEventToken_
Definition: deltar.py:1
std::vector< size_type > Keys
Double_t pz_rejected_track
bool momentumFromModePPhiEta(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
HLT enums.
static constexpr float k_etaEndcap
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
const edm::EDGetTokenT< reco::GsfTrackCollection > theGsfTrackCollectionToken_
Double_t py_rejected_track

◆ beginRun()

void EopElecTreeWriter::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 881 of file EopElecTreeWriter.cc.

References debugTriggerSelection_, hltConfig_, mps_fire::i, HLTConfigProvider::init(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, HLTConfigProvider::triggerNames(), and triggerNames_.

881  {
882  bool changed = true;
883 
884  // Load trigger configuration at each begin of run
885  // Fill the trigger names
886  if (hltConfig_.init(iRun, iSetup, "HLT", changed)) {
887  if (changed) {
889  }
890  }
891 
892  // Displaying the trigger names
894  unsigned int i = 0;
895  for (const auto& it : triggerNames_) {
896  edm::LogInfo("EopElecTreeWriter") << "HLTpath: " << (i++) << " = " << it;
897  }
898  }
899 }
std::vector< std::string > triggerNames_
HLTConfigProvider hltConfig_
Log< level::Info, false > LogInfo
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
const std::vector< std::string > & triggerNames() const
names of trigger paths

◆ endJob()

void EopElecTreeWriter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 875 of file EopElecTreeWriter.cc.

References treeMemPtr_.

Referenced by o2olib.O2ORunMgr::executeJob().

875  {
876  delete treeMemPtr_;
877  treeMemPtr_ = nullptr;
878 }
EopElecVariables * treeMemPtr_

◆ endRun()

void EopElecTreeWriter::endRun ( const edm::Run ,
const edm::EventSetup  
)
inlineoverrideprivate

Definition at line 111 of file EopElecTreeWriter.cc.

111 {};

◆ fillDescriptions()

void EopElecTreeWriter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 902 of file EopElecTreeWriter.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

904 {
906  desc.setComment("Generate tree for Tracker Alignment E/p validation");
907  desc.add<edm::InputTag>("src", edm::InputTag("electronGsfTracks"));
908  desc.add<std::string>("triggerPath", "HLT_Ele");
909  desc.add<std::string>("hltFilter", "hltDiEle27L1DoubleEGWPTightHcalIsoFilter");
910  desc.add<bool>("debugTriggerSelection", false);
911  descriptions.addWithDefaultLabel(desc);
912 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ caloGeomToken_

const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> EopElecTreeWriter::caloGeomToken_
private

Definition at line 119 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ debugTriggerSelection_

bool EopElecTreeWriter::debugTriggerSelection_
private

Definition at line 139 of file EopElecTreeWriter.cc.

Referenced by analyze(), and beginRun().

◆ fs_

edm::Service<TFileService> EopElecTreeWriter::fs_
private

Definition at line 140 of file EopElecTreeWriter.cc.

Referenced by EopElecTreeWriter().

◆ h_counter1

TH1D* EopElecTreeWriter::h_counter1
private

Definition at line 167 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_counter2

TH1D* EopElecTreeWriter::h_counter2
private

Definition at line 168 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_cut_OneSCmatch

TH1D* EopElecTreeWriter::h_cut_OneSCmatch
private

Definition at line 165 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_cut_Ptmin

TH1D* EopElecTreeWriter::h_cut_Ptmin
private

Definition at line 164 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_distToClosestSC

TH1D* EopElecTreeWriter::h_distToClosestSC
private

Definition at line 171 of file EopElecTreeWriter.cc.

Referenced by analyze(), EopElecTreeWriter(), and ~EopElecTreeWriter().

◆ h_distToClosestSCgsf

TH1D* EopElecTreeWriter::h_distToClosestSCgsf
private

Definition at line 170 of file EopElecTreeWriter.cc.

Referenced by analyze(), EopElecTreeWriter(), and ~EopElecTreeWriter().

◆ h_EcalEnergy

TH1D* EopElecTreeWriter::h_EcalEnergy
private

Definition at line 172 of file EopElecTreeWriter.cc.

Referenced by analyze(), EopElecTreeWriter(), and ~EopElecTreeWriter().

◆ h_Eop_InnerNegative

TH1D* EopElecTreeWriter::h_Eop_InnerNegative
private

Definition at line 176 of file EopElecTreeWriter.cc.

Referenced by analyze(), EopElecTreeWriter(), and ~EopElecTreeWriter().

◆ h_Eop_InnerPositive

TH1D* EopElecTreeWriter::h_Eop_InnerPositive
private

Definition at line 177 of file EopElecTreeWriter.cc.

Referenced by analyze(), EopElecTreeWriter(), and ~EopElecTreeWriter().

◆ h_fBREM

TH1D* EopElecTreeWriter::h_fBREM
private

Definition at line 175 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_Momentum

TH1D* EopElecTreeWriter::h_Momentum
private

Definition at line 173 of file EopElecTreeWriter.cc.

Referenced by analyze(), EopElecTreeWriter(), and ~EopElecTreeWriter().

◆ h_nEvents

TH1D* EopElecTreeWriter::h_nEvents
private

Definition at line 150 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_nEvents2Elec

TH1D* EopElecTreeWriter::h_nEvents2Elec
private

Definition at line 156 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_nEventsHLTelectron

TH1D* EopElecTreeWriter::h_nEventsHLTelectron
private

Definition at line 154 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_nEventsHLTFilter

TH1D* EopElecTreeWriter::h_nEventsHLTFilter
private

Definition at line 153 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_nEventsHLTrejected

TH1D* EopElecTreeWriter::h_nEventsHLTrejected
private

Definition at line 155 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_nEventsTriggered

TH1D* EopElecTreeWriter::h_nEventsTriggered
private

Definition at line 152 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_nEventsWithVertex

TH1D* EopElecTreeWriter::h_nEventsWithVertex
private

Definition at line 151 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_nHLTelectrons

TH1D* EopElecTreeWriter::h_nHLTelectrons
private

Definition at line 157 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_nTracks

TH1D* EopElecTreeWriter::h_nTracks
private

Definition at line 162 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_nTracksFiltered

TH1D* EopElecTreeWriter::h_nTracksFiltered
private

Definition at line 163 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_nTrkRejectedPerEvt

TH1D* EopElecTreeWriter::h_nTrkRejectedPerEvt
private

Definition at line 158 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ h_nTrkSelectedPerEvt

TH1D* EopElecTreeWriter::h_nTrkSelectedPerEvt
private

Definition at line 159 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ HcalEnergy

TH1D* EopElecTreeWriter::HcalEnergy
private

Definition at line 174 of file EopElecTreeWriter.cc.

Referenced by analyze(), EopElecTreeWriter(), and ~EopElecTreeWriter().

◆ HcalVSEcal

TH2D* EopElecTreeWriter::HcalVSEcal
private

Definition at line 179 of file EopElecTreeWriter.cc.

Referenced by analyze(), EopElecTreeWriter(), and ~EopElecTreeWriter().

◆ hltConfig_

HLTConfigProvider EopElecTreeWriter::hltConfig_
private

Definition at line 143 of file EopElecTreeWriter.cc.

Referenced by analyze(), and beginRun().

◆ k_etaBarrel

constexpr float EopElecTreeWriter::k_etaBarrel = 1.55
staticprivate

Definition at line 133 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ k_etaEndcap

constexpr float EopElecTreeWriter::k_etaEndcap = 1.44
staticprivate

Definition at line 134 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ magFieldToken_

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> EopElecTreeWriter::magFieldToken_
private

Definition at line 117 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ mtsTransform_

MultiTrajectoryStateTransform* EopElecTreeWriter::mtsTransform_
private

Definition at line 145 of file EopElecTreeWriter.cc.

◆ theBarrelSupClusCollectionToken_

const edm::EDGetTokenT<reco::SuperClusterCollection> EopElecTreeWriter::theBarrelSupClusCollectionToken_
private

Definition at line 125 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ theEcalRecHitCollectionToken_

const edm::EDGetTokenT<EcalRecHitCollection> EopElecTreeWriter::theEcalRecHitCollectionToken_
private

Definition at line 124 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ theEndCapSupClusCollectionToken_

const edm::EDGetTokenT<reco::SuperClusterCollection> EopElecTreeWriter::theEndCapSupClusCollectionToken_
private

Definition at line 126 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ theFilter_

std::string EopElecTreeWriter::theFilter_
private

Definition at line 138 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ theGsfElectronCoreCollectionToken_

const edm::EDGetTokenT<reco::GsfElectronCoreCollection> EopElecTreeWriter::theGsfElectronCoreCollectionToken_
private

Definition at line 130 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ theGsfTrackCollectionToken_

const edm::EDGetTokenT<reco::GsfTrackCollection> EopElecTreeWriter::theGsfTrackCollectionToken_
private

Definition at line 129 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ theHBHERecHitCollectionToken_

const edm::EDGetTokenT<HBHERecHitCollection> EopElecTreeWriter::theHBHERecHitCollectionToken_
private

Definition at line 123 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ theTrigger_

std::string EopElecTreeWriter::theTrigger_
private

Definition at line 137 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ theTriggerEventToken_

const edm::EDGetTokenT<trigger::TriggerEvent> EopElecTreeWriter::theTriggerEventToken_
private

Definition at line 128 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ theTriggerResultsToken_

const edm::EDGetTokenT<edm::TriggerResults> EopElecTreeWriter::theTriggerResultsToken_
private

Definition at line 127 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ theVertexCollectionToken_

const edm::EDGetTokenT<reco::VertexCollection> EopElecTreeWriter::theVertexCollectionToken_
private

Definition at line 122 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ tkGeomToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> EopElecTreeWriter::tkGeomToken_
private

Definition at line 118 of file EopElecTreeWriter.cc.

Referenced by analyze().

◆ tree_

TTree* EopElecTreeWriter::tree_
private

Definition at line 141 of file EopElecTreeWriter.cc.

Referenced by analyze(), and EopElecTreeWriter().

◆ treeMemPtr_

EopElecVariables* EopElecTreeWriter::treeMemPtr_
private

Definition at line 142 of file EopElecTreeWriter.cc.

Referenced by analyze(), endJob(), and EopElecTreeWriter().

◆ triggerNames_

std::vector<std::string> EopElecTreeWriter::triggerNames_
private

Definition at line 144 of file EopElecTreeWriter.cc.

Referenced by analyze(), and beginRun().