CMS 3D CMS Logo

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

user includes More...

#include <SiStripGainsPCLWorker.h>

Inheritance diagram for SiStripGainsPCLWorker:
DQMGlobalEDAnalyzer< APVGain::APVGainHistograms > edm::global::EDAnalyzer< edm::RunCache< APVGain::APVGainHistograms >, Args... > edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void bookHistograms (DQMStore::ConcurrentBooker &, edm::Run const &, edm::EventSetup const &, APVGain::APVGainHistograms &) const override
 
void dqmAnalyze (edm::Event const &, edm::EventSetup const &, APVGain::APVGainHistograms const &) const override
 
 SiStripGainsPCLWorker (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::global::EDAnalyzer< edm::RunCache< APVGain::APVGainHistograms >, Args... >
 EDAnalyzer ()=default
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () 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
 
ESProxyIndex const * esGetTokenIndices (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::vector< ModuleDescription const * > &modules, 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
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

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

Private Member Functions

void beginJob () override
 
void checkBookAPVColls (const TrackerGeometry *bareTkGeomPtr, APVGain::APVGainHistograms &histograms) const
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &, APVGain::APVGainHistograms &) const override
 
void endJob () override
 
int statCollectionFromMode (const char *tag) const
 

Private Attributes

bool AllowSaturation
 
edm::EDGetTokenT< std::vector< unsigned char > > amplitude_token_
 
std::string CalibPrefix_
 
std::string CalibSuffix_
 
edm::EDGetTokenT< std::vector< unsigned int > > charge_token_
 
edm::EDGetTokenT< std::vector< double > > chargeoverpath_token_
 
bool doChargeMonitorPerPlane
 
std::vector< std::string > dqm_tag_
 
std::string EventPrefix_
 
std::string EventSuffix_
 
edm::EDGetTokenT< std::vector< bool > > farfromedge_token_
 
bool FirstSetOfConstants
 
edm::EDGetTokenT< std::vector< unsigned short > > firststrip_token_
 
edm::EDGetTokenT< std::vector< double > > gainused_token_
 
edm::EDGetTokenT< std::vector< double > > gainusedTick_token_
 
edm::EDGetTokenT< std::vector< double > > localdirx_token_
 
edm::EDGetTokenT< std::vector< double > > localdiry_token_
 
edm::EDGetTokenT< std::vector< double > > localdirz_token_
 
std::string m_calibrationMode
 
std::string m_DQMdir
 
unsigned int MaxNrStrips
 
double MaxTrackChiOverNdf
 
double MaxTrackEta
 
int MaxTrackingIteration
 
double MaxTrackMomentum
 
double MinTrackEta
 
unsigned int MinTrackHits
 
double MinTrackMomentum
 
edm::EDGetTokenT< std::vector< unsigned short > > nstrips_token_
 
bool OldGainRemoving
 
edm::EDGetTokenT< std::vector< bool > > overlapping_token_
 
edm::EDGetTokenT< std::vector< double > > path_token_
 
edm::EDGetTokenT< std::vector< unsigned int > > rawid_token_
 
edm::EDGetTokenT< std::vector< bool > > saturation_token_
 
std::map< unsigned int, APVloctheTopologyMap
 
edm::EDGetTokenT< std::vector< int > > trackalgo_token_
 
edm::EDGetTokenT< std::vector< double > > trackchi2ndof_token_
 
edm::EDGetTokenT< std::vector< double > > tracketa_token_
 
edm::EDGetTokenT< std::vector< unsigned int > > trackhitsvalid_token_
 
edm::EDGetTokenT< std::vector< int > > trackindex_token_
 
edm::EDGetTokenT< std::vector< float > > trackp_token_
 
edm::EDGetTokenT< std::vector< double > > trackphi_token_
 
std::string TrackPrefix_
 
edm::EDGetTokenT< std::vector< float > > trackpt_token_
 
std::string TrackSuffix_
 
edm::EDGetTokenT< std::vector< bool > > TrigTech_token_
 
bool useCalibration
 
bool Validation
 
std::vector< std::string > VChargeHisto
 

Additional Inherited Members

- Public Types inherited from edm::global::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)
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

user includes

Description: Fill DQM histograms with SiStrip Charge normalized to path length

Definition at line 75 of file SiStripGainsPCLWorker.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file SiStripGainsPCLWorker.cc.

References AllowSaturation, amplitude_token_, CalibPrefix_, CalibSuffix_, charge_token_, chargeoverpath_token_, doChargeMonitorPerPlane, dqm_tag_, EventPrefix_, EventSuffix_, farfromedge_token_, plotBeamSpotDB::first, FirstSetOfConstants, firststrip_token_, gainused_token_, gainusedTick_token_, edm::ParameterSet::getUntrackedParameter(), mps_fire::i, label, create_public_lumi_plots::loc, localdirx_token_, localdiry_token_, localdirz_token_, m_calibrationMode, m_DQMdir, MaxNrStrips, MaxTrackChiOverNdf, MaxTrackEta, MaxTrackingIteration, MaxTrackMomentum, MinTrackEta, MinTrackHits, MinTrackMomentum, APVGain::monHnames(), nstrips_token_, OldGainRemoving, overlapping_token_, path_token_, rawid_token_, alignCSCRings::s, saturation_token_, AlCaHLTBitMon_QueryRunRegistry::string, APVGain::subdetectorId(), APVGain::subdetectorPlane(), APVGain::subdetectorSide(), theTopologyMap, trackalgo_token_, trackchi2ndof_token_, tracketa_token_, trackhitsvalid_token_, trackindex_token_, trackp_token_, trackphi_token_, TrackPrefix_, trackpt_token_, TrackSuffix_, TrigTech_token_, useCalibration, Validation, and VChargeHisto.

