CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
AlCaHBHEMuonFilter Class Reference
Inheritance diagram for AlCaHBHEMuonFilter:
edm::stream::EDFilter< edm::GlobalCache< AlCaHBHEMuons::Counters > > edm::stream::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 AlCaHBHEMuonFilter (edm::ParameterSet const &, const AlCaHBHEMuons::Counters *count)
 
virtual void endStream () override
 
virtual bool filter (edm::Event &, edm::EventSetup const &) override
 
 ~AlCaHBHEMuonFilter ()
 
- Public Member Functions inherited from edm::stream::EDFilter< edm::GlobalCache< AlCaHBHEMuons::Counters > >
 EDFilter ()=default
 
- Public Member Functions inherited from edm::stream::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilterBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void globalEndJob (const AlCaHBHEMuons::Counters *counters)
 
static std::unique_ptr
< AlCaHBHEMuons::Counters
initializeGlobalCache (edm::ParameterSet const &)
 
- Static Public Member Functions inherited from edm::stream::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

HLTConfigProvider hltConfig_
 
std::vector< std::string > HLTNames_
 
edm::InputTag labelMuon_
 
unsigned int nAll_
 
unsigned int nGood_
 
unsigned int nRun_
 
std::string processName_
 
edm::EDGetTokenT
< reco::MuonCollection
tok_Muon_
 
edm::EDGetTokenT
< trigger::TriggerEvent
tok_trigEvt
 
edm::EDGetTokenT
< edm::TriggerResults
tok_trigRes_
 
edm::InputTag triggerResults_
 
std::vector< std::string > trigNames_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDFilter< edm::GlobalCache< AlCaHBHEMuons::Counters > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDFilterBase
typedef EDFilterAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 

Detailed Description

Definition at line 49 of file AlCaHBHEMuonFilter.cc.

Constructor & Destructor Documentation

AlCaHBHEMuonFilter::AlCaHBHEMuonFilter ( edm::ParameterSet const &  iConfig,
const AlCaHBHEMuons::Counters count 
)
explicit

Definition at line 90 of file AlCaHBHEMuonFilter.cc.

References edm::ParameterSet::getParameter(), relval_steps::k, labelMuon_, processName_, AlCaHLTBitMon_QueryRunRegistry::string, tok_Muon_, tok_trigRes_, triggerResults_, and trigNames_.

90  :
91  nRun_(0), nAll_(0), nGood_(0) {
92  //now do what ever initialization is needed
93  trigNames_ = iConfig.getParameter<std::vector<std::string> >("Triggers");
94  processName_ = iConfig.getParameter<std::string>("ProcessName");
95  triggerResults_ = iConfig.getParameter<edm::InputTag>("TriggerResultLabel");
96  labelMuon_ = iConfig.getParameter<edm::InputTag>("MuonLabel");
97 
98  // define tokens for access
99  tok_trigRes_ = consumes<edm::TriggerResults>(triggerResults_);
100  tok_Muon_ = consumes<reco::MuonCollection>(labelMuon_);
101  edm::LogInfo("HcalHBHEMuon") << "Parameters read from config file \n"
102  << "Process " << processName_;
103  for (unsigned int k=0; k<trigNames_.size(); ++k)
104  edm::LogInfo("HcalHBHEMuon") << "Trigger[" << k << "] " << trigNames_[k];
105 } // AlCaHBHEMuonFilter::AlCaHBHEMuonFilter constructor
edm::InputTag labelMuon_
edm::EDGetTokenT< reco::MuonCollection > tok_Muon_
edm::InputTag triggerResults_
std::vector< std::string > trigNames_
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
AlCaHBHEMuonFilter::~AlCaHBHEMuonFilter ( )

Definition at line 108 of file AlCaHBHEMuonFilter.cc.

108 {}

Member Function Documentation

void AlCaHBHEMuonFilter::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 212 of file AlCaHBHEMuonFilter.cc.

References hltConfig_, HLTConfigProvider::init(), nRun_, processName_, and edm::RunBase::run().

