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:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 
 SiStripMonitorHLT (const edm::ParameterSet &)
 
 ~SiStripMonitorHLT ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

MonitorElementChargeOfEachClusterTEC_all
 
MonitorElementChargeOfEachClusterTEC_hlt
 
MonitorElementChargeOfEachClusterTIB_all
 
MonitorElementChargeOfEachClusterTIB_hlt
 
MonitorElementChargeOfEachClusterTOB_all
 
MonitorElementChargeOfEachClusterTOB_hlt
 
edm::ParameterSet conf_
 
DQMStoredqmStore_
 
MonitorElementHLTDecision
 
std::string HLTDirectory
 
MonitorElementNumberOfClustersAboveThreshold_all
 
MonitorElementNumberOfClustersAboveThreshold_hlt
 
MonitorElementSumOfClusterCharges_all
 
MonitorElementSumOfClusterCharges_hlt
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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 26 of file SiStripMonitorHLT.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file SiStripMonitorHLT.cc.

References conf_, dqmStore_, HLTDirectory, and cppFunctionSkipper::operator.

23 {
24  HLTDirectory="HLTResults";
26  conf_ = iConfig;
27 }
std::string HLTDirectory
edm::ParameterSet conf_
SiStripMonitorHLT::~SiStripMonitorHLT ( )
inline

Definition at line 29 of file SiStripMonitorHLT.h.

29 {};

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 50 of file SiStripMonitorHLT.cc.

References ChargeOfEachClusterTEC_all, ChargeOfEachClusterTEC_hlt, ChargeOfEachClusterTIB_all, ChargeOfEachClusterTIB_hlt, ChargeOfEachClusterTOB_all, ChargeOfEachClusterTOB_hlt, conf_, MonitorElement::Fill(), edm::Event::getByLabel(), edm::ParameterSet::getParameter(), HLTDecision, Association::map, NumberOfClustersAboveThreshold_all, NumberOfClustersAboveThreshold_hlt, AlCaHLTBitMon_QueryRunRegistry::string, SumOfClusterCharges_all, and SumOfClusterCharges_hlt.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 30 of file SiStripMonitorHLT.cc.

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

30  {
31 
33  std::string HLTProducer = conf_.getParameter<std::string>("HLTProducer");
34  HLTDecision = dqmStore_->book1D(HLTProducer+"_HLTDecision", HLTProducer+"HLTDecision", 2, -0.5, 1.5);
35  // all
36  SumOfClusterCharges_all = dqmStore_->book1D("SumOfClusterCharges_all", "SumOfClusterCharges_all", 50, 0, 2000);
37  ChargeOfEachClusterTIB_all = dqmStore_->book1D("ChargeOfEachClusterTIB_all", "ChargeOfEachClusterTIB_all", 400, -0.5, 400.5);
38  ChargeOfEachClusterTOB_all = dqmStore_->book1D("ChargeOfEachClusterTOB_all", "ChargeOfEachClusterTOB_all", 400, -0.5, 400.5);
39  ChargeOfEachClusterTEC_all = dqmStore_->book1D("ChargeOfEachClusterTEC_all", "ChargeOfEachClusterTEC_all", 400, -0.5, 400.5);
40  NumberOfClustersAboveThreshold_all = dqmStore_->book1D("NumberOfClustersAboveThreshold_all", "NumberOfClustersAboveThreshold_all", 30, 30.5, 60.5);
41  // 31 = TIB2, 32 = TIB2, 33 = TIB3, 51 = TOB1, 52=TOB2, 60 = TEC
42  // accepted from HLT
43  SumOfClusterCharges_hlt = dqmStore_->book1D("SumOfClusterCharges_hlt", "SumOfClusterCharges_hlt", 50, 0, 2000);
44  ChargeOfEachClusterTIB_hlt = dqmStore_->book1D("ChargeOfEachClusterTIB_hlt", "ChargeOfEachClusterTIB_hlt", 400, -0.5, 400.5);
45  ChargeOfEachClusterTOB_hlt = dqmStore_->book1D("ChargeOfEachClusterTOB_hlt", "ChargeOfEachClusterTOB_hlt", 400, -0.5, 400.5);
46  ChargeOfEachClusterTEC_hlt = dqmStore_->book1D("ChargeOfEachClusterTEC_hlt", "ChargeOfEachClusterTEC_hlt", 400, -0.5, 400.5);
47  NumberOfClustersAboveThreshold_hlt = dqmStore_->book1D("NumberOfClustersAboveThreshold_hlt", "NumberOfClustersAboveThreshold_hlt", 30, 30.5, 60.5);
48 }
T getParameter(std::string const &) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
MonitorElement * NumberOfClustersAboveThreshold_all
MonitorElement * SumOfClusterCharges_all
MonitorElement * ChargeOfEachClusterTEC_hlt
std::string HLTDirectory
MonitorElement * ChargeOfEachClusterTIB_all
MonitorElement * NumberOfClustersAboveThreshold_hlt
MonitorElement * HLTDecision
MonitorElement * ChargeOfEachClusterTEC_all
MonitorElement * SumOfClusterCharges_hlt
MonitorElement * ChargeOfEachClusterTOB_hlt
MonitorElement * ChargeOfEachClusterTIB_hlt
MonitorElement * ChargeOfEachClusterTOB_all
edm::ParameterSet conf_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void SiStripMonitorHLT::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 100 of file SiStripMonitorHLT.cc.

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