10 {
11  MinTrackMomentum = iConfig.getUntrackedParameter<double> ("minTrackMomentum" , 3.0);
12  MaxTrackMomentum = iConfig.getUntrackedParameter<double> ("maxTrackMomentum" , 99999.0);
13  MinTrackEta = iConfig.getUntrackedParameter<double> ("minTrackEta" , -5.0);
14  MaxTrackEta = iConfig.getUntrackedParameter<double> ("maxTrackEta" , 5.0);
15  MaxNrStrips = iConfig.getUntrackedParameter<unsigned>("maxNrStrips" , 2);
16  MinTrackHits = iConfig.getUntrackedParameter<unsigned>("MinTrackHits" , 8);
17  MaxTrackChiOverNdf = iConfig.getUntrackedParameter<double> ("MaxTrackChiOverNdf" , 3);
18  MaxTrackingIteration = iConfig.getUntrackedParameter<int> ("MaxTrackingIteration" , 7);
19  AllowSaturation = iConfig.getUntrackedParameter<bool> ("AllowSaturation" , false);
20  FirstSetOfConstants = iConfig.getUntrackedParameter<bool> ("FirstSetOfConstants" , true);
21  Validation = iConfig.getUntrackedParameter<bool> ("Validation" , false);
22  OldGainRemoving = iConfig.getUntrackedParameter<bool> ("OldGainRemoving" , false);
23  useCalibration = iConfig.getUntrackedParameter<bool> ("UseCalibration" , false);
24  doChargeMonitorPerPlane = iConfig.getUntrackedParameter<bool> ("doChargeMonitorPerPlane" , false);
25  m_DQMdir = iConfig.getUntrackedParameter<std::string> ("DQMdir" , "AlCaReco/SiStripGains");
26  m_calibrationMode = iConfig.getUntrackedParameter<std::string> ("calibrationMode" , "StdBunch");
27  VChargeHisto = iConfig.getUntrackedParameter<std::vector<std::string> > ("ChargeHisto");
28 
29  // fill in the mapping between the histogram indices and the (id,side,plane) tuple
30  std::vector<std::pair<std::string,std::string>> hnames = APVGain::monHnames(VChargeHisto,doChargeMonitorPerPlane,"");
31  for (unsigned int i=0;i<hnames.size();i++){
32 
33  int id = APVGain::subdetectorId((hnames[i]).first);
34  int side = APVGain::subdetectorSide((hnames[i]).first);
35  int plane = APVGain::subdetectorPlane((hnames[i]).first);
36  std::string s = hnames[i].first;
37 
38  auto loc = APVloc(id,side,plane,s);
39  theTopologyMap.insert(std::make_pair(i,loc));
40  }
41 
42  //Set the monitoring element tag and store
43  dqm_tag_.reserve(7);
44  dqm_tag_.clear();
45  dqm_tag_.push_back( "StdBunch" ); // statistic collection from Standard Collision Bunch @ 3.8 T
46  dqm_tag_.push_back( "StdBunch0T" ); // statistic collection from Standard Collision Bunch @ 0 T
47  dqm_tag_.push_back( "AagBunch" ); // statistic collection from First Collision After Abort Gap @ 3.8 T
48  dqm_tag_.push_back( "AagBunch0T" ); // statistic collection from First Collision After Abort Gap @ 0 T
49  dqm_tag_.push_back( "IsoMuon" ); // statistic collection from Isolated Muon @ 3.8 T
50  dqm_tag_.push_back( "IsoMuon0T" ); // statistic collection from Isolated Muon @ 0 T
51  dqm_tag_.push_back( "Harvest" ); // statistic collection: Harvest
52 
53  // configure token for gathering the ntuple variables
54  edm::ParameterSet swhallowgain_pset = iConfig.getUntrackedParameter<edm::ParameterSet>("gain");
55 
56  std::string label = swhallowgain_pset.getUntrackedParameter<std::string>("label");
57  CalibPrefix_ = swhallowgain_pset.getUntrackedParameter<std::string>("prefix");
58  CalibSuffix_ = swhallowgain_pset.getUntrackedParameter<std::string>("suffix");
59 
60  trackindex_token_ = consumes<std::vector<int> >(edm::InputTag(label, CalibPrefix_ + "trackindex" + CalibSuffix_));
61  rawid_token_ = consumes<std::vector<unsigned int> >(edm::InputTag(label, CalibPrefix_ + "rawid" + CalibSuffix_));
62  localdirx_token_ = consumes<std::vector<double> >(edm::InputTag(label, CalibPrefix_ + "localdirx" + CalibSuffix_));
63  localdiry_token_ = consumes<std::vector<double> >(edm::InputTag(label, CalibPrefix_ + "localdiry" + CalibSuffix_));
64  localdirz_token_ = consumes<std::vector<double> >(edm::InputTag(label, CalibPrefix_ + "localdirz" + CalibSuffix_));
65  firststrip_token_ = consumes<std::vector<unsigned short> >(edm::InputTag(label, CalibPrefix_ + "firststrip" + CalibSuffix_));
66  nstrips_token_ = consumes<std::vector<unsigned short> >(edm::InputTag(label, CalibPrefix_ + "nstrips" + CalibSuffix_));
67  saturation_token_ = consumes<std::vector<bool> >(edm::InputTag(label, CalibPrefix_ + "saturation" + CalibSuffix_));
68  overlapping_token_ = consumes<std::vector<bool> >(edm::InputTag(label, CalibPrefix_ + "overlapping" + CalibSuffix_));
69  farfromedge_token_ = consumes<std::vector<bool> >(edm::InputTag(label, CalibPrefix_ + "farfromedge" + CalibSuffix_));
70  charge_token_ = consumes<std::vector<unsigned int> >(edm::InputTag(label, CalibPrefix_ + "charge" + CalibSuffix_));
71  path_token_ = consumes<std::vector<double> >(edm::InputTag(label, CalibPrefix_ + "path" + CalibSuffix_));
72 #ifdef ExtendedCALIBTree
73  chargeoverpath_token_ = consumes<std::vector<double> >(edm::InputTag(label, CalibPrefix_ + "chargeoverpath"+ CalibSuffix_));
74 #endif
75  amplitude_token_ = consumes<std::vector<unsigned char> >(edm::InputTag(label, CalibPrefix_ + "amplitude" + CalibSuffix_));
76  gainused_token_ = consumes<std::vector<double> >(edm::InputTag(label, CalibPrefix_ + "gainused" + CalibSuffix_));
77  gainusedTick_token_ = consumes<std::vector<double> >(edm::InputTag(label, CalibPrefix_ + "gainusedTick" + CalibSuffix_));
78 
79  edm::ParameterSet evtinfo_pset = iConfig.getUntrackedParameter<edm::ParameterSet>("evtinfo");
80  label = evtinfo_pset.getUntrackedParameter<std::string>("label");
81  EventPrefix_ = evtinfo_pset.getUntrackedParameter<std::string>("prefix");
82  EventSuffix_ = evtinfo_pset.getUntrackedParameter<std::string>("suffix");
83  TrigTech_token_ = consumes<std::vector<bool> >(edm::InputTag(label, EventPrefix_ + "TrigTech" + EventSuffix_));
84 
85  edm::ParameterSet track_pset = iConfig.getUntrackedParameter<edm::ParameterSet>("tracks");
86  label = track_pset.getUntrackedParameter<std::string>("label");
87  TrackPrefix_ = track_pset.getUntrackedParameter<std::string>("prefix");
88  TrackSuffix_ = track_pset.getUntrackedParameter<std::string>("suffix");
89 
90  trackchi2ndof_token_ = consumes<std::vector<double> >(edm::InputTag(label, TrackPrefix_ + "chi2ndof" + TrackSuffix_));
91  trackp_token_ = consumes<std::vector<float> >(edm::InputTag(label, TrackPrefix_ + "momentum" + TrackSuffix_));
92  trackpt_token_ = consumes<std::vector<float> >(edm::InputTag(label, TrackPrefix_ + "pt" + TrackSuffix_));
93  tracketa_token_ = consumes<std::vector<double> >(edm::InputTag(label, TrackPrefix_ + "eta" + TrackSuffix_));
94  trackphi_token_ = consumes<std::vector<double> >(edm::InputTag(label, TrackPrefix_ + "phi" + TrackSuffix_));
95  trackhitsvalid_token_ = consumes<std::vector<unsigned int> >(edm::InputTag(label, TrackPrefix_ + "hitsvalid" + TrackSuffix_));
96  trackalgo_token_ = consumes<std::vector<int> >(edm::InputTag(label, TrackPrefix_ + "algo" + TrackSuffix_));
97 
98 }
edm::EDGetTokenT< std::vector< double > > gainused_token_
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< std::vector< double > > localdirz_token_
edm::EDGetTokenT< std::vector< bool > > saturation_token_
edm::EDGetTokenT< std::vector< double > > trackchi2ndof_token_
edm::EDGetTokenT< std::vector< double > > gainusedTick_token_
edm::EDGetTokenT< std::vector< float > > trackp_token_
int subdetectorPlane(uint32_t, const TrackerTopology *)
edm::EDGetTokenT< std::vector< unsigned int > > trackhitsvalid_token_
edm::EDGetTokenT< std::vector< unsigned short > > firststrip_token_
edm::EDGetTokenT< std::vector< bool > > farfromedge_token_
edm::EDGetTokenT< std::vector< bool > > overlapping_token_
std::vector< std::string > dqm_tag_
edm::EDGetTokenT< std::vector< unsigned short > > nstrips_token_
edm::EDGetTokenT< std::vector< double > > tracketa_token_
char const * label
std::map< unsigned int, APVloc > theTopologyMap
edm::EDGetTokenT< std::vector< int > > trackindex_token_
edm::EDGetTokenT< std::vector< double > > localdirx_token_
edm::EDGetTokenT< std::vector< unsigned int > > charge_token_
edm::EDGetTokenT< std::vector< double > > trackphi_token_
edm::EDGetTokenT< std::vector< float > > trackpt_token_
int subdetectorSide(uint32_t, const TrackerTopology *)
std::vector< std::string > VChargeHisto
edm::EDGetTokenT< std::vector< double > > path_token_
edm::EDGetTokenT< std::vector< double > > chargeoverpath_token_
edm::EDGetTokenT< std::vector< int > > trackalgo_token_
edm::EDGetTokenT< std::vector< double > > localdiry_token_
std::vector< std::pair< std::string, std::string > > monHnames(std::vector< std::string >, bool, const char *tag)
edm::EDGetTokenT< std::vector< unsigned char > > amplitude_token_
int subdetectorId(uint32_t)
edm::EDGetTokenT< std::vector< unsigned int > > rawid_token_
edm::EDGetTokenT< std::vector< bool > > TrigTech_token_