212  {
213  bool changed(false);
214  bool flag = hltConfig_.init(iRun, iSetup, processName_, changed);
215  edm::LogInfo("HcalHBHEMuon") << "Run[" << nRun_ << "] " << iRun.run()
216  << " hltconfig.init " << flag;
217 }
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
HLTConfigProvider hltConfig_
void AlCaHBHEMuonFilter::endRun ( edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 220 of file AlCaHBHEMuonFilter.cc.

References nRun_, and edm::RunBase::run().

220  {
221  edm::LogInfo("HcalHBHEMuon") << "endRun[" << nRun_ << "] " << iRun.run();
222  nRun_++;
223 }
void AlCaHBHEMuonFilter::endStream ( )
overridevirtual

Reimplemented from edm::stream::EDFilterBase.

Definition at line 200 of file AlCaHBHEMuonFilter.cc.

References nAll_, and nGood_.

200  {
201  globalCache()->nAll_ += nAll_;
202  globalCache()->nGood_ += nGood_;
203 }
void AlCaHBHEMuonFilter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 227 of file AlCaHBHEMuonFilter.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

227  {
228  //The following says we do not know what parameters are allowed so do no validation
229  // Please change this to state exactly what you do use, even if it is no parameters
231  desc.setUnknown();
232  descriptions.addDefault(desc);
233 }
void addDefault(ParameterSetDescription const &psetDescription)
bool AlCaHBHEMuonFilter::filter ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements edm::stream::EDFilterBase.

Definition at line 115 of file AlCaHBHEMuonFilter.cc.

References accept(), ecalTB2006H4_GenSimDigiReco_cfg::bField, edm::EventBase::bunchCrossing(), edm::EventID::event(), spr::find(), edm::EventSetup::get(), edm::Event::getByToken(), runregparse::hlt, i, edm::EventBase::id(), edm::HandleBase::isValid(), edm::EventBase::luminosityBlock(), edmConvertToStreamModule::modules, nAll_, nGood_, convertSQLiteXML::ok, spr::propagatedTrackID::okECAL, spr::propagatedTrackID::okHCAL, edm::ESHandle< class >::product(), spr::propagateCALO(), edm::EventID::run(), tok_Muon_, tok_trigRes_, edm::TriggerNames::triggerNames(), edm::Event::triggerNames(), triggerResults, and trigNames_.

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

115  {
116  bool accept(false);
117  ++nAll_;
118 #ifdef DebugLog
119  edm::LogInfo("HcalHBHEMuon") << "AlCaHBHEMuonFilter::Run "
120  << iEvent.id().run() << " Event "
121  << iEvent.id().event() << " Luminosity "
122  << iEvent.luminosityBlock() << " Bunch "
123  << iEvent.bunchCrossing();
124 #endif
125  //Step1: Find if the event passes one of the chosen triggers
128  iEvent.getByToken(tok_trigRes_, triggerResults);
129  if (triggerResults.isValid()) {
130  bool ok(false);
131  std::vector<std::string> modules;
132  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
133  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
134  for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
135  int hlt = triggerResults->accept(iHLT);
136  for (unsigned int i=0; i<trigNames_.size(); ++i) {
137  if (triggerNames_[iHLT].find(trigNames_[i].c_str())!=std::string::npos){
138  if (hlt > 0) {
139  ok = true;
140  }
141 #ifdef DebugLog
142  edm::LogInfo("HcalHBHEMuon") << "AlCaHBHEMuonFilter::Trigger "
143  << triggerNames_[iHLT] << " Flag "
144  << hlt << ":" << ok;
145 #endif
146  }
147  }
148  }
149  if (ok) {
150  //Step2: Get geometry/B-field information
151  //Get magnetic field
153  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
154  const MagneticField *bField = bFieldH.product();
155  // get handles to calogeometry
157  iSetup.get<CaloGeometryRecord>().get(pG);
158  const CaloGeometry* geo = pG.product();
159 
160  // Relevant blocks from iEvent
162  iEvent.getByToken(tok_Muon_, _Muon);
163 #ifdef DebugLog
164  edm::LogInfo("HcalHBHEMuon") << "AlCaHBHEMuonFilter::Muon Handle "
165  << _Muon.isValid();
166 #endif
167  if (_Muon.isValid()) {
168  for (reco::MuonCollection::const_iterator RecMuon = _Muon->begin();
169  RecMuon!= _Muon->end(); ++RecMuon) {
170 #ifdef DebugLog
171  edm::LogInfo("HcalHBHEMuon") << "AlCaHBHEMuonFilter::Muon:Track " << RecMuon->track().isNonnull() << " innerTrack " << RecMuon->innerTrack().isNonnull() << " outerTrack " << RecMuon->outerTrack().isNonnull() << " globalTrack " << RecMuon->globalTrack().isNonnull();
172 #endif
173  if ((RecMuon->track().isNonnull()) &&
174  (RecMuon->innerTrack().isNonnull()) &&
175  (RecMuon->outerTrack().isNonnull()) &&
176  (RecMuon->globalTrack().isNonnull())) {
177  const reco::Track* pTrack = (RecMuon->innerTrack()).get();
178  spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo, bField, false);
179 #ifdef DebugLog
180  edm::LogInfo("HcalHBHEMuon")<<"AlCaHBHEMuonFilter::Propagate: ECAL "
181  << trackID.okECAL << " to HCAL "
182  << trackID.okHCAL;
183 #endif
184  if ((trackID.okECAL) && (trackID.okHCAL)) {
185  accept = true;
186  break;
187  }
188  }
189  }
190  }
191  }
192  }
193  // Step 4: Return the acceptance flag
194  if (accept) ++nGood_;
195  return accept;
196 
197 } // AlCaHBHEMuonFilter::filter
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:220
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
edm::EDGetTokenT< reco::MuonCollection > tok_Muon_
int bunchCrossing() const
Definition: EventBase.h:66
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:24
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
static std::string const triggerResults
Definition: EdmProvDump.cc:40
bool isValid() const
Definition: HandleBase.h:75
T const * product() const
Definition: ESHandle.h:86
edm::EventID id() const
Definition: EventBase.h:60
std::vector< std::string > trigNames_
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
void AlCaHBHEMuonFilter::globalEndJob ( const AlCaHBHEMuons::Counters counters)
static