100  {
101  edm::LogInfo("DQM|SiStripMonitorHLT")<<"Events rejected/accepted "<<HLTDecision->getBinContent(1)<<"/"<<HLTDecision->getBinContent(2);
102  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
104  if(outputMEsInRootFile){
105  dqmStore_->save(outputFileName);
106  }
107 
108  // delete MEs
109 // LogInfo("SiStripTkDQM|SiStripMonitorHLT")<<"pwd="<<dqmStore_->pwd();
111 // dqmStore_->cd();
112 // std::string folder_to_delete = HLTDirectory;
113 // LogInfo("SiStripTkDQM|SiStripMonitorHLT")<<" Removing whole directory "<<folder_to_delete;
114 // dqmStore_->rmdir(folder_to_delete);
115 
116 }
T getParameter(std::string const &) const
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2118
MonitorElement * HLTDecision
double getBinContent(int binx) const
get content of bin (1-D)
edm::ParameterSet conf_

Member Data Documentation

MonitorElement* SiStripMonitorHLT::ChargeOfEachClusterTEC_all
private

Definition at line 44 of file SiStripMonitorHLT.h.

Referenced by analyze(), and beginJob().

MonitorElement* SiStripMonitorHLT::ChargeOfEachClusterTEC_hlt
private

Definition at line 50 of file SiStripMonitorHLT.h.

Referenced by analyze(), and beginJob().

MonitorElement* SiStripMonitorHLT::ChargeOfEachClusterTIB_all
private

Definition at line 42 of file SiStripMonitorHLT.h.

Referenced by analyze(), and beginJob().

MonitorElement* SiStripMonitorHLT::ChargeOfEachClusterTIB_hlt
private

Definition at line 48 of file SiStripMonitorHLT.h.

Referenced by analyze(), and beginJob().

MonitorElement* SiStripMonitorHLT::ChargeOfEachClusterTOB_all
private

Definition at line 43 of file SiStripMonitorHLT.h.

Referenced by analyze(), and beginJob().

MonitorElement* SiStripMonitorHLT::ChargeOfEachClusterTOB_hlt
private

Definition at line 49 of file SiStripMonitorHLT.h.

Referenced by analyze(), and beginJob().

edm::ParameterSet SiStripMonitorHLT::conf_
private

Definition at line 37 of file SiStripMonitorHLT.h.

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

DQMStore* SiStripMonitorHLT::dqmStore_
private

Definition at line 36 of file SiStripMonitorHLT.h.

Referenced by beginJob(), endJob(), and SiStripMonitorHLT().

MonitorElement* SiStripMonitorHLT::HLTDecision
private

Definition at line 38 of file SiStripMonitorHLT.h.

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

std::string SiStripMonitorHLT::HLTDirectory
private

Definition at line 52 of file SiStripMonitorHLT.h.

Referenced by beginJob(), and SiStripMonitorHLT().

MonitorElement* SiStripMonitorHLT::NumberOfClustersAboveThreshold_all
private

Definition at line 41 of file SiStripMonitorHLT.h.

Referenced by analyze(), and beginJob().

MonitorElement* SiStripMonitorHLT::NumberOfClustersAboveThreshold_hlt
private

Definition at line 47 of file SiStripMonitorHLT.h.

Referenced by analyze(), and beginJob().

MonitorElement* SiStripMonitorHLT::SumOfClusterCharges_all
private

Definition at line 40 of file SiStripMonitorHLT.h.

Referenced by analyze(), and beginJob().

MonitorElement* SiStripMonitorHLT::SumOfClusterCharges_hlt
private

Definition at line 46 of file SiStripMonitorHLT.h.

Referenced by analyze(), and beginJob().