Member Function Documentation

void SiStripGainsPCLWorker::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 385 of file SiStripGainsPCLWorker.cc.

386 {
387 }
void SiStripGainsPCLWorker::bookHistograms ( DQMStore::ConcurrentBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  setup,
APVGain::APVGainHistograms histograms 
) const
overridevirtual

Implements DQMGlobalEDAnalyzer< APVGain::APVGainHistograms >.

Definition at line 515 of file SiStripGainsPCLWorker.cc.

References a, b, DQMStore::ConcurrentBooker::book1DD(), DQMStore::ConcurrentBooker::book2S(), DQMStore::IBooker::cd(), APVGain::APVGainHistograms::Charge_1, APVGain::APVGainHistograms::Charge_2, APVGain::APVGainHistograms::Charge_3, APVGain::APVGainHistograms::Charge_4, APVGain::APVGainHistograms::Charge_Vs_Index, APVGain::APVGainHistograms::Charge_Vs_PathlengthTECM1, APVGain::APVGainHistograms::Charge_Vs_PathlengthTECM2, APVGain::APVGainHistograms::Charge_Vs_PathlengthTECP1, APVGain::APVGainHistograms::Charge_Vs_PathlengthTECP2, APVGain::APVGainHistograms::Charge_Vs_PathlengthTIB, APVGain::APVGainHistograms::Charge_Vs_PathlengthTIDM, APVGain::APVGainHistograms::Charge_Vs_PathlengthTIDP, APVGain::APVGainHistograms::Charge_Vs_PathlengthTOB, doChargeMonitorPerPlane, dqm_tag_, JetChargeProducer_cfi::exp, plotBeamSpotDB::first, mps_fire::i, cmsBatch::log, m_calibrationMode, m_DQMdir, APVGain::monHnames(), APVGain::APVGainHistograms::NStripAPVs, p1, p2, edm::second(), DQMStore::IBooker::setCurrentFolder(), statCollectionFromMode(), AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, VChargeHisto, and y.