Definition at line 205 of file AlCaHBHEMuonFilter.cc.

References AlCaHBHEMuons::Counters::nAll_, and AlCaHBHEMuons::Counters::nGood_.

205  {
206  edm::LogInfo("HcalHBHEMuon") << "Selects " << count->nGood_ << " in "
207  << count->nAll_ << " events";
208 }
static std::unique_ptr<AlCaHBHEMuons::Counters> AlCaHBHEMuonFilter::initializeGlobalCache ( edm::ParameterSet const &  )
inlinestatic

Definition at line 54 of file AlCaHBHEMuonFilter.cc.

54  {
55  return std::unique_ptr<AlCaHBHEMuons::Counters>(new AlCaHBHEMuons::Counters());
56  }

Member Data Documentation

HLTConfigProvider AlCaHBHEMuonFilter::hltConfig_
private

Definition at line 69 of file AlCaHBHEMuonFilter.cc.

Referenced by beginRun().

std::vector<std::string> AlCaHBHEMuonFilter::HLTNames_
private

Definition at line 70 of file AlCaHBHEMuonFilter.cc.

edm::InputTag AlCaHBHEMuonFilter::labelMuon_
private

Definition at line 73 of file AlCaHBHEMuonFilter.cc.

Referenced by AlCaHBHEMuonFilter().

unsigned int AlCaHBHEMuonFilter::nAll_
private

Definition at line 72 of file AlCaHBHEMuonFilter.cc.

Referenced by endStream(), and filter().

unsigned int AlCaHBHEMuonFilter::nGood_
private

Definition at line 72 of file AlCaHBHEMuonFilter.cc.

Referenced by endStream(), and filter().

unsigned int AlCaHBHEMuonFilter::nRun_
private

Definition at line 72 of file AlCaHBHEMuonFilter.cc.

Referenced by beginRun(), and endRun().

std::string AlCaHBHEMuonFilter::processName_
private

Definition at line 71 of file AlCaHBHEMuonFilter.cc.

Referenced by AlCaHBHEMuonFilter(), and beginRun().

edm::EDGetTokenT<reco::MuonCollection> AlCaHBHEMuonFilter::tok_Muon_
private

Definition at line 76 of file AlCaHBHEMuonFilter.cc.

Referenced by AlCaHBHEMuonFilter(), and filter().

edm::EDGetTokenT<trigger::TriggerEvent> AlCaHBHEMuonFilter::tok_trigEvt
private

Definition at line 74 of file AlCaHBHEMuonFilter.cc.

edm::EDGetTokenT<edm::TriggerResults> AlCaHBHEMuonFilter::tok_trigRes_
private

Definition at line 75 of file AlCaHBHEMuonFilter.cc.

Referenced by AlCaHBHEMuonFilter(), and filter().

edm::InputTag AlCaHBHEMuonFilter::triggerResults_
private

Definition at line 73 of file AlCaHBHEMuonFilter.cc.

Referenced by AlCaHBHEMuonFilter().

std::vector<std::string> AlCaHBHEMuonFilter::trigNames_
private

Definition at line 70 of file AlCaHBHEMuonFilter.cc.

Referenced by AlCaHBHEMuonFilter(), and filter().