CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SiStripMonitorHLT Class Reference

#include <SiStripMonitorHLT.h>

Inheritance diagram for SiStripMonitorHLT:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
virtual void endJob ()
 
 SiStripMonitorHLT (const edm::ParameterSet &)
 
 ~SiStripMonitorHLT ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

MonitorElementChargeOfEachClusterTEC_all
 
MonitorElementChargeOfEachClusterTEC_hlt
 
MonitorElementChargeOfEachClusterTIB_all
 
MonitorElementChargeOfEachClusterTIB_hlt
 
MonitorElementChargeOfEachClusterTOB_all
 
MonitorElementChargeOfEachClusterTOB_hlt
 
edm::EDGetTokenT< std::map
< uint, std::vector
< SiStripCluster > > > 
clusterInSubComponentsToken_
 
edm::ParameterSet conf_
 
DQMStoredqmStore_
 
edm::EDGetTokenT< int > filerDecisionToken_
 
MonitorElementHLTDecision
 
std::string HLTDirectory
 
MonitorElementNumberOfClustersAboveThreshold_all
 
MonitorElementNumberOfClustersAboveThreshold_hlt
 
MonitorElementSumOfClusterCharges_all
 
MonitorElementSumOfClusterCharges_hlt
 
edm::EDGetTokenT< uint > sumOfClusterToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
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::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 25 of file SiStripMonitorHLT.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file SiStripMonitorHLT.cc.

References clusterInSubComponentsToken_, conf_, dqmStore_, filerDecisionToken_, edm::ParameterSet::getParameter(), HLTDirectory, cppFunctionSkipper::operator, AlCaHLTBitMon_QueryRunRegistry::string, and sumOfClusterToken_.

23 {
24  HLTDirectory="HLTResults";
26  conf_ = iConfig;
27 
28  filerDecisionToken_ = consumes<int>(conf_.getParameter<std::string>("HLTProducer") );
29  sumOfClusterToken_ = consumes<uint>(conf_.getParameter<std::string>("HLTProducer") );
30  clusterInSubComponentsToken_ = consumes<std::map<uint,std::vector<SiStripCluster> > >(conf_.getParameter<std::string>("HLTProducer") );
31 }
T getParameter(std::string const &) const
std::string HLTDirectory
edm::EDGetTokenT< std::map< uint, std::vector< SiStripCluster > > > clusterInSubComponentsToken_
edm::EDGetTokenT< int > filerDecisionToken_
edm::ParameterSet conf_
edm::EDGetTokenT< uint > sumOfClusterToken_
SiStripMonitorHLT::~SiStripMonitorHLT ( )
inline

Definition at line 28 of file SiStripMonitorHLT.h.

28 {};

Member Function Documentation

void SiStripMonitorHLT::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 58 of file SiStripMonitorHLT.cc.

References ChargeOfEachClusterTEC_all, ChargeOfEachClusterTEC_hlt, ChargeOfEachClusterTIB_all, ChargeOfEachClusterTIB_hlt, ChargeOfEachClusterTOB_all, ChargeOfEachClusterTOB_hlt, clusterInSubComponentsToken_, conf_, filerDecisionToken_, MonitorElement::Fill(), edm::Event::getByToken(), edm::ParameterSet::getParameter(), HLTDecision, python.multivaluedict::map(), NumberOfClustersAboveThreshold_all, NumberOfClustersAboveThreshold_hlt, AlCaHLTBitMon_QueryRunRegistry::string, SumOfClusterCharges_all, SumOfClusterCharges_hlt, and sumOfClusterToken_.