515  {
516 
517  ibooker.cd();
518  std::string dqm_dir = m_DQMdir;
519  const char* tag = dqm_tag_[statCollectionFromMode(m_calibrationMode.c_str())].c_str();
520 
521  edm::LogInfo("SiStripGainsPCLWorker") << "Setting " << dqm_dir << " in DQM and booking histograms for tag "
522  << tag << std::endl;
523 
524  ibooker.setCurrentFolder(dqm_dir);
525 
526  std::string stag(tag);
527  if(!stag.empty() && stag[0]!='_') stag.insert(0,1,'_');
528 
529  std::string cvi = std::string("Charge_Vs_Index") + stag;
530  std::string cvpTIB = std::string("Charge_Vs_PathlengthTIB") + stag;
531  std::string cvpTOB = std::string("Charge_Vs_PathlengthTOB") + stag;
532  std::string cvpTIDP = std::string("Charge_Vs_PathlengthTIDP") + stag;
533  std::string cvpTIDM = std::string("Charge_Vs_PathlengthTIDM") + stag;
534  std::string cvpTECP1 = std::string("Charge_Vs_PathlengthTECP1") + stag;
535  std::string cvpTECP2 = std::string("Charge_Vs_PathlengthTECP2") + stag;
536  std::string cvpTECM1 = std::string("Charge_Vs_PathlengthTECM1") + stag;
537  std::string cvpTECM2 = std::string("Charge_Vs_PathlengthTECM2") + stag;
538 
539  int elepos = statCollectionFromMode(tag);
540 
541  histograms.Charge_Vs_Index.reserve(dqm_tag_.size());
542  histograms.Charge_Vs_PathlengthTIB.reserve(dqm_tag_.size());
543  histograms.Charge_Vs_PathlengthTOB.reserve(dqm_tag_.size());
544  histograms.Charge_Vs_PathlengthTIDP.reserve(dqm_tag_.size());
545  histograms.Charge_Vs_PathlengthTIDM.reserve(dqm_tag_.size());
546  histograms.Charge_Vs_PathlengthTECP1.reserve(dqm_tag_.size());
547  histograms.Charge_Vs_PathlengthTECP2.reserve(dqm_tag_.size());
548  histograms.Charge_Vs_PathlengthTECM1.reserve(dqm_tag_.size());
549  histograms.Charge_Vs_PathlengthTECM2.reserve(dqm_tag_.size());
550 
551  // The cluster charge is stored by exploiting a non uniform binning in order
552  // reduce the histogram memory size. The bin width is relaxed with a falling
553  // exponential function and the bin boundaries are stored in the binYarray.
554  // The binXarray is used to provide as many bins as the APVs.
555  //
556  // More details about this implementations are here:
557  // https://indico.cern.ch/event/649344/contributions/2672267/attachments/1498323/2332518/OptimizeChHisto.pdf
558 
559  std::vector<float> binXarray;
560  binXarray.reserve( histograms.NStripAPVs+1 );
561  for(unsigned int a=0;a<=histograms.NStripAPVs;a++){
562  binXarray.push_back( (float)a );
563  }
564 
565  std::array<float,688> binYarray;
566  double p0 = 5.445;
567  double p1 = 0.002113;
568  double p2 = 69.01576;
569  double y = 0.;
570  for(int b=0;b<687;b++) {
571  binYarray[b] = y;
572  if(y<=902.) y = y + 2.;
573  else y = ( p0 - log(exp(p0-p1*y) - p2*p1)) / p1;
574  }
575  binYarray[687] = 4000.;
576 
577  histograms.Charge_1[elepos].clear();
578  histograms.Charge_2[elepos].clear();
579  histograms.Charge_3[elepos].clear();
580  histograms.Charge_4[elepos].clear();
581 
582 
583  auto it = histograms.Charge_Vs_Index.begin();
584  histograms.Charge_Vs_Index.insert(it+elepos,ibooker.book2S(cvi.c_str() , cvi.c_str() , histograms.NStripAPVs, &binXarray[0], 687, binYarray.data()));
585 
586  it = histograms.Charge_Vs_PathlengthTIB.begin();
587  histograms.Charge_Vs_PathlengthTIB.insert(it+elepos,ibooker.book2S(cvpTIB.c_str() , cvpTIB.c_str() , 20 , 0.3 , 1.3 , 250,0,2000));
588 
589  it = histograms.Charge_Vs_PathlengthTOB.begin();
590  histograms.Charge_Vs_PathlengthTOB.insert(it+elepos,ibooker.book2S(cvpTOB.c_str() , cvpTOB.c_str() , 20 , 0.3 , 1.3 , 250,0,2000));
591 
592  it = histograms.Charge_Vs_PathlengthTIDP.begin();
593  histograms.Charge_Vs_PathlengthTIDP.insert(it+elepos,ibooker.book2S(cvpTIDP.c_str() , cvpTIDP.c_str() , 20 , 0.3 , 1.3 , 250,0,2000));
594 
595  it = histograms.Charge_Vs_PathlengthTIDM.begin();
596  histograms.Charge_Vs_PathlengthTIDM.insert(it+elepos,ibooker.book2S(cvpTIDM.c_str() , cvpTIDM.c_str() , 20 , 0.3 , 1.3 , 250,0,2000));
597 
598  it = histograms.Charge_Vs_PathlengthTECP1.begin();
599  histograms.Charge_Vs_PathlengthTECP1.insert(it+elepos,ibooker.book2S(cvpTECP1.c_str(), cvpTECP1.c_str(), 20 , 0.3 , 1.3 , 250,0,2000));
600 
601  it = histograms.Charge_Vs_PathlengthTECP2.begin();
602  histograms.Charge_Vs_PathlengthTECP2.insert(it+elepos,ibooker.book2S(cvpTECP2.c_str(), cvpTECP2.c_str(), 20 , 0.3 , 1.3 , 250,0,2000));
603 
604  it = histograms.Charge_Vs_PathlengthTECM1.begin();
605  histograms.Charge_Vs_PathlengthTECM1.insert(it+elepos,ibooker.book2S(cvpTECM1.c_str(), cvpTECM1.c_str(), 20 , 0.3 , 1.3 , 250,0,2000));
606 
607  it = histograms.Charge_Vs_PathlengthTECM2.begin();
608  histograms.Charge_Vs_PathlengthTECM2.insert(it+elepos,ibooker.book2S(cvpTECM2.c_str(), cvpTECM2.c_str(), 20 , 0.3 , 1.3 , 250,0,2000));
609 
610  std::vector<std::pair<std::string,std::string>> hnames = APVGain::monHnames(VChargeHisto,doChargeMonitorPerPlane,"");
611  for (unsigned int i=0;i<hnames.size();i++){
612  std::string htag = (hnames[i]).first + stag;
613  histograms.Charge_1[elepos].push_back(ibooker.book1DD( htag.c_str(), (hnames[i]).second.c_str(), 100 , 0. , 1000. ));
614  }
615 
617  for (unsigned int i=0;i<hnames.size();i++){
618  std::string htag = (hnames[i]).first + stag;
619  histograms.Charge_2[elepos].push_back(ibooker.book1DD( htag.c_str(), (hnames[i]).second.c_str(), 100 , 0. , 1000. ));
620  }
621 
623  for (unsigned int i=0;i<hnames.size();i++){
624  std::string htag = (hnames[i]).first + stag;
625  histograms.Charge_3[elepos].push_back(ibooker.book1DD( htag.c_str(), (hnames[i]).second.c_str(), 100 , 0. , 1000. ));
626  }
627 
629  for (unsigned int i=0;i<hnames.size();i++){
630  std::string htag = (hnames[i]).first + stag;
631  histograms.Charge_4[elepos].push_back(ibooker.book1DD( htag.c_str(), (hnames[i]).second.c_str(), 100 , 0. , 1000. ));
632  }
633 }
ConcurrentMonitorElement book1DD(Args &&...args)
Definition: DQMStore.h:162
std::array< std::vector< ConcurrentMonitorElement >, 7 > Charge_1
std::vector< ConcurrentMonitorElement > Charge_Vs_PathlengthTECM2
std::vector< ConcurrentMonitorElement > Charge_Vs_PathlengthTECP2
std::vector< ConcurrentMonitorElement > Charge_Vs_PathlengthTIDM
std::array< std::vector< ConcurrentMonitorElement >, 7 > Charge_2
std::array< std::vector< ConcurrentMonitorElement >, 7 > Charge_3
std::vector< std::string > dqm_tag_
U second(std::pair< T, U > const &p)
std::vector< ConcurrentMonitorElement > Charge_Vs_Index
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
std::atomic< unsigned int > NStripAPVs
double p2[4]
Definition: TauolaWrapper.h:90
std::vector< ConcurrentMonitorElement > Charge_Vs_PathlengthTIB
std::vector< ConcurrentMonitorElement > Charge_Vs_PathlengthTECP1
std::vector< ConcurrentMonitorElement > Charge_Vs_PathlengthTOB
double b
Definition: hdecay.h:120
std::vector< std::string > VChargeHisto
std::vector< ConcurrentMonitorElement > Charge_Vs_PathlengthTECM1
double p1[4]
Definition: TauolaWrapper.h:89
double a
Definition: hdecay.h:121
ConcurrentMonitorElement book2S(Args &&...args)
Definition: DQMStore.h:164
int statCollectionFromMode(const char *tag) const
std::vector< std::pair< std::string, std::string > > monHnames(std::vector< std::string >, bool, const char *tag)
std::array< std::vector< ConcurrentMonitorElement >, 7 > Charge_4
std::vector< ConcurrentMonitorElement > Charge_Vs_PathlengthTIDP
void SiStripGainsPCLWorker::checkBookAPVColls ( const TrackerGeometry bareTkGeomPtr,
APVGain::APVGainHistograms histograms 
) const
private

Definition at line 392 of file SiStripGainsPCLWorker.cc.

References sistrip::APV, APVGain::APVGainHistograms::APVsColl, APVGain::APVGainHistograms::APVsCollOrdered, TrackerGeometry::dets(), mps_fire::i, PixelTopology::ncolumns(), APVGain::APVGainHistograms::NPixelDets, PixelTopology::nrows(), APVGain::APVGainHistograms::NStripAPVs, StripTopology::nstrips(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::rawId(), ntupleEnum::SubDet, DetId::subdetId(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

Referenced by dqmBeginRun().

393 {
394  if (bareTkGeomPtr) { // pointer not yet set: called the first time => fill the APVColls
395  auto const & Det = bareTkGeomPtr->dets();
396 
397  edm::LogInfo("SiStripGainsPCLWorker") <<" Resetting APV struct"<<std::endl;
398 
399  unsigned int Index=0;
400 
401  for(unsigned int i=0;i<Det.size();i++){
402 
403  DetId Detid = Det[i]->geographicalId();
404  int SubDet = Detid.subdetId();
405 
406  if( SubDet == StripSubdetector::TIB || SubDet == StripSubdetector::TID ||
407  SubDet == StripSubdetector::TOB || SubDet == StripSubdetector::TEC ){
408 
409  auto DetUnit = dynamic_cast<const StripGeomDetUnit*> (Det[i]);
410  if(!DetUnit)continue;
411 
412  const StripTopology& Topo = DetUnit->specificTopology();
413  unsigned int NAPV = Topo.nstrips()/128;
414 
415  for(unsigned int j=0;j<NAPV;j++){
416  auto APV = std::make_shared<stAPVGain>();
417  APV->Index = Index;
418  APV->Bin = -1;
419  APV->DetId = Detid.rawId();
420  APV->APVId = j;
421  APV->SubDet = SubDet;
422  APV->FitMPV = -1;
423  APV->FitMPVErr = -1;
424  APV->FitWidth = -1;
425  APV->FitWidthErr = -1;
426  APV->FitChi2 = -1;
427  APV->FitNorm = -1;
428  APV->Gain = -1;
429  APV->PreviousGain = 1;
430  APV->PreviousGainTick = 1;
431  APV->x = DetUnit->position().basicVector().x();
432  APV->y = DetUnit->position().basicVector().y();
433  APV->z = DetUnit->position().basicVector().z();
434  APV->Eta = DetUnit->position().basicVector().eta();
435  APV->Phi = DetUnit->position().basicVector().phi();
436  APV->R = DetUnit->position().basicVector().transverse();
437  APV->Thickness = DetUnit->surface().bounds().thickness();
438  APV->NEntries = 0;
439  APV->isMasked = false;
440 
441  histograms.APVsCollOrdered.push_back(APV);
442  histograms.APVsColl[(APV->DetId<<4) | APV->APVId] = APV;
443  Index++;
444  histograms.NStripAPVs++;
445  } // loop on APVs
446  } // if is Strips
447  } // loop on dets
448 
449  for(unsigned int i=0;i<Det.size();i++){ //Make two loop such that the Pixel information is added at the end --> make transition simpler
450  DetId Detid = Det[i]->geographicalId();
451  int SubDet = Detid.subdetId();
453  auto DetUnit = dynamic_cast<const PixelGeomDetUnit*> (Det[i]);
454  if(!DetUnit) continue;
455 
456  const PixelTopology& Topo = DetUnit->specificTopology();
457  unsigned int NROCRow = Topo.nrows()/(80.);
458  unsigned int NROCCol = Topo.ncolumns()/(52.);
459 
460  for(unsigned int j=0;j<NROCRow;j++){
461  for(unsigned int i=0;i<NROCCol;i++){
462 
463  auto APV = std::make_shared<stAPVGain>();
464  APV->Index = Index;
465  APV->Bin = -1;
466  APV->DetId = Detid.rawId();
467  APV->APVId = (j<<3 | i);
468  APV->SubDet = SubDet;
469  APV->FitMPV = -1;
470  APV->FitMPVErr = -1;
471  APV->FitWidth = -1;
472  APV->FitWidthErr = -1;
473  APV->FitChi2 = -1;
474  APV->Gain = -1;
475  APV->PreviousGain = 1;
476  APV->PreviousGainTick = 1;
477  APV->x = DetUnit->position().basicVector().x();
478  APV->y = DetUnit->position().basicVector().y();
479  APV->z = DetUnit->position().basicVector().z();
480  APV->Eta = DetUnit->position().basicVector().eta();
481  APV->Phi = DetUnit->position().basicVector().phi();
482  APV->R = DetUnit->position().basicVector().transverse();
483  APV->Thickness = DetUnit->surface().bounds().thickness();
484  APV->isMasked = false; //SiPixelQuality_->IsModuleBad(Detid.rawId());
485  APV->NEntries = 0;
486 
487  histograms.APVsCollOrdered.push_back(APV);
488  histograms.APVsColl[(APV->DetId<<4) | APV->APVId] = APV;
489  Index++;
490  histograms.NPixelDets++;
491 
492  } // loop on ROC cols
493  } // loop on ROC rows
494  } // if Pixel
495  } // loop on Dets
496  } //if (!bareTkGeomPtr_) ...
497 }
virtual int nrows() const =0
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
std::atomic< unsigned int > NPixelDets
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
std::atomic< unsigned int > NStripAPVs
Definition: DetId.h:18
virtual int nstrips() const =0
std::vector< std::shared_ptr< stAPVGain > > APVsCollOrdered
std::unordered_map< unsigned int, std::shared_ptr< stAPVGain > > APVsColl
virtual int ncolumns() const =0
void SiStripGainsPCLWorker::dqmAnalyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup,
APVGain::APVGainHistograms const &  histograms 
) const
override

Definition at line 147 of file SiStripGainsPCLWorker.cc.

References AllowSaturation, CustomPhysics_cfi::amplitude, amplitude_token_, sistrip::APV, APVGain::APVGainHistograms::APVsColl, ALCARECOTkAlJpsiMuMu_cff::charge, APVGain::APVGainHistograms::Charge_1, APVGain::APVGainHistograms::Charge_2, APVGain::APVGainHistograms::Charge_3, APVGain::APVGainHistograms::Charge_4, charge_token_, APVGain::APVGainHistograms::Charge_Vs_Index, APVGain::APVGainHistograms::Charge_Vs_PathlengthTECM1, APVGain::APVGainHistograms::Charge_Vs_PathlengthTECM2, APVGain::APVGainHistograms::Charge_Vs_PathlengthTECP1, APVGain::APVGainHistograms::Charge_Vs_PathlengthTECP2, APVGain::APVGainHistograms::Charge_Vs_PathlengthTIB, APVGain::APVGainHistograms::Charge_Vs_PathlengthTIDM, APVGain::APVGainHistograms::Charge_Vs_PathlengthTIDP, APVGain::APVGainHistograms::Charge_Vs_PathlengthTOB, chargeoverpath_token_, HTMLExport::elem(), edm::EventID::event(), farfromedge_token_, APVGain::FetchIndices(), FirstSetOfConstants, firststrip_token_, gainused_token_, gainusedTick_token_, edm::EventSetup::get(), edm::Event::getByToken(), mps_fire::i, edm::EventBase::id(), createfilelist::int, LogDebug, funct::m, m_calibrationMode, MaxNrStrips, MaxTrackChiOverNdf, MaxTrackEta, MaxTrackingIteration, MaxTrackMomentum, MinTrackEta, MinTrackHits, MinTrackMomentum, nstrips_token_, OldGainRemoving, overlapping_token_, callgraph::path, path_token_, edm::Handle< T >::product(), edm::ESHandle< T >::product(), rawid_token_, edm::EventID::run(), cond::runnumber, alignCSCRings::s, saturation_token_, statCollectionFromMode(), StripSubdetector::TEC, theTopologyMap, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, trackalgo_token_, trackchi2ndof_token_, tracketa_token_, trackhitsvalid_token_, trackindex_token_, trackp_token_, useCalibration, and Validation.