59 {
60 
61  // get from event
62  std::string HLTProducer = conf_.getParameter<std::string>("HLTProducer");
63  edm::Handle<int> filter_decision; iEvent.getByToken(filerDecisionToken_,filter_decision); // filter decision
64  edm::Handle<uint> sum_of_clustch; iEvent.getByToken(sumOfClusterToken_, sum_of_clustch); // sum of cluster charges
65  // first element of pair: layer: TIB1, ...., TEC; second element: nr of clusters above threshold
66  edm::Handle<std::map<uint,std::vector<SiStripCluster> > > clusters_in_subcomponents;
67  if(HLTProducer=="ClusterMTCCFilter") iEvent.getByToken(clusterInSubComponentsToken_,clusters_in_subcomponents);
68 
69  // trigger decision
70  HLTDecision->Fill(*filter_decision);
71 
72  // sum of charges of clusters
73  SumOfClusterCharges_all->Fill(*sum_of_clustch);
74  if(*filter_decision) SumOfClusterCharges_hlt->Fill(*sum_of_clustch);
75 
76  //clusters in different layers
77  if(HLTProducer=="ClusterMTCCFilter"){
78  // loop over layers ("subcomponents")
79  for(std::map<uint,std::vector<SiStripCluster> >::const_iterator it = clusters_in_subcomponents->begin(); it != clusters_in_subcomponents->end(); it++){
80  int generalized_layer = it->first;
81  std::vector<SiStripCluster> theclusters = it->second;
82  NumberOfClustersAboveThreshold_all->Fill( generalized_layer, theclusters.size() ); // number of clusters in this generalized layer
83  if(*filter_decision) NumberOfClustersAboveThreshold_hlt->Fill( generalized_layer, theclusters.size() );
84  //loop over clusters (and detids)
85  for(std::vector<SiStripCluster>::const_iterator icluster = theclusters.begin(); icluster != theclusters.end(); icluster++){
86  // calculate sum of amplitudes
87  unsigned int amplclus=0;
88  for(auto ia=icluster->amplitudes().begin(); ia!=icluster->amplitudes().end(); ia++) {
89  if ((*ia)>0) amplclus+=(*ia); // why should this be negative?
90  }
91  if(generalized_layer==31 || generalized_layer==32 || generalized_layer==33){ // you can also ask the detid here whether is TIB
92  ChargeOfEachClusterTIB_all->Fill(amplclus,1.);
93  if(*filter_decision) ChargeOfEachClusterTIB_hlt->Fill(amplclus,1.);
94  }
95  if(generalized_layer==51 || generalized_layer==52){
96  ChargeOfEachClusterTOB_all->Fill(amplclus,1.);
97  if(*filter_decision) ChargeOfEachClusterTOB_hlt->Fill(amplclus,1.);
98  }
99  if(generalized_layer==60 ){
100  ChargeOfEachClusterTEC_all->Fill(amplclus,1.);
101  if(*filter_decision) ChargeOfEachClusterTEC_hlt->Fill(amplclus,1.);
102  }
103  }
104  }
105  }
106 }
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
MonitorElement * NumberOfClustersAboveThreshold_all
void Fill(long long x)
MonitorElement * SumOfClusterCharges_all
MonitorElement * ChargeOfEachClusterTEC_hlt
MonitorElement * ChargeOfEachClusterTIB_all
MonitorElement * NumberOfClustersAboveThreshold_hlt
MonitorElement * HLTDecision
MonitorElement * ChargeOfEachClusterTEC_all
MonitorElement * SumOfClusterCharges_hlt
edm::EDGetTokenT< std::map< uint, std::vector< SiStripCluster > > > clusterInSubComponentsToken_
MonitorElement * ChargeOfEachClusterTOB_hlt
edm::EDGetTokenT< int > filerDecisionToken_
MonitorElement * ChargeOfEachClusterTIB_hlt
MonitorElement * ChargeOfEachClusterTOB_all
edm::ParameterSet conf_
edm::EDGetTokenT< uint > sumOfClusterToken_
void SiStripMonitorHLT::beginJob ( void  )
virtual

Definition at line 33 of file SiStripMonitorHLT.cc.

33  {
34 }
void SiStripMonitorHLT::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  es 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 36 of file SiStripMonitorHLT.cc.