148 {
149  using namespace edm;
150 
151  unsigned int eventnumber = iEvent.id().event();
152  unsigned int runnumber = iEvent.id().run();
153 
154  edm::LogInfo("SiStripGainsPCLWorker") << "Processing run " << runnumber
155  << " and event " << eventnumber
156  << std::endl;
157 
159  iSetup.get<TrackerTopologyRcd>().get( TopoHandle );
160  const TrackerTopology* topo = TopoHandle.product();
161 
162  // *****************************
163  // * Event data handles
164  // *****************************
165 
166  //Event data
167 
168  // Track data
170  iEvent.getByToken(trackchi2ndof_token_,handle01);
171  auto trackchi2ndof = handle01.product();
172 
174  iEvent.getByToken(trackp_token_,handle02);
175  auto trackp = handle02.product();
176 
178  iEvent.getByToken(tracketa_token_,handle03);
179  auto tracketa = handle03.product();
180 
182  iEvent.getByToken(trackhitsvalid_token_,handle04);
183  auto trackhitsvalid = handle04.product();
184 
186  iEvent.getByToken(trackalgo_token_,handle05);
187  auto trackalgo = handle05.product();
188 
189  // CalibTree data
191  iEvent.getByToken(trackindex_token_,handle06);
192  auto trackindex = handle06.product();
193 
195  iEvent.getByToken(rawid_token_,handle07);
196  auto rawid = handle07.product();
197 
199  iEvent.getByToken(firststrip_token_,handle08);
200  auto firststrip = handle08.product();
201 
203  iEvent.getByToken(nstrips_token_,handle09);
204  auto nstrips = handle09.product();
205 
207  iEvent.getByToken(saturation_token_,handle10);
208  auto saturation = handle10.product();
209 
211  iEvent.getByToken(overlapping_token_,handle11);
212  auto overlapping = handle11.product();
213 
215  iEvent.getByToken(farfromedge_token_,handle12);
216  auto farfromedge = handle12.product();
217 
219  iEvent.getByToken(charge_token_,handle13);
220  auto charge = handle13.product();
221 
223  iEvent.getByToken(path_token_,handle14);
224  auto path = handle14.product();
225 
226 #ifdef ExtendedCALIBTree
228  iEvent.getByToken(chargeoverpath_token_,handle15);
229  auto chargeoverpath = handle15.product();
230 #endif
231 
233  iEvent.getByToken(amplitude_token_,handle16);
234  auto amplitude = handle16.product();
235 
237  iEvent.getByToken(gainused_token_,handle17);
238  auto gainused = handle17.product();
239 
241  iEvent.getByToken(gainusedTick_token_,handle18);
242  auto gainusedTick = handle18.product();
243 
244  for (const auto &elem : theTopologyMap){
245  LogDebug("SiStripGainsPCLWorker") << elem.first << " - " << elem.second.m_string << " " << elem.second.m_subdetectorId << " " << elem.second.m_subdetectorSide << " " << elem.second.m_subdetectorPlane << std::endl;
246  }
247 
248  LogDebug("SiStripGainsPCLWorker") <<"for mode"<< m_calibrationMode <<std::endl;
249 
250  int elepos = statCollectionFromMode(m_calibrationMode.c_str());
251 
252  unsigned int FirstAmplitude=0;
253  for(unsigned int i=0;i<charge->size();i++){
254 
255  FirstAmplitude+=(*nstrips)[i];
256  int TI = (*trackindex)[i];
257 
258  if((*tracketa )[TI] < MinTrackEta )continue;
259  if((*tracketa )[TI] > MaxTrackEta )continue;
260  if((*trackp )[TI] < MinTrackMomentum )continue;
261  if((*trackp )[TI] > MaxTrackMomentum )continue;
262  if((*trackhitsvalid)[TI] < MinTrackHits )continue;
263  if((*trackchi2ndof )[TI] > MaxTrackChiOverNdf )continue;
264  if((*trackalgo )[TI] > MaxTrackingIteration )continue;
265 
266  std::shared_ptr<stAPVGain> APV = histograms.APVsColl.at(((*rawid)[i]<<4) | ((*firststrip)[i]/128)); //works for both strip and pixel thanks to firstStrip encoding for pixel in the calibTree
267 
268  if(APV->SubDet>2 && (*farfromedge)[i] == false )continue;
269  if(APV->SubDet>2 && (*overlapping)[i] == true )continue;
270  if(APV->SubDet>2 && (*saturation )[i] && !AllowSaturation)continue;
271  if(APV->SubDet>2 && (*nstrips )[i] > MaxNrStrips )continue;
272 
273  int Charge = 0;
274  if(APV->SubDet>2 && (useCalibration || !FirstSetOfConstants)){
275  bool Saturation = false;
276  for(unsigned int s=0;s<(*nstrips)[i];s++){
277  int StripCharge = (*amplitude)[FirstAmplitude-(*nstrips)[i]+s];
278  if(useCalibration && !FirstSetOfConstants){ StripCharge=(int)(StripCharge*(APV->PreviousGain/APV->CalibGain));
279  }else if(useCalibration){ StripCharge=(int)(StripCharge/APV->CalibGain);
280  }else if(!FirstSetOfConstants){ StripCharge=(int)(StripCharge*APV->PreviousGain);}
281  if(StripCharge>1024){
282  StripCharge = 255;
283  Saturation = true;
284  }else if(StripCharge>254){
285  StripCharge = 254;
286  Saturation = true;
287  }
288  Charge += StripCharge;
289  }
290  if(Saturation && !AllowSaturation)continue;
291  }else if(APV->SubDet>2){
292  Charge = (*charge)[i];
293  }else{
294  Charge = (*charge)[i]/265.0; //expected scale factor between pixel and strip charge
295  }
296 
297  double ClusterChargeOverPath = ( (double) Charge )/(*path)[i] ;
298  if(APV->SubDet>2){
299  if(Validation) {ClusterChargeOverPath/=(*gainused)[i];}
300  if(OldGainRemoving){ClusterChargeOverPath*=(*gainused)[i];}
301  }
302 
303  // keep processing of pixel cluster charge until here
304  if(APV->SubDet<=2) continue;
305 
306  // real histogram for calibration
307  histograms.Charge_Vs_Index[elepos].fill(APV->Index,ClusterChargeOverPath);
308  LogDebug("SiStripGainsPCLWorker") <<" for mode "<< m_calibrationMode << "\n"
309  <<" i "<< i
310  <<" useCalibration "<< useCalibration
311  <<" FirstSetOfConstants "<< FirstSetOfConstants
312  <<" APV->PreviousGain " << APV->PreviousGain
313  <<" APV->CalibGain " << APV->CalibGain
314  <<" APV->DetId "<< APV->DetId
315  <<" APV->Index "<< APV->Index
316  <<" Charge "<< Charge
317  <<" Path "<< (*path)[i]
318  <<" ClusterChargeOverPath "<< ClusterChargeOverPath
319  <<std::endl;
320 
321  // Fill monitoring histograms
322  int mCharge1 = 0;
323  int mCharge2 = 0;
324  int mCharge3 = 0;
325  int mCharge4 = 0;
326  if(APV->SubDet>2) {
327  for(unsigned int s=0;s<(*nstrips)[i];s++){
328  int StripCharge = (*amplitude)[FirstAmplitude-(*nstrips)[i]+s];
329  if(StripCharge>1024) StripCharge = 255;
330  else if(StripCharge>254) StripCharge = 254;
331  mCharge1 += StripCharge;
332  mCharge2 += StripCharge;
333  mCharge3 += StripCharge;
334  mCharge4 += StripCharge;
335  }
336  // Revome gains for monitoring
337  mCharge2 *= (*gainused)[i]; // remove G2
338  mCharge3 *= (*gainusedTick)[i]; // remove G1
339  mCharge4 *= ( (*gainused)[i] * (*gainusedTick)[i]); // remove G1 and G2
340  }
341 
342  LogDebug("SiStripGainsPCLWorker") <<" full charge "<< mCharge1
343  <<" remove G2 "<< mCharge2
344  <<" remove G1 "<< mCharge3
345  <<" remove G1*G2 "<< mCharge4
346  <<std::endl;
347 
348  auto indices = APVGain::FetchIndices(theTopologyMap,(*rawid)[i], topo);
349 
350  for(auto m : indices) histograms.Charge_1[elepos][m].fill(( (double) mCharge1 )/(*path)[i]);
351  for(auto m : indices) histograms.Charge_2[elepos][m].fill(( (double) mCharge2 )/(*path)[i]);
352  for(auto m : indices) histograms.Charge_3[elepos][m].fill(( (double) mCharge3 )/(*path)[i]);
353  for(auto m : indices) histograms.Charge_4[elepos][m].fill(( (double) mCharge4 )/(*path)[i]);
354 
355  if(APV->SubDet==StripSubdetector::TIB){
356  histograms.Charge_Vs_PathlengthTIB[elepos].fill((*path)[i],Charge); // TIB
357 
358  }else if(APV->SubDet==StripSubdetector::TOB){
359  histograms.Charge_Vs_PathlengthTOB[elepos].fill((*path)[i],Charge); // TOB
360 
361  }else if(APV->SubDet==StripSubdetector::TID){
362  if(APV->Eta<0) { histograms.Charge_Vs_PathlengthTIDM[elepos].fill((*path)[i],Charge); } // TID minus
363  else if(APV->Eta>0){ histograms.Charge_Vs_PathlengthTIDP[elepos].fill((*path)[i],Charge); } // TID plus
364 
365  }else if(APV->SubDet==StripSubdetector::TEC){
366  if(APV->Eta<0){
367  if(APV->Thickness<0.04) { histograms.Charge_Vs_PathlengthTECM1[elepos].fill((*path)[i],Charge); } // TEC minus, type 1
368  else if(APV->Thickness>0.04){ histograms.Charge_Vs_PathlengthTECM2[elepos].fill((*path)[i],Charge); } // TEC minus, type 2
369  } else if(APV->Eta>0){
370  if(APV->Thickness<0.04) { histograms.Charge_Vs_PathlengthTECP1[elepos].fill((*path)[i],Charge); } // TEC plus, type 1
371  else if(APV->Thickness>0.04){ histograms.Charge_Vs_PathlengthTECP2[elepos].fill((*path)[i],Charge); } // TEC plus, type 2
372  }
373  }
374 
375  }// END OF ON-CLUSTER LOOP
376 
377  //LogDebug("SiStripGainsPCLWorker")<<" for mode"<< m_calibrationMode
378  // <<" entries in histogram:"<< histograms.Charge_Vs_Index[elepos].getEntries()
379  // <<std::endl;
380 
381 }
#define LogDebug(id)
edm::EDGetTokenT< std::vector< double > > gainused_token_
edm::EDGetTokenT< std::vector< bool > > saturation_token_
edm::EDGetTokenT< std::vector< double > > trackchi2ndof_token_
edm::EDGetTokenT< std::vector< double > > gainusedTick_token_
edm::EDGetTokenT< std::vector< float > > trackp_token_
edm::EDGetTokenT< std::vector< unsigned int > > trackhitsvalid_token_
edm::EDGetTokenT< std::vector< unsigned short > > firststrip_token_
edm::EDGetTokenT< std::vector< bool > > farfromedge_token_
edm::EDGetTokenT< std::vector< bool > > overlapping_token_
edm::EDGetTokenT< std::vector< unsigned short > > nstrips_token_
edm::EDGetTokenT< std::vector< double > > tracketa_token_
int iEvent
Definition: GenABIO.cc:224
std::vector< unsigned int > FetchIndices(std::map< unsigned int, APVloc >, uint32_t, const TrackerTopology *topo=0)
std::map< unsigned int, APVloc > theTopologyMap
edm::EDGetTokenT< std::vector< int > > trackindex_token_
edm::EDGetTokenT< std::vector< unsigned int > > charge_token_
def elem(elemtype, innerHTML='', html_class='', kwargs)
Definition: HTMLExport.py:19
T const * product() const
Definition: Handle.h:74
edm::EDGetTokenT< std::vector< double > > path_token_
HLT enums.
int statCollectionFromMode(const char *tag) const
edm::EDGetTokenT< std::vector< double > > chargeoverpath_token_
edm::EDGetTokenT< std::vector< int > > trackalgo_token_
edm::EDGetTokenT< std::vector< unsigned char > > amplitude_token_
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< std::vector< unsigned int > > rawid_token_
void SiStripGainsPCLWorker::dqmBeginRun ( edm::Run const &  run,
edm::EventSetup const &  iSetup,
APVGain::APVGainHistograms histograms 
) const
overrideprivatevirtual

Reimplemented from DQMGlobalEDAnalyzer< APVGain::APVGainHistograms >.

Definition at line 102 of file SiStripGainsPCLWorker.cc.

References a, sistrip::APV, APVGain::APVGainHistograms::APVsCollOrdered, checkBookAPVColls(), constexpr, cmsRelvalreport::exit, edm::EventSetup::get(), SiStripGain::getApvGain(), SiStripGain::getNumberOfTags(), SiStripGain::getRange(), SiStripQuality::IsApvBad(), edm::ESHandleBase::isValid(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, and mps_setup::stdout.

102  {
103 
104  using namespace edm;
105  static constexpr float defaultGainTick = 690./640.;
106 
107  // fills the APV collections at each begin run
109  iSetup.get<TrackerDigiGeometryRecord>().get( tkGeom_ );
110  const TrackerGeometry *bareTkGeomPtr = &(*tkGeom_);
111  checkBookAPVColls(bareTkGeomPtr,histograms);
112 
113  edm::ESHandle<SiStripGain> gainHandle;
114  iSetup.get<SiStripGainRcd>().get(gainHandle);
115  if(!gainHandle.isValid()){edm::LogError("SiStripGainPCLWorker")<< "gainHandle is not valid\n"; exit(0);}
116 
117  edm::ESHandle<SiStripQuality> SiStripQuality_;
118  iSetup.get<SiStripQualityRcd>().get(SiStripQuality_);
119 
120  for(unsigned int a=0;a<histograms.APVsCollOrdered.size();a++){
121 
122  std::shared_ptr<stAPVGain> APV = histograms.APVsCollOrdered[a];
123 
124  if(APV->SubDet==PixelSubdetector::PixelBarrel || APV->SubDet==PixelSubdetector::PixelEndcap) continue;
125 
126  APV->isMasked = SiStripQuality_->IsApvBad(APV->DetId,APV->APVId);
127 
128  if(gainHandle->getNumberOfTags()!=2){edm::LogError("SiStripGainPCLWorker")<< "NUMBER OF GAIN TAG IS EXPECTED TO BE 2\n";fflush(stdout);exit(0);};
129  float newPreviousGain = gainHandle->getApvGain(APV->APVId,gainHandle->getRange(APV->DetId, 1),1);
130  if(APV->PreviousGain!=1 and newPreviousGain!=APV->PreviousGain)edm::LogWarning("SiStripGainPCLWorker")<< "WARNING: ParticleGain in the global tag changed\n";
131  APV->PreviousGain = newPreviousGain;
132 
133  float newPreviousGainTick = APV->isMasked ? defaultGainTick : gainHandle->getApvGain(APV->APVId,gainHandle->getRange(APV->DetId, 0),0);
134  if(APV->PreviousGainTick!=1 and newPreviousGainTick!=APV->PreviousGainTick){
135  edm::LogWarning("SiStripGainPCLWorker")<< "WARNING: TickMarkGain in the global tag changed\n"<< std::endl
136  <<" APV->SubDet: "<< APV->SubDet << " APV->APVId:" << APV->APVId << std::endl
137  <<" APV->PreviousGainTick: "<<APV->PreviousGainTick<<" newPreviousGainTick: "<<newPreviousGainTick<<std::endl;
138  }
139  APV->PreviousGainTick = newPreviousGainTick;
140  }
141 
142 }
bool IsApvBad(const uint32_t &detid, const short &apvNb) const
size_t getNumberOfTags() const
Definition: SiStripGain.h:95
static float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range)
Definition: SiStripGain.h:76
void checkBookAPVColls(const TrackerGeometry *bareTkGeomPtr, APVGain::APVGainHistograms &histograms) const
std::vector< std::shared_ptr< stAPVGain > > APVsCollOrdered
HLT enums.
double a
Definition: hdecay.h:121
bool isValid() const
Definition: ESHandle.h:44
#define constexpr
const SiStripApvGain::Range getRange(uint32_t detID) const
Definition: SiStripGain.h:71
void SiStripGainsPCLWorker::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 501 of file SiStripGainsPCLWorker.cc.