References DQMStore::IBooker::book1D(), ChargeOfEachClusterTEC_all, ChargeOfEachClusterTEC_hlt, ChargeOfEachClusterTIB_all, ChargeOfEachClusterTIB_hlt, ChargeOfEachClusterTOB_all, ChargeOfEachClusterTOB_hlt, conf_, edm::ParameterSet::getParameter(), HLTDecision, HLTDirectory, NumberOfClustersAboveThreshold_all, NumberOfClustersAboveThreshold_hlt, DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, SumOfClusterCharges_all, and SumOfClusterCharges_hlt.

37 {
39  std::string HLTProducer = conf_.getParameter<std::string>("HLTProducer");
40  HLTDecision = ibooker.book1D(HLTProducer+"_HLTDecision", HLTProducer+"HLTDecision", 2, -0.5, 1.5);
41  // all
42  SumOfClusterCharges_all = ibooker.book1D("SumOfClusterCharges_all", "SumOfClusterCharges_all", 50, 0, 2000);
43  ChargeOfEachClusterTIB_all = ibooker.book1D("ChargeOfEachClusterTIB_all", "ChargeOfEachClusterTIB_all", 400, -0.5, 400.5);
44  ChargeOfEachClusterTOB_all = ibooker.book1D("ChargeOfEachClusterTOB_all", "ChargeOfEachClusterTOB_all", 400, -0.5, 400.5);
45  ChargeOfEachClusterTEC_all = ibooker.book1D("ChargeOfEachClusterTEC_all", "ChargeOfEachClusterTEC_all", 400, -0.5, 400.5);
46  NumberOfClustersAboveThreshold_all = ibooker.book1D("NumberOfClustersAboveThreshold_all", "NumberOfClustersAboveThreshold_all", 30, 30.5, 60.5);
47  // 31 = TIB2, 32 = TIB2, 33 = TIB3, 51 = TOB1, 52=TOB2, 60 = TEC
48  // accepted from HLT
49  SumOfClusterCharges_hlt = ibooker.book1D("SumOfClusterCharges_hlt", "SumOfClusterCharges_hlt", 50, 0, 2000);
50  ChargeOfEachClusterTIB_hlt = ibooker.book1D("ChargeOfEachClusterTIB_hlt", "ChargeOfEachClusterTIB_hlt", 400, -0.5, 400.5);
51  ChargeOfEachClusterTOB_hlt = ibooker.book1D("ChargeOfEachClusterTOB_hlt", "ChargeOfEachClusterTOB_hlt", 400, -0.5, 400.5);
52  ChargeOfEachClusterTEC_hlt = ibooker.book1D("ChargeOfEachClusterTEC_hlt", "ChargeOfEachClusterTEC_hlt", 400, -0.5, 400.5);
53  NumberOfClustersAboveThreshold_hlt = ibooker.book1D("NumberOfClustersAboveThreshold_hlt", "NumberOfClustersAboveThreshold_hlt", 30, 30.5, 60.5);
54 
55 }
T getParameter(std::string const &) const
MonitorElement * NumberOfClustersAboveThreshold_all
MonitorElement * SumOfClusterCharges_all
MonitorElement * ChargeOfEachClusterTEC_hlt
std::string HLTDirectory
MonitorElement * ChargeOfEachClusterTIB_all
MonitorElement * NumberOfClustersAboveThreshold_hlt
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * HLTDecision
MonitorElement * ChargeOfEachClusterTEC_all
MonitorElement * SumOfClusterCharges_hlt
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * ChargeOfEachClusterTOB_hlt
MonitorElement * ChargeOfEachClusterTIB_hlt
MonitorElement * ChargeOfEachClusterTOB_all
edm::ParameterSet conf_
void SiStripMonitorHLT::endJob ( void  )
virtual

Definition at line 108 of file SiStripMonitorHLT.cc.