Referenced by o2olib.O2ORunMgr::executeJob().

502 {
503 }
void SiStripGainsPCLWorker::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static
int SiStripGainsPCLWorker::statCollectionFromMode ( const char *  tag) const
inlineprivate

Definition at line 154 of file SiStripGainsPCLWorker.h.

References dqm_tag_, relativeConstraints::empty, None, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by bookHistograms(), and dqmAnalyze().

155 {
156  std::vector<std::string>::const_iterator it=dqm_tag_.begin();
157  while(it!=dqm_tag_.end()) {
158  if(*it==std::string(tag)) return it-dqm_tag_.begin();
159  it++;
160  }
161 
162  if (std::string(tag).empty()) return 0; // return StdBunch calibration mode for backward compatibility
163 
164  return None;
165 }
std::vector< std::string > dqm_tag_

Member Data Documentation

bool SiStripGainsPCLWorker::AllowSaturation
private

Definition at line 103 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<unsigned char> > SiStripGainsPCLWorker::amplitude_token_
private

Definition at line 137 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

std::string SiStripGainsPCLWorker::CalibPrefix_
private

Definition at line 145 of file SiStripGainsPCLWorker.h.

Referenced by SiStripGainsPCLWorker().

std::string SiStripGainsPCLWorker::CalibSuffix_
private

Definition at line 146 of file SiStripGainsPCLWorker.h.

Referenced by SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<unsigned int> > SiStripGainsPCLWorker::charge_token_
private

Definition at line 134 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<double> > SiStripGainsPCLWorker::chargeoverpath_token_
private

Definition at line 136 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

bool SiStripGainsPCLWorker::doChargeMonitorPerPlane
private

Charge monitor per detector plane

Definition at line 108 of file SiStripGainsPCLWorker.h.

Referenced by bookHistograms(), and SiStripGainsPCLWorker().

std::vector<std::string> SiStripGainsPCLWorker::dqm_tag_
private
std::string SiStripGainsPCLWorker::EventPrefix_
private

Definition at line 141 of file SiStripGainsPCLWorker.h.

Referenced by SiStripGainsPCLWorker().

std::string SiStripGainsPCLWorker::EventSuffix_
private

Definition at line 142 of file SiStripGainsPCLWorker.h.

Referenced by SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<bool> > SiStripGainsPCLWorker::farfromedge_token_
private

Definition at line 133 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

bool SiStripGainsPCLWorker::FirstSetOfConstants
private

Definition at line 104 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<unsigned short> > SiStripGainsPCLWorker::firststrip_token_
private

Definition at line 129 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<double> > SiStripGainsPCLWorker::gainused_token_
private

Definition at line 138 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<double> > SiStripGainsPCLWorker::gainusedTick_token_
private

Definition at line 139 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<double> > SiStripGainsPCLWorker::localdirx_token_
private

Definition at line 126 of file SiStripGainsPCLWorker.h.

Referenced by SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<double> > SiStripGainsPCLWorker::localdiry_token_
private

Definition at line 127 of file SiStripGainsPCLWorker.h.

Referenced by SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<double> > SiStripGainsPCLWorker::localdirz_token_
private

Definition at line 128 of file SiStripGainsPCLWorker.h.

Referenced by SiStripGainsPCLWorker().

std::string SiStripGainsPCLWorker::m_calibrationMode
private

Type of statistics for the calibration

Definition at line 111 of file SiStripGainsPCLWorker.h.

Referenced by bookHistograms(), dqmAnalyze(), and SiStripGainsPCLWorker().

std::string SiStripGainsPCLWorker::m_DQMdir
private

DQM folder hosting the charge statistics and the monitor plots

Definition at line 110 of file SiStripGainsPCLWorker.h.

Referenced by bookHistograms(), and SiStripGainsPCLWorker().

unsigned int SiStripGainsPCLWorker::MaxNrStrips
private

Definition at line 99 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

double SiStripGainsPCLWorker::MaxTrackChiOverNdf
private

Definition at line 101 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

double SiStripGainsPCLWorker::MaxTrackEta
private

Definition at line 98 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

int SiStripGainsPCLWorker::MaxTrackingIteration
private

Definition at line 102 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

double SiStripGainsPCLWorker::MaxTrackMomentum
private

Definition at line 96 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

double SiStripGainsPCLWorker::MinTrackEta
private

Definition at line 97 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

unsigned int SiStripGainsPCLWorker::MinTrackHits
private

Definition at line 100 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

double SiStripGainsPCLWorker::MinTrackMomentum
private

Definition at line 95 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<unsigned short> > SiStripGainsPCLWorker::nstrips_token_
private

Definition at line 130 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

bool SiStripGainsPCLWorker::OldGainRemoving
private

Definition at line 106 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<bool> > SiStripGainsPCLWorker::overlapping_token_
private

Definition at line 132 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<double> > SiStripGainsPCLWorker::path_token_
private

Definition at line 135 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<unsigned int> > SiStripGainsPCLWorker::rawid_token_
private

Definition at line 125 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<bool> > SiStripGainsPCLWorker::saturation_token_
private

Definition at line 131 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

std::map<unsigned int,APVloc> SiStripGainsPCLWorker::theTopologyMap
private

Definition at line 149 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<int> > SiStripGainsPCLWorker::trackalgo_token_
private

Definition at line 123 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<double> > SiStripGainsPCLWorker::trackchi2ndof_token_
private

Definition at line 117 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<double> > SiStripGainsPCLWorker::tracketa_token_
private

Definition at line 120 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<unsigned int> > SiStripGainsPCLWorker::trackhitsvalid_token_
private

Definition at line 122 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<int> > SiStripGainsPCLWorker::trackindex_token_
private

Definition at line 124 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<float> > SiStripGainsPCLWorker::trackp_token_
private

Definition at line 118 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<double> > SiStripGainsPCLWorker::trackphi_token_
private

Definition at line 121 of file SiStripGainsPCLWorker.h.

Referenced by SiStripGainsPCLWorker().

std::string SiStripGainsPCLWorker::TrackPrefix_
private

Definition at line 143 of file SiStripGainsPCLWorker.h.

Referenced by SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<float> > SiStripGainsPCLWorker::trackpt_token_
private

Definition at line 119 of file SiStripGainsPCLWorker.h.

Referenced by SiStripGainsPCLWorker().

std::string SiStripGainsPCLWorker::TrackSuffix_
private

Definition at line 144 of file SiStripGainsPCLWorker.h.

Referenced by SiStripGainsPCLWorker().

edm::EDGetTokenT<std::vector<bool> > SiStripGainsPCLWorker::TrigTech_token_
private

Definition at line 116 of file SiStripGainsPCLWorker.h.

Referenced by SiStripGainsPCLWorker().

bool SiStripGainsPCLWorker::useCalibration
private

Definition at line 107 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

bool SiStripGainsPCLWorker::Validation
private

Definition at line 105 of file SiStripGainsPCLWorker.h.

Referenced by dqmAnalyze(), and SiStripGainsPCLWorker().

std::vector<std::string> SiStripGainsPCLWorker::VChargeHisto
private

Charge monitor plots to be output

Definition at line 112 of file SiStripGainsPCLWorker.h.

Referenced by bookHistograms(), and SiStripGainsPCLWorker().