References conf_, dqmStore_, MonitorElement::getBinContent(), edm::ParameterSet::getParameter(), HLTDecision, dumpDBToFile_GT_ttrig_cfg::outputFileName, DQMStore::save(), and AlCaHLTBitMon_QueryRunRegistry::string.

108  {
109  edm::LogInfo("DQM|SiStripMonitorHLT")<<"Events rejected/accepted "<<HLTDecision->getBinContent(1)<<"/"<<HLTDecision->getBinContent(2);
110  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
112  if(outputMEsInRootFile){
113  dqmStore_->save(outputFileName);
114  }
115 
116  // delete MEs
117 // LogInfo("SiStripTkDQM|SiStripMonitorHLT")<<"pwd="<<dqmStore_->pwd();
119 // dqmStore_->cd();
120 // std::string folder_to_delete = HLTDirectory;
121 // LogInfo("SiStripTkDQM|SiStripMonitorHLT")<<" Removing whole directory "<<folder_to_delete;
122 // dqmStore_->rmdir(folder_to_delete);
123 
124 }
T getParameter(std::string const &) const
MonitorElement * HLTDecision
double getBinContent(int binx) const
get content of bin (1-D)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2562
edm::ParameterSet conf_

Member Data Documentation

MonitorElement* SiStripMonitorHLT::ChargeOfEachClusterTEC_all
private

Definition at line 49 of file SiStripMonitorHLT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiStripMonitorHLT::ChargeOfEachClusterTEC_hlt
private

Definition at line 55 of file SiStripMonitorHLT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiStripMonitorHLT::ChargeOfEachClusterTIB_all
private

Definition at line 47 of file SiStripMonitorHLT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiStripMonitorHLT::ChargeOfEachClusterTIB_hlt
private

Definition at line 53 of file SiStripMonitorHLT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiStripMonitorHLT::ChargeOfEachClusterTOB_all
private

Definition at line 48 of file SiStripMonitorHLT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiStripMonitorHLT::ChargeOfEachClusterTOB_hlt
private

Definition at line 54 of file SiStripMonitorHLT.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<std::map<uint,std::vector<SiStripCluster> > > SiStripMonitorHLT::clusterInSubComponentsToken_
private

Definition at line 39 of file SiStripMonitorHLT.h.

Referenced by analyze(), and SiStripMonitorHLT().

edm::ParameterSet SiStripMonitorHLT::conf_
private

Definition at line 42 of file SiStripMonitorHLT.h.

Referenced by analyze(), bookHistograms(), endJob(), and SiStripMonitorHLT().

DQMStore* SiStripMonitorHLT::dqmStore_
private

Definition at line 41 of file SiStripMonitorHLT.h.

Referenced by endJob(), and SiStripMonitorHLT().

edm::EDGetTokenT<int> SiStripMonitorHLT::filerDecisionToken_
private

Definition at line 37 of file SiStripMonitorHLT.h.

Referenced by analyze(), and SiStripMonitorHLT().

MonitorElement* SiStripMonitorHLT::HLTDecision
private

Definition at line 43 of file SiStripMonitorHLT.h.

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

std::string SiStripMonitorHLT::HLTDirectory
private

Definition at line 57 of file SiStripMonitorHLT.h.

Referenced by bookHistograms(), and SiStripMonitorHLT().

MonitorElement* SiStripMonitorHLT::NumberOfClustersAboveThreshold_all
private

Definition at line 46 of file SiStripMonitorHLT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiStripMonitorHLT::NumberOfClustersAboveThreshold_hlt
private

Definition at line 52 of file SiStripMonitorHLT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiStripMonitorHLT::SumOfClusterCharges_all
private

Definition at line 45 of file SiStripMonitorHLT.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiStripMonitorHLT::SumOfClusterCharges_hlt
private

Definition at line 51 of file SiStripMonitorHLT.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<uint> SiStripMonitorHLT::sumOfClusterToken_
private

Definition at line 38 of file SiStripMonitorHLT.h.

Referenced by analyze(), and SiStripMonitorHLT().