CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiStripHitEffFromCalibTree Class Reference
Inheritance diagram for SiStripHitEffFromCalibTree:
ConditionDBWriter< SiStripBadStrip > edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 SiStripHitEffFromCalibTree (const edm::ParameterSet &)
 
 ~SiStripHitEffFromCalibTree () override
 
- Public Member Functions inherited from ConditionDBWriter< SiStripBadStrip >
 ConditionDBWriter (const edm::ParameterSet &iConfig)
 
 ~ConditionDBWriter () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 

Private Member Functions

void algoAnalyze (const edm::Event &e, const edm::EventSetup &c) override
 
void algoBeginJob (const edm::EventSetup &) override
 
void algoEndJob () override
 
float calcPhi (float x, float y)
 
void ComputeEff (vector< TH1F * > &vhfound, vector< TH1F * > &vhtotal, string name)
 
TString GetLayerName (Long_t k)
 
TString GetLayerSideName (Long_t k)
 
std::unique_ptr< SiStripBadStripgetNewObject () override
 
void makeHotColdMaps ()
 
void makeSQLite ()
 
void makeSummary ()
 
void makeSummaryVsBx ()
 
void makeSummaryVsCM ()
 
void makeSummaryVsLumi ()
 
void makeTKMap (bool autoTagging)
 
void SetBadComponents (int i, int component, SiStripQuality::BadComponent &BC, std::stringstream ssV[4][19], int NBadComponent[4][19][4])
 
void totalStatistics ()
 

Private Attributes

bool _autoIneffModTagging
 
string _badModulesFile
 
unsigned int _bunchx
 
unsigned int _clusterMatchingMethod
 
float _clusterTrajDist
 
float _effPlotMin
 
float _ResXSig
 
bool _showEndcapSides
 
bool _showOnlyGoodModules
 
bool _showRings
 
bool _showTOB6TEC9
 
unsigned int _spaceBetweenTrains
 
float _stripsApvEdge
 
TString _title
 
float _tkMapMin
 
bool _useCM
 
bool _useOnlyHighPurityTracks
 
int alllayerfound [35]
 
int alllayertotal [35]
 
map< unsigned int, double > BadModules
 
TH1F * bxHisto
 
TTree * CalibTree
 
vector< string > CalibTreeFilenames
 
unsigned int doSummary
 
map< pair< unsigned int, unsigned int >, array< double, 3 > > eventInfos
 
edm::FileInPath FileInPath_
 
edm::Service< TFileServicefs
 
int goodlayerfound [35]
 
int goodlayertotal [35]
 
vector< hithits [23]
 
vector< TH2F * > HotColdMaps
 
TH1F * instLumiHisto
 
long layerfound [23]
 
map< unsigned int, vector< int > > layerfound_perBx
 
vector< TH1F * > layerfound_vsCM
 
vector< TH1F * > layerfound_vsLumi
 
vector< TH1F * > layerfound_vsPU
 
long layertotal [23]
 
map< unsigned int, vector< int > > layertotal_perBx
 
vector< TH1F * > layertotal_vsCM
 
vector< TH1F * > layertotal_vsLumi
 
vector< TH1F * > layertotal_vsPU
 
map< unsigned int, pair< unsigned int, unsigned int > > modCounter [23]
 
unsigned int nModsMin
 
unsigned int nTEClayers
 
TH1F * PUHisto
 
SiStripQualityquality_
 
SiStripDetInfoFileReaderreader
 
float threshold
 
TrackerMaptkmap
 
TrackerMaptkmapbad
 
TrackerMaptkmapden
 
TrackerMaptkmapeff
 
TrackerMaptkmapnum
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from ConditionDBWriter< SiStripBadStrip >
void setDoStore (const bool doStore)
 When set to false the payload will not be written to the db. More...
 
void storeOnDbNow ()
 
cond::Time_t timeOfLastIOV ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 95 of file SiStripHitEffFromCalibTree.cc.

Constructor & Destructor Documentation

◆ SiStripHitEffFromCalibTree()

SiStripHitEffFromCalibTree::SiStripHitEffFromCalibTree ( const edm::ParameterSet conf)
explicit

Definition at line 185 of file SiStripHitEffFromCalibTree.cc.

186  : ConditionDBWriter<SiStripBadStrip>(conf), FileInPath_("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat") {
187  CalibTreeFilenames = conf.getUntrackedParameter<vector<std::string> >("CalibTreeFilenames");
188  threshold = conf.getParameter<double>("Threshold");
189  nModsMin = conf.getParameter<int>("nModsMin");
190  doSummary = conf.getParameter<int>("doSummary");
191  _badModulesFile = conf.getUntrackedParameter<std::string>("BadModulesFile", "");
192  _autoIneffModTagging = conf.getUntrackedParameter<bool>("AutoIneffModTagging", false);
193  _clusterMatchingMethod = conf.getUntrackedParameter<int>("ClusterMatchingMethod", 0);
194  _ResXSig = conf.getUntrackedParameter<double>("ResXSig", -1);
195  _clusterTrajDist = conf.getUntrackedParameter<double>("ClusterTrajDist", 64.0);
196  _stripsApvEdge = conf.getUntrackedParameter<double>("StripsApvEdge", 10.0);
197  _useOnlyHighPurityTracks = conf.getUntrackedParameter<bool>("UseOnlyHighPurityTracks", true);
198  _bunchx = conf.getUntrackedParameter<int>("BunchCrossing", 0);
199  _spaceBetweenTrains = conf.getUntrackedParameter<int>("SpaceBetweenTrains", 25);
200  _useCM = conf.getUntrackedParameter<bool>("UseCommonMode", false);
201  _showEndcapSides = conf.getUntrackedParameter<bool>("ShowEndcapSides", true);
202  _showRings = conf.getUntrackedParameter<bool>("ShowRings", false);
203  _showTOB6TEC9 = conf.getUntrackedParameter<bool>("ShowTOB6TEC9", false);
204  _showOnlyGoodModules = conf.getUntrackedParameter<bool>("ShowOnlyGoodModules", false);
205  _tkMapMin = conf.getUntrackedParameter<double>("TkMapMin", 0.9);
206  _effPlotMin = conf.getUntrackedParameter<double>("EffPlotMin", 0.9);
207  _title = conf.getParameter<std::string>("Title");
209 
210  nTEClayers = 9; // number of wheels
211  if (_showRings)
212  nTEClayers = 7; // number of rings
213 
214  quality_ = new SiStripQuality;
215 }

References _autoIneffModTagging, _badModulesFile, _bunchx, _clusterMatchingMethod, _clusterTrajDist, _effPlotMin, _ResXSig, _showEndcapSides, _showOnlyGoodModules, _showRings, _showTOB6TEC9, _spaceBetweenTrains, _stripsApvEdge, _title, _tkMapMin, _useCM, _useOnlyHighPurityTracks, CalibTreeFilenames, doSummary, FileInPath_, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), nModsMin, nTEClayers, quality_, reader, AlCaHarvesting_cff::SiStripQuality, AlCaHLTBitMon_QueryRunRegistry::string, and threshold.

◆ ~SiStripHitEffFromCalibTree()

SiStripHitEffFromCalibTree::~SiStripHitEffFromCalibTree ( )
override

Definition at line 217 of file SiStripHitEffFromCalibTree.cc.

217 {}

Member Function Documentation

◆ algoAnalyze()

void SiStripHitEffFromCalibTree::algoAnalyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprivatevirtual

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 228 of file SiStripHitEffFromCalibTree.cc.

228  {
231  const TrackerGeometry* tkgeom = &(*tracker);
232 
233  //Retrieve tracker topology from geometry
234  edm::ESHandle<TrackerTopology> tTopoHandle;
235  c.get<TrackerTopologyRcd>().get(tTopoHandle);
236  const TrackerTopology* const tTopo = tTopoHandle.product();
237 
238  // read bad modules to mask
239  ifstream badModules_file;
240  set<uint32_t> badModules_list;
241  if (!_badModulesFile.empty()) {
242  badModules_file.open(_badModulesFile.c_str());
243  uint32_t badmodule_detid;
244  int mods, fiber1, fiber2, fiber3;
245  if (badModules_file.is_open()) {
246  string line;
247  while (getline(badModules_file, line)) {
248  if (badModules_file.eof())
249  continue;
250  stringstream ss(line);
251  ss >> badmodule_detid >> mods >> fiber1 >> fiber2 >> fiber3;
252  if (badmodule_detid != 0 && mods == 1 && (fiber1 == 1 || fiber2 == 1 || fiber3 == 1))
253  badModules_list.insert(badmodule_detid);
254  }
255  badModules_file.close();
256  }
257  }
258  if (!badModules_list.empty())
259  cout << "Remove additionnal bad modules from the analysis: " << endl;
260  set<uint32_t>::iterator itBadMod;
261  for (itBadMod = badModules_list.begin(); itBadMod != badModules_list.end(); ++itBadMod)
262  cout << " " << *itBadMod << endl;
263 
264  // initialze counters and histos
265 
266  bxHisto = fs->make<TH1F>("bx", "bx", 3600, 0, 3600);
267  instLumiHisto = fs->make<TH1F>("instLumi", "inst. lumi.", 250, 0, 25000);
268  PUHisto = fs->make<TH1F>("PU", "PU", 200, 0, 200);
269 
270  for (int l = 0; l < 35; l++) {
271  goodlayertotal[l] = 0;
272  goodlayerfound[l] = 0;
273  alllayertotal[l] = 0;
274  alllayerfound[l] = 0;
275  }
276 
277  TH1F* resolutionPlots[23];
278  for (Long_t ilayer = 0; ilayer < 23; ilayer++) {
279  resolutionPlots[ilayer] =
280  fs->make<TH1F>(Form("resol_layer_%i", (int)(ilayer)), GetLayerName(ilayer), 125, -125, 125);
281  resolutionPlots[ilayer]->GetXaxis()->SetTitle("trajX-clusX [strip unit]");
282 
283  layerfound_vsLumi.push_back(
284  fs->make<TH1F>(Form("layerfound_vsLumi_layer_%i", (int)(ilayer)), GetLayerName(ilayer), 100, 0, 25000));
285  layertotal_vsLumi.push_back(
286  fs->make<TH1F>(Form("layertotal_vsLumi_layer_%i", (int)(ilayer)), GetLayerName(ilayer), 100, 0, 25000));
287  layerfound_vsPU.push_back(
288  fs->make<TH1F>(Form("layerfound_vsPU_layer_%i", (int)(ilayer)), GetLayerName(ilayer), 45, 0, 90));
289  layertotal_vsPU.push_back(
290  fs->make<TH1F>(Form("layertotal_vsPU_layer_%i", (int)(ilayer)), GetLayerName(ilayer), 45, 0, 90));
291 
292  if (_useCM) {
293  layerfound_vsCM.push_back(
294  fs->make<TH1F>(Form("layerfound_vsCM_layer_%i", (int)(ilayer)), GetLayerName(ilayer), 20, 0, 400));
295  layertotal_vsCM.push_back(
296  fs->make<TH1F>(Form("layertotal_vsCM_layer_%i", (int)(ilayer)), GetLayerName(ilayer), 20, 0, 400));
297  }
298  layertotal[ilayer] = 0;
299  layerfound[ilayer] = 0;
300  }
301 
303  cout << "A module is bad if efficiency < " << threshold << " and has at least " << nModsMin << " nModsMin." << endl;
304  else
305  cout << "A module is bad if efficiency < the avg in layer - " << threshold << " and has at least " << nModsMin
306  << " nModsMin." << endl;
307 
308  unsigned int run, evt, bx;
309  double instLumi, PU;
310 
311  //Open the ROOT Calib Tree
312  for (unsigned int ifile = 0; ifile < CalibTreeFilenames.size(); ifile++) {
313  cout << "Loading file: " << CalibTreeFilenames[ifile] << endl;
314  TFile* CalibTreeFile = TFile::Open(CalibTreeFilenames[ifile].c_str(), "READ");
315 
316  // Get event infos
317  bool foundEventInfos = false;
318  try {
319  CalibTreeFile->cd("eventInfo");
320  } catch (exception& e) {
321  cout << "No event infos tree" << endl;
322  }
323  TTree* EventTree = (TTree*)(gDirectory->Get("tree"));
324 
325  TLeaf* runLf;
326  TLeaf* evtLf;
327  TLeaf* BunchLf;
328  TLeaf* InstLumiLf;
329  TLeaf* PULf;
330  if (EventTree) {
331  cout << "Found event infos tree" << endl;
332 
333  runLf = EventTree->GetLeaf("run");
334  evtLf = EventTree->GetLeaf("event");
335 
336  BunchLf = EventTree->GetLeaf("bx");
337  InstLumiLf = EventTree->GetLeaf("instLumi");
338  PULf = EventTree->GetLeaf("PU");
339 
340  int nevt = EventTree->GetEntries();
341  if (nevt)
342  foundEventInfos = true;
343 
344  for (int j = 0; j < nevt; j++) {
345  EventTree->GetEntry(j);
346  run = runLf->GetValue();
347  evt = evtLf->GetValue();
348  bx = BunchLf->GetValue();
349  instLumi = InstLumiLf->GetValue();
350  PU = PULf->GetValue();
351 
352  bxHisto->Fill(bx);
353  instLumiHisto->Fill(instLumi);
354  PUHisto->Fill(PU);
355 
356  eventInfos[make_pair(run, evt)] = array<double, 3>{{(double)bx, instLumi, PU}};
357  }
358  }
359 
360  // Get hit infos
361  CalibTreeFile->cd("anEff");
362  CalibTree = (TTree*)(gDirectory->Get("traj"));
363 
364  runLf = CalibTree->GetLeaf("run");
365  evtLf = CalibTree->GetLeaf("event");
366  TLeaf* BadLf = CalibTree->GetLeaf("ModIsBad");
367  TLeaf* sistripLf = CalibTree->GetLeaf("SiStripQualBad");
368  TLeaf* idLf = CalibTree->GetLeaf("Id");
369  TLeaf* acceptLf = CalibTree->GetLeaf("withinAcceptance");
370  TLeaf* layerLf = CalibTree->GetLeaf("layer");
371  //TLeaf* nHitsLf = CalibTree->GetLeaf("nHits");
372  TLeaf* highPurityLf = CalibTree->GetLeaf("highPurity");
373  TLeaf* xLf = CalibTree->GetLeaf("TrajGlbX");
374  TLeaf* yLf = CalibTree->GetLeaf("TrajGlbY");
375  TLeaf* zLf = CalibTree->GetLeaf("TrajGlbZ");
376  TLeaf* ResXSigLf = CalibTree->GetLeaf("ResXSig");
377  TLeaf* TrajLocXLf = CalibTree->GetLeaf("TrajLocX");
378  TLeaf* TrajLocYLf = CalibTree->GetLeaf("TrajLocY");
379  TLeaf* ClusterLocXLf = CalibTree->GetLeaf("ClusterLocX");
380  BunchLf = CalibTree->GetLeaf("bunchx");
381  InstLumiLf = CalibTree->GetLeaf("instLumi");
382  PULf = CalibTree->GetLeaf("PU");
383  TLeaf* CMLf = nullptr;
384  if (_useCM)
385  CMLf = CalibTree->GetLeaf("commonMode");
386 
387  int nevents = CalibTree->GetEntries();
388  cout << "Successfully loaded analyze function with " << nevents << " events!\n";
389 
390  map<pair<unsigned int, unsigned int>, array<double, 3> >::iterator itEventInfos;
391 
392  //Loop through all of the events
393  for (int j = 0; j < nevents; j++) {
394  CalibTree->GetEntry(j);
395  run = (unsigned int)runLf->GetValue();
396  evt = (unsigned int)evtLf->GetValue();
397  unsigned int isBad = (unsigned int)BadLf->GetValue();
398  unsigned int quality = (unsigned int)sistripLf->GetValue();
399  unsigned int id = (unsigned int)idLf->GetValue();
400  unsigned int accept = (unsigned int)acceptLf->GetValue();
401  unsigned int layer_wheel = (unsigned int)layerLf->GetValue();
402  unsigned int layer = layer_wheel;
403  if (_showRings && layer > 10) { // use rings instead of wheels
404  if (layer < 14)
405  layer = 10 + ((id >> 9) & 0x3); //TID 3 disks and also 3 rings -> use the same container
406  else
407  layer = 13 + ((id >> 5) & 0x7); //TEC
408  }
409  //unsigned int nHits = (unsigned int)nHitsLf->GetValue();
410  bool highPurity = (bool)highPurityLf->GetValue();
411  double x = xLf->GetValue();
412  double y = yLf->GetValue();
413  double z = zLf->GetValue();
414  double resxsig = ResXSigLf->GetValue();
415  double TrajLocX = TrajLocXLf->GetValue();
416  double TrajLocY = TrajLocYLf->GetValue();
417  double ClusterLocX = ClusterLocXLf->GetValue();
418  double TrajLocXMid;
419  double stripTrajMid;
420  double stripCluster;
421  bool badquality = false;
422 
423  instLumi = 0;
424  PU = 0;
425 
426  // if no special tree with event infos, they may be stored in the hit eff tree
427  if (!foundEventInfos) {
428  bx = (unsigned int)BunchLf->GetValue();
429  if (InstLumiLf != nullptr)
430  instLumi = InstLumiLf->GetValue(); // branch not filled by default
431  if (PULf != nullptr)
432  PU = PULf->GetValue(); // branch not filled by default
433  }
434  int CM = -100;
435  if (_useCM)
436  CM = CMLf->GetValue();
437 
438  // Get infos from eventInfos if they exist
439  if (foundEventInfos) {
440  itEventInfos = eventInfos.find(make_pair(run, evt));
441  if (itEventInfos != eventInfos.end()) {
442  bx = itEventInfos->second[0];
443  instLumi = itEventInfos->second[1];
444  PU = itEventInfos->second[2];
445  }
446  }
447 
448  //We have two things we want to do, both an XY color plot, and the efficiency measurement
449  //First, ignore anything that isn't in acceptance and isn't good quality
450 
451  if (_bunchx > 0 && _bunchx != bx)
452  continue;
453 
454  //if(quality == 1 || accept != 1 || nHits < 8) continue;
455  if (accept != 1)
456  continue;
458  continue;
459  if (quality == 1)
460  badquality = true;
461 
462  // don't compute efficiencies in modules from TOB6 and TEC9
463  if (!_showTOB6TEC9 && (layer_wheel == 10 || layer_wheel == 22))
464  continue;
465 
466  // don't use bad modules given in the bad module list
467  itBadMod = badModules_list.find(id);
468  if (itBadMod != badModules_list.end())
469  continue;
470 
471  //Now that we have a good event, we need to look at if we expected it or not, and the location
472  //if we didn't
473  //Fill the missing hit information first
474  bool badflag = false;
475 
476  // By default uses the old matching method
477  if (_ResXSig < 0) {
478  if (isBad == 1)
479  badflag = true; // isBad set to false in the tree when resxsig<999.0
480  } else {
481  if (isBad == 1 || resxsig > _ResXSig)
482  badflag = true;
483  }
484 
485  // Conversion of positions in strip unit
486  int nstrips = -9;
487  float Pitch = -9.0;
488 
489  if (resxsig == 1000.0) { // special treatment, no GeomDetUnit associated in some cases when no cluster found
490  Pitch = 0.0205; // maximum
491  nstrips = 768; // maximum
492  stripTrajMid = TrajLocX / Pitch + nstrips / 2.0;
493  stripCluster = ClusterLocX / Pitch + nstrips / 2.0;
494  } else {
495  DetId ClusterDetId(id);
496  const StripGeomDetUnit* stripdet = (const StripGeomDetUnit*)tkgeom->idToDetUnit(ClusterDetId);
497  const StripTopology& Topo = stripdet->specificTopology();
498  nstrips = Topo.nstrips();
499  Pitch = stripdet->surface().bounds().width() / Topo.nstrips();
500  stripTrajMid = TrajLocX / Pitch + nstrips / 2.0; //layer01->10
501  stripCluster = ClusterLocX / Pitch + nstrips / 2.0;
502 
503  // For trapezoidal modules: extrapolation of x trajectory position to the y middle of the module
504  // for correct comparison with cluster position
505  float hbedge = 0;
506  float htedge = 0;
507  float hapoth = 0;
508  if (layer >= 11) {
509  const BoundPlane& plane = stripdet->surface();
510  const TrapezoidalPlaneBounds* trapezoidalBounds(
511  dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds())));
512  std::array<const float, 4> const& parameters = (*trapezoidalBounds).parameters();
513  hbedge = parameters[0];
514  htedge = parameters[1];
515  hapoth = parameters[3];
516  TrajLocXMid = TrajLocX / (1 + (htedge - hbedge) * TrajLocY / (htedge + hbedge) /
517  hapoth); // radialy extrapolated x loc position at middle
518  stripTrajMid = TrajLocXMid / Pitch + nstrips / 2.0;
519  }
520  }
521 
522  if (!badquality && layer < 23) {
523  if (resxsig != 1000.0)
524  resolutionPlots[layer]->Fill(stripTrajMid - stripCluster);
525  else
526  resolutionPlots[layer]->Fill(1000);
527  }
528 
529  // New matching methods
530  int tapv = -9;
531  int capv = -9;
532  float stripInAPV = 64.;
533 
534  if (_clusterMatchingMethod >= 1) {
535  badflag = false; // reset
536  if (resxsig == 1000.0) { // default value when no cluster found in the module
537  badflag = true; // consider the module inefficient in this case
538  } else {
539  if (_clusterMatchingMethod == 2 ||
540  _clusterMatchingMethod == 4) { // check the distance between cluster and trajectory position
541  if (abs(stripCluster - stripTrajMid) > _clusterTrajDist)
542  badflag = true;
543  }
544  if (_clusterMatchingMethod == 3 ||
546  4) { // cluster and traj have to be in the same APV (don't take edges into accounts)
547  tapv = (int)stripTrajMid / 128;
548  capv = (int)stripCluster / 128;
549  stripInAPV = stripTrajMid - tapv * 128;
550 
551  if (stripInAPV < _stripsApvEdge || stripInAPV > 128 - _stripsApvEdge)
552  continue;
553  if (tapv != capv)
554  badflag = true;
555  }
556  }
557  }
558 
559  if (badflag && !badquality) {
560  hit temphit;
561  temphit.x = x;
562  temphit.y = y;
563  temphit.z = z;
564  temphit.id = id;
565  hits[layer].push_back(temphit);
566  }
567  pair<unsigned int, unsigned int> newgoodpair(1, 1);
568  pair<unsigned int, unsigned int> newbadpair(1, 0);
569  //First, figure out if the module already exists in the map of maps
570  map<unsigned int, pair<unsigned int, unsigned int> >::iterator it = modCounter[layer].find(id);
571  if (!badquality) {
572  if (it == modCounter[layer].end()) {
573  if (badflag)
574  modCounter[layer][id] = newbadpair;
575  else
576  modCounter[layer][id] = newgoodpair;
577  } else {
578  ((*it).second.first)++;
579  if (!badflag)
580  ((*it).second.second)++;
581  }
582 
583  if (layerfound_perBx.find(bx) == layerfound_perBx.end()) {
584  layerfound_perBx[bx] = vector<int>(23, 0);
585  layertotal_perBx[bx] = vector<int>(23, 0);
586  }
587  if (!badflag)
588  layerfound_perBx[bx][layer]++;
589  layertotal_perBx[bx][layer]++;
590 
591  if (!badflag)
592  layerfound_vsLumi[layer]->Fill(instLumi);
593  layertotal_vsLumi[layer]->Fill(instLumi);
594  if (!badflag)
595  layerfound_vsPU[layer]->Fill(PU);
596  layertotal_vsPU[layer]->Fill(PU);
597 
598  if (_useCM) {
599  if (!badflag)
600  layerfound_vsCM[layer]->Fill(CM);
601  layertotal_vsCM[layer]->Fill(CM);
602  }
603 
604  //Have to do the decoding for which side to go on (ugh)
605  if (layer <= 10) {
606  if (!badflag)
607  goodlayerfound[layer]++;
608  goodlayertotal[layer]++;
609  } else if (layer > 10 && layer < 14) {
610  if (((id >> 13) & 0x3) == 1) {
611  if (!badflag)
612  goodlayerfound[layer]++;
613  goodlayertotal[layer]++;
614  } else if (((id >> 13) & 0x3) == 2) {
615  if (!badflag)
616  goodlayerfound[layer + 3]++;
617  goodlayertotal[layer + 3]++;
618  }
619  } else if (layer > 13 && layer <= 22) {
620  if (((id >> 18) & 0x3) == 1) {
621  if (!badflag)
622  goodlayerfound[layer + 3]++;
623  goodlayertotal[layer + 3]++;
624  } else if (((id >> 18) & 0x3) == 2) {
625  if (!badflag)
626  goodlayerfound[layer + 3 + nTEClayers]++;
627  goodlayertotal[layer + 3 + nTEClayers]++;
628  }
629  }
630  }
631  //Do the one where we don't exclude bad modules!
632  if (layer <= 10) {
633  if (!badflag)
634  alllayerfound[layer]++;
635  alllayertotal[layer]++;
636  } else if (layer > 10 && layer < 14) {
637  if (((id >> 13) & 0x3) == 1) {
638  if (!badflag)
639  alllayerfound[layer]++;
640  alllayertotal[layer]++;
641  } else if (((id >> 13) & 0x3) == 2) {
642  if (!badflag)
643  alllayerfound[layer + 3]++;
644  alllayertotal[layer + 3]++;
645  }
646  } else if (layer > 13 && layer <= 22) {
647  if (((id >> 18) & 0x3) == 1) {
648  if (!badflag)
649  alllayerfound[layer + 3]++;
650  alllayertotal[layer + 3]++;
651  } else if (((id >> 18) & 0x3) == 2) {
652  if (!badflag)
653  alllayerfound[layer + 3 + nTEClayers]++;
654  alllayertotal[layer + 3 + nTEClayers]++;
655  }
656  }
657  //At this point, both of our maps are loaded with the correct information
658  }
659  } // go to next CalibTreeFile
660 
661  makeHotColdMaps();
663  makeSQLite();
664  totalStatistics();
665  makeSummary();
666  makeSummaryVsBx();
668  if (_useCM)
669  makeSummaryVsCM();
670 
672  //try to write out what's in the quality record
674  int NTkBadComponent[4]; //k: 0=BadModule, 1=BadFiber, 2=BadApv, 3=BadStrips
675  int NBadComponent[4][19][4];
676  //legend: NBadComponent[i][j][k]= SubSystem i, layer/disk/wheel j, BadModule/Fiber/Apv k
677  // i: 0=TIB, 1=TID, 2=TOB, 3=TEC
678  // k: 0=BadModule, 1=BadFiber, 2=BadApv, 3=BadStrips
679  std::stringstream ssV[4][19];
680 
681  for (int i = 0; i < 4; ++i) {
682  NTkBadComponent[i] = 0;
683  for (int j = 0; j < 19; ++j) {
684  ssV[i][j].str("");
685  for (int k = 0; k < 4; ++k)
686  NBadComponent[i][j][k] = 0;
687  }
688  }
689 
690  std::vector<SiStripQuality::BadComponent> BC = quality_->getBadComponentList();
691 
692  for (size_t i = 0; i < BC.size(); ++i) {
693  //&&&&&&&&&&&&&
694  //Full Tk
695  //&&&&&&&&&&&&&
696 
697  if (BC[i].BadModule)
698  NTkBadComponent[0]++;
699  if (BC[i].BadFibers)
700  NTkBadComponent[1] += ((BC[i].BadFibers >> 2) & 0x1) + ((BC[i].BadFibers >> 1) & 0x1) + ((BC[i].BadFibers) & 0x1);
701  if (BC[i].BadApvs)
702  NTkBadComponent[2] += ((BC[i].BadApvs >> 5) & 0x1) + ((BC[i].BadApvs >> 4) & 0x1) + ((BC[i].BadApvs >> 3) & 0x1) +
703  ((BC[i].BadApvs >> 2) & 0x1) + ((BC[i].BadApvs >> 1) & 0x1) + ((BC[i].BadApvs) & 0x1);
704 
705  //&&&&&&&&&&&&&&&&&
706  //Single SubSystem
707  //&&&&&&&&&&&&&&&&&
708 
709  int component;
710  SiStripDetId a(BC[i].detid);
711  if (a.subdetId() == SiStripDetId::TIB) {
712  //&&&&&&&&&&&&&&&&&
713  //TIB
714  //&&&&&&&&&&&&&&&&&
715 
716  component = tTopo->tibLayer(BC[i].detid);
717  SetBadComponents(0, component, BC[i], ssV, NBadComponent);
718 
719  } else if (a.subdetId() == SiStripDetId::TID) {
720  //&&&&&&&&&&&&&&&&&
721  //TID
722  //&&&&&&&&&&&&&&&&&
723 
724  component = tTopo->tidSide(BC[i].detid) == 2 ? tTopo->tidWheel(BC[i].detid) : tTopo->tidWheel(BC[i].detid) + 3;
725  SetBadComponents(1, component, BC[i], ssV, NBadComponent);
726 
727  } else if (a.subdetId() == SiStripDetId::TOB) {
728  //&&&&&&&&&&&&&&&&&
729  //TOB
730  //&&&&&&&&&&&&&&&&&
731 
732  component = tTopo->tobLayer(BC[i].detid);
733  SetBadComponents(2, component, BC[i], ssV, NBadComponent);
734 
735  } else if (a.subdetId() == SiStripDetId::TEC) {
736  //&&&&&&&&&&&&&&&&&
737  //TEC
738  //&&&&&&&&&&&&&&&&&
739 
740  component = tTopo->tecSide(BC[i].detid) == 2 ? tTopo->tecWheel(BC[i].detid) : tTopo->tecWheel(BC[i].detid) + 9;
741  SetBadComponents(3, component, BC[i], ssV, NBadComponent);
742  }
743  }
744 
745  //&&&&&&&&&&&&&&&&&&
746  // Single Strip Info
747  //&&&&&&&&&&&&&&&&&&
748  float percentage = 0;
749 
752 
753  for (SiStripBadStrip::RegistryIterator rp = rbegin; rp != rend; ++rp) {
754  unsigned int detid = rp->detid;
755 
756  int subdet = -999;
757  int component = -999;
758  SiStripDetId a(detid);
759  if (a.subdetId() == 3) {
760  subdet = 0;
761  component = tTopo->tibLayer(detid);
762  } else if (a.subdetId() == 4) {
763  subdet = 1;
764  component = tTopo->tidSide(detid) == 2 ? tTopo->tidWheel(detid) : tTopo->tidWheel(detid) + 3;
765  } else if (a.subdetId() == 5) {
766  subdet = 2;
767  component = tTopo->tobLayer(detid);
768  } else if (a.subdetId() == 6) {
769  subdet = 3;
770  component = tTopo->tecSide(detid) == 2 ? tTopo->tecWheel(detid) : tTopo->tecWheel(detid) + 9;
771  }
772 
773  SiStripQuality::Range sqrange =
775 
776  percentage = 0;
777  for (int it = 0; it < sqrange.second - sqrange.first; it++) {
778  unsigned int range = quality_->decode(*(sqrange.first + it)).range;
779  NTkBadComponent[3] += range;
780  NBadComponent[subdet][0][3] += range;
781  NBadComponent[subdet][component][3] += range;
782  percentage += range;
783  }
784  if (percentage != 0)
785  percentage /= 128. * reader->getNumberOfApvsAndStripLength(detid).first;
786  if (percentage > 1)
787  edm::LogError("SiStripQualityStatistics") << "PROBLEM detid " << detid << " value " << percentage << std::endl;
788  }
789  //&&&&&&&&&&&&&&&&&&
790  // printout
791  //&&&&&&&&&&&&&&&&&&
792 
793  cout << "\n-----------------\nNew IOV starting from run " << e.id().run() << " event " << e.id().event()
794  << " lumiBlock " << e.luminosityBlock() << " time " << e.time().value() << "\n-----------------\n";
795  cout << "\n-----------------\nGlobal Info\n-----------------";
796  cout << "\nBadComponent \t Modules \tFibers "
797  "\tApvs\tStrips\n----------------------------------------------------------------";
798  cout << "\nTracker:\t\t" << NTkBadComponent[0] << "\t" << NTkBadComponent[1] << "\t" << NTkBadComponent[2] << "\t"
799  << NTkBadComponent[3];
800  cout << endl;
801  cout << "\nTIB:\t\t\t" << NBadComponent[0][0][0] << "\t" << NBadComponent[0][0][1] << "\t" << NBadComponent[0][0][2]
802  << "\t" << NBadComponent[0][0][3];
803  cout << "\nTID:\t\t\t" << NBadComponent[1][0][0] << "\t" << NBadComponent[1][0][1] << "\t" << NBadComponent[1][0][2]
804  << "\t" << NBadComponent[1][0][3];
805  cout << "\nTOB:\t\t\t" << NBadComponent[2][0][0] << "\t" << NBadComponent[2][0][1] << "\t" << NBadComponent[2][0][2]
806  << "\t" << NBadComponent[2][0][3];
807  cout << "\nTEC:\t\t\t" << NBadComponent[3][0][0] << "\t" << NBadComponent[3][0][1] << "\t" << NBadComponent[3][0][2]
808  << "\t" << NBadComponent[3][0][3];
809  cout << "\n";
810 
811  for (int i = 1; i < 5; ++i)
812  cout << "\nTIB Layer " << i << " :\t\t" << NBadComponent[0][i][0] << "\t" << NBadComponent[0][i][1] << "\t"
813  << NBadComponent[0][i][2] << "\t" << NBadComponent[0][i][3];
814  cout << "\n";
815  for (int i = 1; i < 4; ++i)
816  cout << "\nTID+ Disk " << i << " :\t\t" << NBadComponent[1][i][0] << "\t" << NBadComponent[1][i][1] << "\t"
817  << NBadComponent[1][i][2] << "\t" << NBadComponent[1][i][3];
818  for (int i = 4; i < 7; ++i)
819  cout << "\nTID- Disk " << i - 3 << " :\t\t" << NBadComponent[1][i][0] << "\t" << NBadComponent[1][i][1] << "\t"
820  << NBadComponent[1][i][2] << "\t" << NBadComponent[1][i][3];
821  cout << "\n";
822  for (int i = 1; i < 7; ++i)
823  cout << "\nTOB Layer " << i << " :\t\t" << NBadComponent[2][i][0] << "\t" << NBadComponent[2][i][1] << "\t"
824  << NBadComponent[2][i][2] << "\t" << NBadComponent[2][i][3];
825  cout << "\n";
826  for (int i = 1; i < 10; ++i)
827  cout << "\nTEC+ Disk " << i << " :\t\t" << NBadComponent[3][i][0] << "\t" << NBadComponent[3][i][1] << "\t"
828  << NBadComponent[3][i][2] << "\t" << NBadComponent[3][i][3];
829  for (int i = 10; i < 19; ++i)
830  cout << "\nTEC- Disk " << i - 9 << " :\t\t" << NBadComponent[3][i][0] << "\t" << NBadComponent[3][i][1] << "\t"
831  << NBadComponent[3][i][2] << "\t" << NBadComponent[3][i][3];
832  cout << "\n";
833 
834  cout << "\n----------------------------------------------------------------\n\t\t Detid \tModules Fibers "
835  "Apvs\n----------------------------------------------------------------";
836  for (int i = 1; i < 5; ++i)
837  cout << "\nTIB Layer " << i << " :" << ssV[0][i].str();
838  cout << "\n";
839  for (int i = 1; i < 4; ++i)
840  cout << "\nTID+ Disk " << i << " :" << ssV[1][i].str();
841  for (int i = 4; i < 7; ++i)
842  cout << "\nTID- Disk " << i - 3 << " :" << ssV[1][i].str();
843  cout << "\n";
844  for (int i = 1; i < 7; ++i)
845  cout << "\nTOB Layer " << i << " :" << ssV[2][i].str();
846  cout << "\n";
847  for (int i = 1; i < 10; ++i)
848  cout << "\nTEC+ Disk " << i << " :" << ssV[3][i].str();
849  for (int i = 10; i < 19; ++i)
850  cout << "\nTEC- Disk " << i - 9 << " :" << ssV[3][i].str();
851 
852  // store also bad modules in log file
853  ofstream badModules;
854  badModules.open("BadModules.log");
855  badModules << "\n----------------------------------------------------------------\n\t\t Detid \tModules Fibers "
856  "Apvs\n----------------------------------------------------------------";
857  for (int i = 1; i < 5; ++i)
858  badModules << "\nTIB Layer " << i << " :" << ssV[0][i].str();
859  badModules << "\n";
860  for (int i = 1; i < 4; ++i)
861  badModules << "\nTID+ Disk " << i << " :" << ssV[1][i].str();
862  for (int i = 4; i < 7; ++i)
863  badModules << "\nTID- Disk " << i - 3 << " :" << ssV[1][i].str();
864  badModules << "\n";
865  for (int i = 1; i < 7; ++i)
866  badModules << "\nTOB Layer " << i << " :" << ssV[2][i].str();
867  badModules << "\n";
868  for (int i = 1; i < 10; ++i)
869  badModules << "\nTEC+ Disk " << i << " :" << ssV[3][i].str();
870  for (int i = 10; i < 19; ++i)
871  badModules << "\nTEC- Disk " << i - 9 << " :" << ssV[3][i].str();
872  badModules.close();
873 }

References _autoIneffModTagging, _badModulesFile, _bunchx, _clusterMatchingMethod, _clusterTrajDist, _ResXSig, _showRings, _showTOB6TEC9, _stripsApvEdge, _useCM, _useOnlyHighPurityTracks, a, funct::abs(), accept(), alllayerfound, alllayertotal, electrons_cff::bool, Surface::bounds(), simKBmtfDigis_cfi::bx, bxHisto, HltBtagPostValidation_cff::c, CalibTree, CalibTreeFilenames, gather_cfg::cout, SiStripBadStrip::decode(), MillePedeFileConverter_cfg::e, end, eventInfos, cppFunctionSkipper::exception, fs, get, SiStripQuality::getBadComponentList(), SiStripBadStrip::getDataVectorBegin(), GetLayerName(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), goodlayerfound, goodlayertotal, muons_cff::highPurity, hits, mps_fire::i, triggerObjects_cff::id, hit::id, TrackerGeometry::idToDetUnit(), compare_using_db::ifile, muonGEMDigis_cfi::instLumi, instLumiHisto, createfilelist::int, dqmiolumiharvest::j, dqmdumpme::k, cmsLHEtoEOSManager::l, layerfound, layerfound_perBx, layerfound_vsCM, layerfound_vsLumi, layerfound_vsPU, layertotal, layertotal_perBx, layertotal_vsCM, layertotal_vsLumi, layertotal_vsPU, mps_splice::line, TFileService::make(), makeHotColdMaps(), makeSQLite(), makeSummary(), makeSummaryVsBx(), makeSummaryVsCM(), makeSummaryVsLumi(), makeTKMap(), modCounter, mps_splice::mods, cmsHarvester::nevents, nevt, nModsMin, StripTopology::nstrips(), nTEClayers, TrapezoidalPlaneBounds::parameters(), edm::ESHandle< T >::product(), JetPlusTrackCorrections_cff::PU, PUHisto, qcdUeDQM_cfi::quality, quality_, SiStripBadStrip::data::range, FastTimerService_cff::range, reader, writedatasetfile::run, SetBadComponents(), StripGeomDetUnit::specificTopology(), contentValuesCheck::ss, str, TrackingMonitor_cfi::stripCluster, GeomDet::surface(), SiStripDetId::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), threshold, SiStripDetId::TIB, TrackerTopology::tibLayer(), SiStripDetId::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), SiStripDetId::TOB, TrackerTopology::tobLayer(), totalStatistics(), PbPb_ZMuSkimMuonDPG_cff::tracker, Bounds::width(), x, hit::x, testProducerWithPsetDescEmpty_cfi::x1, y, hit::y, z, and hit::z.

◆ algoBeginJob()

void SiStripHitEffFromCalibTree::algoBeginJob ( const edm::EventSetup )
overrideprivatevirtual

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 219 of file SiStripHitEffFromCalibTree.cc.

219  {
220  //I have no idea what goes here
221  //fs->make<TTree>("HitEffHistos","Tree of the inefficient hit histograms");
222 }

◆ algoEndJob()

void SiStripHitEffFromCalibTree::algoEndJob ( )
overrideprivatevirtual

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 224 of file SiStripHitEffFromCalibTree.cc.

224  {
225  //Still have no idea what goes here
226 }

◆ calcPhi()

float SiStripHitEffFromCalibTree::calcPhi ( float  x,
float  y 
)
private

Definition at line 1582 of file SiStripHitEffFromCalibTree.cc.

1582  {
1583  float phi = 0;
1584  float Pi = 3.14159;
1585  if ((x >= 0) && (y >= 0))
1586  phi = atan(y / x);
1587  else if ((x >= 0) && (y <= 0))
1588  phi = atan(y / x) + 2 * Pi;
1589  else if ((x <= 0) && (y >= 0))
1590  phi = atan(y / x) + Pi;
1591  else
1592  phi = atan(y / x) + Pi;
1593  phi = phi * 180.0 / Pi;
1594 
1595  return phi;
1596 }

References phi, Pi, x, and y.

Referenced by makeHotColdMaps().

◆ ComputeEff()

void SiStripHitEffFromCalibTree::ComputeEff ( vector< TH1F * > &  vhfound,
vector< TH1F * > &  vhtotal,
string  name 
)
private

Definition at line 1462 of file SiStripHitEffFromCalibTree.cc.

1462  {
1463  unsigned int nLayers = 22;
1464  if (_showRings)
1465  nLayers = 20;
1466 
1467  TH1F* hfound;
1468  TH1F* htotal;
1469 
1470  for (unsigned int ilayer = 1; ilayer < nLayers; ilayer++) {
1471  hfound = vhfound[ilayer];
1472  htotal = vhtotal[ilayer];
1473 
1474  hfound->Sumw2();
1475  htotal->Sumw2();
1476 
1477  // new ROOT version: TGraph::Divide don't handle null or negative values
1478  for (Long_t i = 0; i < hfound->GetNbinsX() + 1; ++i) {
1479  if (hfound->GetBinContent(i) == 0)
1480  hfound->SetBinContent(i, 1e-6);
1481  if (htotal->GetBinContent(i) == 0)
1482  htotal->SetBinContent(i, 1);
1483  }
1484 
1485  TGraphAsymmErrors* geff = fs->make<TGraphAsymmErrors>(hfound->GetNbinsX());
1486  geff->SetName(Form("%s_layer%i", name.c_str(), ilayer));
1487  geff->BayesDivide(hfound, htotal);
1488  if (name == "effVsLumi")
1489  geff->SetTitle("Hit Efficiency vs inst. lumi. - " + GetLayerName(ilayer));
1490  if (name == "effVsPU")
1491  geff->SetTitle("Hit Efficiency vs pileup - " + GetLayerName(ilayer));
1492  if (name == "effVsCM")
1493  geff->SetTitle("Hit Efficiency vs common Mode - " + GetLayerName(ilayer));
1494  geff->SetMarkerStyle(20);
1495  }
1496 }

References _showRings, MillePedeFileConverter_cfg::e, fs, GetLayerName(), mps_fire::i, TFileService::make(), Skims_PA_cff::name, and MuonTCMETValueMapProducer_cff::nLayers.

Referenced by makeSummaryVsCM(), and makeSummaryVsLumi().

◆ GetLayerName()

TString SiStripHitEffFromCalibTree::GetLayerName ( Long_t  k)
private

Definition at line 1444 of file SiStripHitEffFromCalibTree.cc.

1444  {
1445  TString layername = "";
1446  TString ringlabel = "D";
1447  if (_showRings)
1448  ringlabel = "R";
1449  if (k > 0 && k < 5) {
1450  layername = TString("TIB L") + k;
1451  } else if (k > 4 && k < 11) {
1452  layername = TString("TOB L") + (k - 4);
1453  } else if (k > 10 && k < 14) {
1454  layername = TString("TID ") + ringlabel + (k - 10);
1455  } else if (k > 13 && k < 14 + nTEClayers) {
1456  layername = TString("TEC ") + ringlabel + (k - 13);
1457  }
1458 
1459  return layername;
1460 }

References _showRings, dqmdumpme::k, and nTEClayers.

Referenced by algoAnalyze(), ComputeEff(), makeSummary(), makeSummaryVsBx(), makeTKMap(), and totalStatistics().

◆ GetLayerSideName()

TString SiStripHitEffFromCalibTree::GetLayerSideName ( Long_t  k)
private

Definition at line 1541 of file SiStripHitEffFromCalibTree.cc.

1541  {
1542  TString layername = "";
1543  TString ringlabel = "D";
1544  if (_showRings)
1545  ringlabel = "R";
1546  if (k > 0 && k < 5) {
1547  layername = TString("TIB L") + k;
1548  } else if (k > 4 && k < 11) {
1549  layername = TString("TOB L") + (k - 4);
1550  } else if (k > 10 && k < 14) {
1551  layername = TString("TID- ") + ringlabel + (k - 10);
1552  } else if (k > 13 && k < 17) {
1553  layername = TString("TID+ ") + ringlabel + (k - 13);
1554  } else if (k > 16 && k < 17 + nTEClayers) {
1555  layername = TString("TEC- ") + ringlabel + (k - 16);
1556  } else if (k > 16 + nTEClayers) {
1557  layername = TString("TEC+ ") + ringlabel + (k - 16 - nTEClayers);
1558  }
1559 
1560  return layername;
1561 }

References _showRings, dqmdumpme::k, and nTEClayers.

Referenced by makeSummary().

◆ getNewObject()

std::unique_ptr< SiStripBadStrip > SiStripHitEffFromCalibTree::getNewObject ( )
overrideprivatevirtual

Implements ConditionDBWriter< SiStripBadStrip >.

Definition at line 1563 of file SiStripHitEffFromCalibTree.cc.

1563  {
1564  //Need this for a Condition DB Writer
1565  //Initialize a return variable
1566  auto obj = std::make_unique<SiStripBadStrip>();
1567 
1570 
1571  for (; rIter != rIterEnd; ++rIter) {
1573  quality_->getDataVectorBegin() + rIter->iend);
1574  if (!obj->put(rIter->detid, range))
1575  edm::LogError("SiStripHitEffFromCalibTree")
1576  << "[SiStripHitEffFromCalibTree::getNewObject] detid already exists" << std::endl;
1577  }
1578 
1579  return obj;
1580 }

References SiStripBadStrip::getDataVectorBegin(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), getGTfromDQMFile::obj, quality_, and FastTimerService_cff::range.

◆ makeHotColdMaps()

void SiStripHitEffFromCalibTree::makeHotColdMaps ( )
private

Definition at line 875 of file SiStripHitEffFromCalibTree.cc.

875  {
876  cout << "Entering hot cold map generation!\n";
877  TStyle* gStyle = new TStyle("gStyle", "myStyle");
878  gStyle->cd();
879  gStyle->SetPalette(1);
880  gStyle->SetCanvasColor(kWhite);
881  gStyle->SetOptStat(0);
882  //Here we make the hot/cold color maps that we love so very much
883  //Already have access to the data as a private variable
884  //Create all of the histograms in the TFileService
885  TH2F* temph2;
886  for (Long_t maplayer = 1; maplayer <= 22; maplayer++) {
887  //Initialize all of the histograms
888  if (maplayer > 0 && maplayer <= 4) {
889  //We are in the TIB
890  temph2 = fs->make<TH2F>(Form("%s%i", "TIB", (int)(maplayer)), "TIB", 100, -1, 361, 100, -100, 100);
891  temph2->GetXaxis()->SetTitle("Phi");
892  temph2->GetXaxis()->SetBinLabel(1, TString("360"));
893  temph2->GetXaxis()->SetBinLabel(50, TString("180"));
894  temph2->GetXaxis()->SetBinLabel(100, TString("0"));
895  temph2->GetYaxis()->SetTitle("Global Z");
896  temph2->SetOption("colz");
897  HotColdMaps.push_back(temph2);
898  } else if (maplayer > 4 && maplayer <= 10) {
899  //We are in the TOB
900  temph2 = fs->make<TH2F>(Form("%s%i", "TOB", (int)(maplayer - 4)), "TOB", 100, -1, 361, 100, -120, 120);
901  temph2->GetXaxis()->SetTitle("Phi");
902  temph2->GetXaxis()->SetBinLabel(1, TString("360"));
903  temph2->GetXaxis()->SetBinLabel(50, TString("180"));
904  temph2->GetXaxis()->SetBinLabel(100, TString("0"));
905  temph2->GetYaxis()->SetTitle("Global Z");
906  temph2->SetOption("colz");
907  HotColdMaps.push_back(temph2);
908  } else if (maplayer > 10 && maplayer <= 13) {
909  //We are in the TID
910  //Split by +/-
911  temph2 = fs->make<TH2F>(Form("%s%i", "TID-", (int)(maplayer - 10)), "TID-", 100, -100, 100, 100, -100, 100);
912  temph2->GetXaxis()->SetTitle("Global Y");
913  temph2->GetXaxis()->SetBinLabel(1, TString("+Y"));
914  temph2->GetXaxis()->SetBinLabel(50, TString("0"));
915  temph2->GetXaxis()->SetBinLabel(100, TString("-Y"));
916  temph2->GetYaxis()->SetTitle("Global X");
917  temph2->GetYaxis()->SetBinLabel(1, TString("-X"));
918  temph2->GetYaxis()->SetBinLabel(50, TString("0"));
919  temph2->GetYaxis()->SetBinLabel(100, TString("+X"));
920  temph2->SetOption("colz");
921  HotColdMaps.push_back(temph2);
922  temph2 = fs->make<TH2F>(Form("%s%i", "TID+", (int)(maplayer - 10)), "TID+", 100, -100, 100, 100, -100, 100);
923  temph2->GetXaxis()->SetTitle("Global Y");
924  temph2->GetXaxis()->SetBinLabel(1, TString("+Y"));
925  temph2->GetXaxis()->SetBinLabel(50, TString("0"));
926  temph2->GetXaxis()->SetBinLabel(100, TString("-Y"));
927  temph2->GetYaxis()->SetTitle("Global X");
928  temph2->GetYaxis()->SetBinLabel(1, TString("-X"));
929  temph2->GetYaxis()->SetBinLabel(50, TString("0"));
930  temph2->GetYaxis()->SetBinLabel(100, TString("+X"));
931  temph2->SetOption("colz");
932  HotColdMaps.push_back(temph2);
933  } else if (maplayer > 13) {
934  //We are in the TEC
935  //Split by +/-
936  temph2 = fs->make<TH2F>(Form("%s%i", "TEC-", (int)(maplayer - 13)), "TEC-", 100, -120, 120, 100, -120, 120);
937  temph2->GetXaxis()->SetTitle("Global Y");
938  temph2->GetXaxis()->SetBinLabel(1, TString("+Y"));
939  temph2->GetXaxis()->SetBinLabel(50, TString("0"));
940  temph2->GetXaxis()->SetBinLabel(100, TString("-Y"));
941  temph2->GetYaxis()->SetTitle("Global X");
942  temph2->GetYaxis()->SetBinLabel(1, TString("-X"));
943  temph2->GetYaxis()->SetBinLabel(50, TString("0"));
944  temph2->GetYaxis()->SetBinLabel(100, TString("+X"));
945  temph2->SetOption("colz");
946  HotColdMaps.push_back(temph2);
947  temph2 = fs->make<TH2F>(Form("%s%i", "TEC+", (int)(maplayer - 13)), "TEC+", 100, -120, 120, 100, -120, 120);
948  temph2->GetXaxis()->SetTitle("Global Y");
949  temph2->GetXaxis()->SetBinLabel(1, TString("+Y"));
950  temph2->GetXaxis()->SetBinLabel(50, TString("0"));
951  temph2->GetXaxis()->SetBinLabel(100, TString("-Y"));
952  temph2->GetYaxis()->SetTitle("Global X");
953  temph2->GetYaxis()->SetBinLabel(1, TString("-X"));
954  temph2->GetYaxis()->SetBinLabel(50, TString("0"));
955  temph2->GetYaxis()->SetBinLabel(100, TString("+X"));
956  temph2->SetOption("colz");
957  HotColdMaps.push_back(temph2);
958  }
959  }
960  for (Long_t mylayer = 1; mylayer <= 22; mylayer++) {
961  //Determine what kind of plot we want to write out
962  //Loop through the entirety of each layer
963  //Create an array of the histograms
964  vector<hit>::const_iterator iter;
965  for (iter = hits[mylayer].begin(); iter != hits[mylayer].end(); iter++) {
966  //Looping over the particular layer
967  //Fill by 360-x to get the proper location to compare with TKMaps of phi
968  //Also global xy is messed up
969  if (mylayer > 0 && mylayer <= 4) {
970  //We are in the TIB
971  float phi = calcPhi(iter->x, iter->y);
972  HotColdMaps[mylayer - 1]->Fill(360. - phi, iter->z, 1.);
973  } else if (mylayer > 4 && mylayer <= 10) {
974  //We are in the TOB
975  float phi = calcPhi(iter->x, iter->y);
976  HotColdMaps[mylayer - 1]->Fill(360. - phi, iter->z, 1.);
977  } else if (mylayer > 10 && mylayer <= 13) {
978  //We are in the TID
979  //There are 2 different maps here
980  int side = (((iter->id) >> 13) & 0x3);
981  if (side == 1)
982  HotColdMaps[(mylayer - 1) + (mylayer - 11)]->Fill(-iter->y, iter->x, 1.);
983  else if (side == 2)
984  HotColdMaps[(mylayer - 1) + (mylayer - 10)]->Fill(-iter->y, iter->x, 1.);
985  //if(side == 1) HotColdMaps[(mylayer - 1) + (mylayer - 11)]->Fill(iter->x,iter->y,1.);
986  //else if(side == 2) HotColdMaps[(mylayer - 1) + (mylayer - 10)]->Fill(iter->x,iter->y,1.);
987  } else if (mylayer > 13) {
988  //We are in the TEC
989  //There are 2 different maps here
990  int side = (((iter->id) >> 18) & 0x3);
991  if (side == 1)
992  HotColdMaps[(mylayer + 2) + (mylayer - 14)]->Fill(-iter->y, iter->x, 1.);
993  else if (side == 2)
994  HotColdMaps[(mylayer + 2) + (mylayer - 13)]->Fill(-iter->y, iter->x, 1.);
995  //if(side == 1) HotColdMaps[(mylayer + 2) + (mylayer - 14)]->Fill(iter->x,iter->y,1.);
996  //else if(side == 2) HotColdMaps[(mylayer + 2) + (mylayer - 13)]->Fill(iter->x,iter->y,1.);
997  }
998  }
999  }
1000  cout << "Finished HotCold Map Generation\n";
1001 }

References begin, calcPhi(), gather_cfg::cout, fs, hits, HotColdMaps, TFileService::make(), and phi.

Referenced by algoAnalyze().

◆ makeSQLite()

void SiStripHitEffFromCalibTree::makeSQLite ( )
private

Definition at line 1102 of file SiStripHitEffFromCalibTree.cc.

1102  {
1103  //Generate the SQLite file for use in the Database of the bad modules!
1104  cout << "Entering SQLite file generation!\n";
1105  std::vector<unsigned int> BadStripList;
1106  unsigned short NStrips;
1107  unsigned int id1;
1108  std::unique_ptr<SiStripQuality> pQuality = std::make_unique<SiStripQuality>();
1109  //This is the list of the bad strips, use to mask out entire APVs
1110  //Now simply go through the bad hit list and mask out things that
1111  //are bad!
1112  map<unsigned int, double>::const_iterator it;
1113  for (it = BadModules.begin(); it != BadModules.end(); it++) {
1114  //We need to figure out how many strips are in this particular module
1115  //To Mask correctly!
1116  NStrips = reader->getNumberOfApvsAndStripLength((*it).first).first * 128;
1117  cout << "Number of strips module " << (*it).first << " is " << NStrips << endl;
1118  BadStripList.push_back(pQuality->encode(0, NStrips, 0));
1119  //Now compact into a single bad module
1120  id1 = (unsigned int)(*it).first;
1121  cout << "ID1 shoudl match list of modules above " << id1 << endl;
1122  quality_->compact(id1, BadStripList);
1123  SiStripQuality::Range range(BadStripList.begin(), BadStripList.end());
1124  quality_->put(id1, range);
1125  BadStripList.clear();
1126  }
1127  //Fill all the bad components now
1129 }

References BadModules, SiStripQuality::compact(), gather_cfg::cout, SiStripQuality::fillBadComponents(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), globals_cff::id1, createfilelist::int, SiStripBadStrip::put(), quality_, FastTimerService_cff::range, and reader.

Referenced by algoAnalyze().

◆ makeSummary()

void SiStripHitEffFromCalibTree::makeSummary ( )
private

Definition at line 1179 of file SiStripHitEffFromCalibTree.cc.

1179  {
1180  //setTDRStyle();
1181 
1182  int nLayers = 34;
1183  if (_showRings)
1184  nLayers = 30;
1185  if (!_showEndcapSides) {
1186  if (!_showRings)
1187  nLayers = 22;
1188  else
1189  nLayers = 20;
1190  }
1191 
1192  TH1F* found = fs->make<TH1F>("found", "found", nLayers + 1, 0, nLayers + 1);
1193  TH1F* all = fs->make<TH1F>("all", "all", nLayers + 1, 0, nLayers + 1);
1194  TH1F* found2 = fs->make<TH1F>("found2", "found2", nLayers + 1, 0, nLayers + 1);
1195  TH1F* all2 = fs->make<TH1F>("all2", "all2", nLayers + 1, 0, nLayers + 1);
1196  // first bin only to keep real data off the y axis so set to -1
1197  found->SetBinContent(0, -1);
1198  all->SetBinContent(0, 1);
1199 
1200  // new ROOT version: TGraph::Divide don't handle null or negative values
1201  for (Long_t i = 1; i < nLayers + 2; ++i) {
1202  found->SetBinContent(i, 1e-6);
1203  all->SetBinContent(i, 1);
1204  found2->SetBinContent(i, 1e-6);
1205  all2->SetBinContent(i, 1);
1206  }
1207 
1208  TCanvas* c7 = new TCanvas("c7", " test ", 10, 10, 800, 600);
1209  c7->SetFillColor(0);
1210  c7->SetGrid();
1211 
1212  int nLayers_max = nLayers + 1; // barrel+endcap
1213  if (!_showEndcapSides)
1214  nLayers_max = 11; // barrel
1215  for (Long_t i = 1; i < nLayers_max; ++i) {
1216  cout << "Fill only good modules layer " << i << ": S = " << goodlayerfound[i] << " B = " << goodlayertotal[i]
1217  << endl;
1218  if (goodlayertotal[i] > 5) {
1219  found->SetBinContent(i, goodlayerfound[i]);
1220  all->SetBinContent(i, goodlayertotal[i]);
1221  }
1222 
1223  cout << "Filling all modules layer " << i << ": S = " << alllayerfound[i] << " B = " << alllayertotal[i]
1224  << endl;
1225  if (alllayertotal[i] > 5) {
1226  found2->SetBinContent(i, alllayerfound[i]);
1227  all2->SetBinContent(i, alllayertotal[i]);
1228  }
1229  }
1230 
1231  // endcap - merging sides
1232  if (!_showEndcapSides) {
1233  for (Long_t i = 11; i < 14; ++i) { // TID disks
1234  cout << "Fill only good modules layer " << i << ": S = " << goodlayerfound[i] + goodlayerfound[i + 3]
1235  << " B = " << goodlayertotal[i] + goodlayertotal[i + 3] << endl;
1236  if (goodlayertotal[i] + goodlayertotal[i + 3] > 5) {
1237  found->SetBinContent(i, goodlayerfound[i] + goodlayerfound[i + 3]);
1238  all->SetBinContent(i, goodlayertotal[i] + goodlayertotal[i + 3]);
1239  }
1240  cout << "Filling all modules layer " << i << ": S = " << alllayerfound[i] + alllayerfound[i + 3]
1241  << " B = " << alllayertotal[i] + alllayertotal[i + 3] << endl;
1242  if (alllayertotal[i] + alllayertotal[i + 3] > 5) {
1243  found2->SetBinContent(i, alllayerfound[i] + alllayerfound[i + 3]);
1244  all2->SetBinContent(i, alllayertotal[i] + alllayertotal[i + 3]);
1245  }
1246  }
1247  for (Long_t i = 17; i < 17 + nTEClayers; ++i) { // TEC disks
1248  cout << "Fill only good modules layer " << i - 3
1249  << ": S = " << goodlayerfound[i] + goodlayerfound[i + nTEClayers]
1250  << " B = " << goodlayertotal[i] + goodlayertotal[i + nTEClayers] << endl;
1251  if (goodlayertotal[i] + goodlayertotal[i + nTEClayers] > 5) {
1252  found->SetBinContent(i - 3, goodlayerfound[i] + goodlayerfound[i + nTEClayers]);
1253  all->SetBinContent(i - 3, goodlayertotal[i] + goodlayertotal[i + nTEClayers]);
1254  }
1255  cout << "Filling all modules layer " << i - 3 << ": S = " << alllayerfound[i] + alllayerfound[i + nTEClayers]
1256  << " B = " << alllayertotal[i] + alllayertotal[i + nTEClayers] << endl;
1257  if (alllayertotal[i] + alllayertotal[i + nTEClayers] > 5) {
1258  found2->SetBinContent(i - 3, alllayerfound[i] + alllayerfound[i + nTEClayers]);
1259  all2->SetBinContent(i - 3, alllayertotal[i] + alllayertotal[i + nTEClayers]);
1260  }
1261  }
1262  }
1263 
1264  found->Sumw2();
1265  all->Sumw2();
1266 
1267  found2->Sumw2();
1268  all2->Sumw2();
1269 
1270  TGraphAsymmErrors* gr = fs->make<TGraphAsymmErrors>(nLayers + 1);
1271  gr->SetName("eff_good");
1272  gr->BayesDivide(found, all);
1273 
1274  TGraphAsymmErrors* gr2 = fs->make<TGraphAsymmErrors>(nLayers + 1);
1275  gr2->SetName("eff_all");
1276  gr2->BayesDivide(found2, all2);
1277 
1278  for (int j = 0; j < nLayers + 1; j++) {
1279  gr->SetPointError(j, 0., 0., gr->GetErrorYlow(j), gr->GetErrorYhigh(j));
1280  gr2->SetPointError(j, 0., 0., gr2->GetErrorYlow(j), gr2->GetErrorYhigh(j));
1281  }
1282 
1283  gr->GetXaxis()->SetLimits(0, nLayers);
1284  gr->SetMarkerColor(2);
1285  gr->SetMarkerSize(1.2);
1286  gr->SetLineColor(2);
1287  gr->SetLineWidth(4);
1288  gr->SetMarkerStyle(20);
1289  gr->SetMinimum(_effPlotMin);
1290  gr->SetMaximum(1.001);
1291  gr->GetYaxis()->SetTitle("Efficiency");
1292  gStyle->SetTitleFillColor(0);
1293  gStyle->SetTitleBorderSize(0);
1294  gr->SetTitle(_title);
1295 
1296  gr2->GetXaxis()->SetLimits(0, nLayers);
1297  gr2->SetMarkerColor(1);
1298  gr2->SetMarkerSize(1.2);
1299  gr2->SetLineColor(1);
1300  gr2->SetLineWidth(4);
1301  gr2->SetMarkerStyle(21);
1302  gr2->SetMinimum(_effPlotMin);
1303  gr2->SetMaximum(1.001);
1304  gr2->GetYaxis()->SetTitle("Efficiency");
1305  gr2->SetTitle(_title);
1306 
1307  for (Long_t k = 1; k < nLayers + 1; k++) {
1308  TString label;
1309  if (_showEndcapSides)
1311  else
1312  label = GetLayerName(k);
1313  if (!_showTOB6TEC9) {
1314  if (k == 10)
1315  label = "";
1316  if (!_showRings && k == nLayers)
1317  label = "";
1318  if (!_showRings && _showEndcapSides && k == 25)
1319  label = "";
1320  }
1321  if (!_showRings) {
1322  if (_showEndcapSides) {
1323  gr->GetXaxis()->SetBinLabel(((k + 1) * 100 + 2) / (nLayers)-4, label);
1324  gr2->GetXaxis()->SetBinLabel(((k + 1) * 100 + 2) / (nLayers)-4, label);
1325  } else {
1326  gr->GetXaxis()->SetBinLabel((k + 1) * 100 / (nLayers)-6, label);
1327  gr2->GetXaxis()->SetBinLabel((k + 1) * 100 / (nLayers)-6, label);
1328  }
1329  } else {
1330  if (_showEndcapSides) {
1331  gr->GetXaxis()->SetBinLabel((k + 1) * 100 / (nLayers)-4, label);
1332  gr2->GetXaxis()->SetBinLabel((k + 1) * 100 / (nLayers)-4, label);
1333  } else {
1334  gr->GetXaxis()->SetBinLabel((k + 1) * 100 / (nLayers)-7, label);
1335  gr2->GetXaxis()->SetBinLabel((k + 1) * 100 / (nLayers)-7, label);
1336  }
1337  }
1338  }
1339 
1340  gr->Draw("AP");
1341  gr->GetXaxis()->SetNdivisions(36);
1342 
1343  c7->cd();
1344  TPad* overlay = new TPad("overlay", "", 0, 0, 1, 1);
1345  overlay->SetFillStyle(4000);
1346  overlay->SetFillColor(0);
1347  overlay->SetFrameFillStyle(4000);
1348  overlay->Draw("same");
1349  overlay->cd();
1350  if (!_showOnlyGoodModules)
1351  gr2->Draw("AP");
1352 
1353  TLegend* leg = new TLegend(0.70, 0.27, 0.88, 0.40);
1354  leg->AddEntry(gr, "Good Modules", "p");
1355  if (!_showOnlyGoodModules)
1356  leg->AddEntry(gr2, "All Modules", "p");
1357  leg->SetTextSize(0.020);
1358  leg->SetFillColor(0);
1359  leg->Draw("same");
1360 
1361  c7->SaveAs("Summary.png");
1362 }

References _effPlotMin, _showEndcapSides, _showOnlyGoodModules, _showRings, _showTOB6TEC9, _title, python.cmstools::all(), alllayerfound, alllayertotal, gather_cfg::cout, MillePedeFileConverter_cfg::e, newFWLiteAna::found, fs, GetLayerName(), GetLayerSideName(), goodlayerfound, goodlayertotal, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, label, TFileService::make(), MuonTCMETValueMapProducer_cff::nLayers, nTEClayers, and compare::overlay().

Referenced by algoAnalyze().

◆ makeSummaryVsBx()

void SiStripHitEffFromCalibTree::makeSummaryVsBx ( )
private

Definition at line 1364 of file SiStripHitEffFromCalibTree.cc.

1364  {
1365  cout << "Computing efficiency vs bx" << endl;
1366 
1367  unsigned int nLayers = 22;
1368  if (_showRings)
1369  nLayers = 20;
1370 
1371  for (unsigned int ilayer = 1; ilayer < nLayers; ilayer++) {
1372  TH1F* hfound = fs->make<TH1F>(Form("foundVsBx_layer%i", ilayer), Form("layer %i", ilayer), 3565, 0, 3565);
1373  TH1F* htotal = fs->make<TH1F>(Form("totalVsBx_layer%i", ilayer), Form("layer %i", ilayer), 3565, 0, 3565);
1374 
1375  for (unsigned int ibx = 0; ibx < 3566; ibx++) {
1376  hfound->SetBinContent(ibx, 1e-6);
1377  htotal->SetBinContent(ibx, 1);
1378  }
1379  map<unsigned int, vector<int> >::iterator iterMapvsBx;
1380  for (iterMapvsBx = layerfound_perBx.begin(); iterMapvsBx != layerfound_perBx.end(); ++iterMapvsBx)
1381  hfound->SetBinContent(iterMapvsBx->first, iterMapvsBx->second[ilayer]);
1382  for (iterMapvsBx = layertotal_perBx.begin(); iterMapvsBx != layertotal_perBx.end(); ++iterMapvsBx)
1383  if (iterMapvsBx->second[ilayer] > 0)
1384  htotal->SetBinContent(iterMapvsBx->first, iterMapvsBx->second[ilayer]);
1385 
1386  hfound->Sumw2();
1387  htotal->Sumw2();
1388 
1389  TGraphAsymmErrors* geff = fs->make<TGraphAsymmErrors>(3564);
1390  geff->SetName(Form("effVsBx_layer%i", ilayer));
1391  geff->SetTitle("Hit Efficiency vs bx - " + GetLayerName(ilayer));
1392  geff->BayesDivide(hfound, htotal);
1393 
1394  //Average over trains
1395  TGraphAsymmErrors* geff_avg = fs->make<TGraphAsymmErrors>();
1396  geff_avg->SetName(Form("effVsBxAvg_layer%i", ilayer));
1397  geff_avg->SetTitle("Hit Efficiency vs bx - " + GetLayerName(ilayer));
1398  geff_avg->SetMarkerStyle(20);
1399  int ibx = 0;
1400  int previous_bx = -80;
1401  int delta_bx = 0;
1402  int nbx = 0;
1403  int found = 0;
1404  int total = 0;
1405  double sum_bx = 0;
1406  int ipt = 0;
1407  float low, up, eff;
1408  int firstbx = 0;
1409  for (iterMapvsBx = layertotal_perBx.begin(); iterMapvsBx != layertotal_perBx.end(); ++iterMapvsBx) {
1410  ibx = iterMapvsBx->first;
1411  delta_bx = ibx - previous_bx;
1412  // consider a new train
1413  if (delta_bx > (int)_spaceBetweenTrains && nbx > 0 && total > 0) {
1414  eff = found / (float)total;
1415  //cout<<"new train "<<ipt<<" "<<sum_bx/nbx<<" "<<eff<<endl;
1416  geff_avg->SetPoint(ipt, sum_bx / nbx, eff);
1417  low = TEfficiency::Bayesian(total, found, .683, 1, 1, false);
1418  up = TEfficiency::Bayesian(total, found, .683, 1, 1, true);
1419  geff_avg->SetPointError(ipt, sum_bx / nbx - firstbx, previous_bx - sum_bx / nbx, eff - low, up - eff);
1420  ipt++;
1421  sum_bx = 0;
1422  found = 0;
1423  total = 0;
1424  nbx = 0;
1425  firstbx = ibx;
1426  }
1427  sum_bx += ibx;
1428  found += hfound->GetBinContent(ibx);
1429  total += htotal->GetBinContent(ibx);
1430  nbx++;
1431 
1432  previous_bx = ibx;
1433  }
1434  //last train
1435  eff = found / (float)total;
1436  //cout<<"new train "<<ipt<<" "<<sum_bx/nbx<<" "<<eff<<endl;
1437  geff_avg->SetPoint(ipt, sum_bx / nbx, eff);
1438  low = TEfficiency::Bayesian(total, found, .683, 1, 1, false);
1439  up = TEfficiency::Bayesian(total, found, .683, 1, 1, true);
1440  geff_avg->SetPointError(ipt, sum_bx / nbx - firstbx, previous_bx - sum_bx / nbx, eff - low, up - eff);
1441  }
1442 }

References _showRings, _spaceBetweenTrains, gather_cfg::cout, MillePedeFileConverter_cfg::e, dqmMemoryStats::float, newFWLiteAna::found, fs, GetLayerName(), layerfound_perBx, layertotal_perBx, LaserClient_cfi::low, TFileService::make(), MuonTCMETValueMapProducer_cff::nLayers, dqmMemoryStats::total, and up.

Referenced by algoAnalyze().

◆ makeSummaryVsCM()

void SiStripHitEffFromCalibTree::makeSummaryVsCM ( )
private

Definition at line 1536 of file SiStripHitEffFromCalibTree.cc.

1536  {
1537  cout << "Computing efficiency vs CM" << endl;
1539 }

References ComputeEff(), gather_cfg::cout, layerfound_vsCM, and layertotal_vsCM.

Referenced by algoAnalyze().

◆ makeSummaryVsLumi()

void SiStripHitEffFromCalibTree::makeSummaryVsLumi ( )
private

Definition at line 1498 of file SiStripHitEffFromCalibTree.cc.

1498  {
1499  cout << "Computing efficiency vs lumi" << endl;
1500 
1501  if (instLumiHisto->GetEntries()) // from infos per event
1502  cout << "Avg conditions (avg+/-rms): lumi :" << instLumiHisto->GetMean() << "+/-" << instLumiHisto->GetRMS()
1503  << " pu: " << PUHisto->GetMean() << "+/-" << PUHisto->GetRMS() << endl;
1504 
1505  else { // from infos per hit
1506 
1507  unsigned int nLayers = 22;
1508  if (_showRings)
1509  nLayers = 20;
1510  unsigned int nLayersForAvg = 0;
1511  float layerLumi = 0;
1512  float layerPU = 0;
1513  float avgLumi = 0;
1514  float avgPU = 0;
1515 
1516  cout << "Lumi summary: (avg over trajectory measurements)" << endl;
1517  for (unsigned int ilayer = 1; ilayer < nLayers; ilayer++) {
1518  layerLumi = layertotal_vsLumi[ilayer]->GetMean();
1519  layerPU = layertotal_vsPU[ilayer]->GetMean();
1520  //cout<<" layer "<<ilayer<<" lumi: "<<layerLumi<<" pu: "<<layerPU<<endl;
1521  if (layerLumi != 0 && layerPU != 0) {
1522  avgLumi += layerLumi;
1523  avgPU += layerPU;
1524  nLayersForAvg++;
1525  }
1526  }
1527  avgLumi /= nLayersForAvg;
1528  avgPU /= nLayersForAvg;
1529  cout << "Avg conditions: lumi :" << avgLumi << " pu: " << avgPU << endl;
1530  }
1531 
1534 }

References _showRings, ComputeEff(), gather_cfg::cout, instLumiHisto, layerfound_vsLumi, layerfound_vsPU, layertotal_vsLumi, layertotal_vsPU, MuonTCMETValueMapProducer_cff::nLayers, and PUHisto.

Referenced by algoAnalyze().

◆ makeTKMap()

void SiStripHitEffFromCalibTree::makeTKMap ( bool  autoTagging = false)
private

Definition at line 1003 of file SiStripHitEffFromCalibTree.cc.

1003  {
1004  cout << "Entering TKMap generation!\n";
1005  tkmap = new TrackerMap(" Detector Inefficiency ");
1006  tkmapbad = new TrackerMap(" Inefficient Modules ");
1007  tkmapeff = new TrackerMap(_title.Data());
1008  tkmapnum = new TrackerMap(" Detector numerator ");
1009  tkmapden = new TrackerMap(" Detector denominator ");
1010 
1011  double myeff, mynum, myden;
1012  double eff_limit = 0;
1013 
1014  for (Long_t i = 1; i <= 22; i++) {
1015  //Loop over every layer, extracting the information from
1016  //the map of the efficiencies
1017  layertotal[i] = 0;
1018  layerfound[i] = 0;
1019  TH1F* hEffInLayer =
1020  fs->make<TH1F>(Form("eff_layer%i", int(i)), Form("Module efficiency in layer %i", int(i)), 201, 0, 1.005);
1021 
1022  map<unsigned int, pair<unsigned int, unsigned int> >::const_iterator ih;
1023  for (ih = modCounter[i].begin(); ih != modCounter[i].end(); ih++) {
1024  //We should be in the layer in question, and looping over all of the modules in said layer
1025  //Generate the list for the TKmap, and the bad module list
1026  mynum = (double)(((*ih).second).second);
1027  myden = (double)(((*ih).second).first);
1028  if (myden > 0)
1029  myeff = mynum / myden;
1030  else
1031  myeff = 0;
1032  hEffInLayer->Fill(myeff);
1033 
1034  if (!autoTagging) {
1035  if ((myden >= nModsMin) && (myeff < threshold)) {
1036  //We have a bad module, put it in the list!
1037  BadModules[(*ih).first] = myeff;
1038  tkmapbad->fillc((*ih).first, 255, 0, 0);
1039  cout << "Layer " << i << " (" << GetLayerName(i) << ") module " << (*ih).first << " efficiency: " << myeff
1040  << " , " << mynum << "/" << myden << endl;
1041  } else {
1042  //Fill the bad list with empty results for every module
1043  tkmapbad->fillc((*ih).first, 255, 255, 255);
1044  }
1045  if (myden < nModsMin) {
1046  cout << "Layer " << i << " (" << GetLayerName(i) << ") module " << (*ih).first << " is under occupancy at "
1047  << myden << endl;
1048  }
1049  }
1050 
1051  //Put any module into the TKMap
1052  tkmap->fill((*ih).first, 1. - myeff);
1053  tkmapeff->fill((*ih).first, myeff);
1054  tkmapnum->fill((*ih).first, mynum);
1055  tkmapden->fill((*ih).first, myden);
1056 
1057  //Add the number of hits in the layer
1058  layertotal[i] += long(myden);
1059  layerfound[i] += long(mynum);
1060  }
1061 
1062  if (autoTagging) {
1063  //Compute threshold to use for each layer
1064  hEffInLayer->GetXaxis()->SetRange(3, hEffInLayer->GetNbinsX() + 1); // Remove from the avg modules below 1%
1065  eff_limit = hEffInLayer->GetMean() - threshold;
1066  cout << "Layer " << i << " threshold for bad modules: " << eff_limit << endl;
1067  hEffInLayer->GetXaxis()->SetRange(1, hEffInLayer->GetNbinsX() + 1);
1068 
1069  for (ih = modCounter[i].begin(); ih != modCounter[i].end(); ih++) {
1070  // Second loop over modules to tag inefficient ones
1071  mynum = (double)(((*ih).second).second);
1072  myden = (double)(((*ih).second).first);
1073  if (myden > 0)
1074  myeff = mynum / myden;
1075  else
1076  myeff = 0;
1077  if ((myden >= nModsMin) && (myeff < eff_limit)) {
1078  //We have a bad module, put it in the list!
1079  BadModules[(*ih).first] = myeff;
1080  tkmapbad->fillc((*ih).first, 255, 0, 0);
1081  cout << "Layer " << i << " (" << GetLayerName(i) << ") module " << (*ih).first << " efficiency: " << myeff
1082  << " , " << mynum << "/" << myden << endl;
1083  } else {
1084  //Fill the bad list with empty results for every module
1085  tkmapbad->fillc((*ih).first, 255, 255, 255);
1086  }
1087  if (myden < nModsMin) {
1088  cout << "Layer " << i << " (" << GetLayerName(i) << ") module " << (*ih).first << " layer " << i
1089  << " is under occupancy at " << myden << endl;
1090  }
1091  }
1092  }
1093  }
1094  tkmap->save(true, 0, 0, "SiStripHitEffTKMap.png");
1095  tkmapbad->save(true, 0, 0, "SiStripHitEffTKMapBad.png");
1096  tkmapeff->save(true, _tkMapMin, 1., "SiStripHitEffTKMapEff.png");
1097  tkmapnum->save(true, 0, 0, "SiStripHitEffTKMapNum.png");
1098  tkmapden->save(true, 0, 0, "SiStripHitEffTKMapDen.png");
1099  cout << "Finished TKMap Generation\n";
1100 }

References _title, _tkMapMin, BadModules, begin, gather_cfg::cout, TrackerMap::fill(), TrackerMap::fillc(), fs, GetLayerName(), mps_fire::i, layerfound, layertotal, TFileService::make(), modCounter, nModsMin, TrackerMap::save(), threshold, tkmap, tkmapbad, tkmapden, tkmapeff, and tkmapnum.

Referenced by algoAnalyze().

◆ SetBadComponents()

void SiStripHitEffFromCalibTree::SetBadComponents ( int  i,
int  component,
SiStripQuality::BadComponent BC,
std::stringstream  ssV[4][19],
int  NBadComponent[4][19][4] 
)
private

Definition at line 1598 of file SiStripHitEffFromCalibTree.cc.

1599  {
1600  int napv = reader->getNumberOfApvsAndStripLength(BC.detid).first;
1601 
1602  ssV[i][component] << "\n\t\t " << BC.detid << " \t " << BC.BadModule << " \t " << ((BC.BadFibers) & 0x1) << " ";
1603  if (napv == 4)
1604  ssV[i][component] << "x " << ((BC.BadFibers >> 1) & 0x1);
1605 
1606  if (napv == 6)
1607  ssV[i][component] << ((BC.BadFibers >> 1) & 0x1) << " " << ((BC.BadFibers >> 2) & 0x1);
1608  ssV[i][component] << " \t " << ((BC.BadApvs) & 0x1) << " " << ((BC.BadApvs >> 1) & 0x1) << " ";
1609  if (napv == 4)
1610  ssV[i][component] << "x x " << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1);
1611  if (napv == 6)
1612  ssV[i][component] << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1) << " "
1613  << ((BC.BadApvs >> 4) & 0x1) << " " << ((BC.BadApvs >> 5) & 0x1) << " ";
1614 
1615  if (BC.BadApvs) {
1616  NBadComponent[i][0][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) + ((BC.BadApvs >> 3) & 0x1) +
1617  ((BC.BadApvs >> 2) & 0x1) + ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
1618  NBadComponent[i][component][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) +
1619  ((BC.BadApvs >> 3) & 0x1) + ((BC.BadApvs >> 2) & 0x1) +
1620  ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
1621  }
1622  if (BC.BadFibers) {
1623  NBadComponent[i][0][1] += ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
1624  NBadComponent[i][component][1] +=
1625  ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
1626  }
1627  if (BC.BadModule) {
1628  NBadComponent[i][0][0]++;
1629  NBadComponent[i][component][0]++;
1630  }
1631 }

References SiStripQuality::BadComponent::BadApvs, SiStripQuality::BadComponent::BadFibers, SiStripQuality::BadComponent::BadModule, SiStripQuality::BadComponent::detid, SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), mps_fire::i, reader, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by algoAnalyze().

◆ totalStatistics()

void SiStripHitEffFromCalibTree::totalStatistics ( )
private

Definition at line 1131 of file SiStripHitEffFromCalibTree.cc.

1131  {
1132  //Calculate the statistics by layer
1133  int totalfound = 0;
1134  int totaltotal = 0;
1135  double layereff;
1136  int subdetfound[5];
1137  int subdettotal[5];
1138 
1139  for (Long_t i = 1; i < 5; i++) {
1140  subdetfound[i] = 0;
1141  subdettotal[i] = 0;
1142  }
1143 
1144  for (Long_t i = 1; i <= 22; i++) {
1145  layereff = double(layerfound[i]) / double(layertotal[i]);
1146  cout << "Layer " << i << " (" << GetLayerName(i) << ") has total efficiency " << layereff << " " << layerfound[i]
1147  << "/" << layertotal[i] << endl;
1148  totalfound += layerfound[i];
1149  totaltotal += layertotal[i];
1150  if (i < 5) {
1151  subdetfound[1] += layerfound[i];
1152  subdettotal[1] += layertotal[i];
1153  }
1154  if (i >= 5 && i < 11) {
1155  subdetfound[2] += layerfound[i];
1156  subdettotal[2] += layertotal[i];
1157  }
1158  if (i >= 11 && i < 14) {
1159  subdetfound[3] += layerfound[i];
1160  subdettotal[3] += layertotal[i];
1161  }
1162  if (i >= 14) {
1163  subdetfound[4] += layerfound[i];
1164  subdettotal[4] += layertotal[i];
1165  }
1166  }
1167 
1168  cout << "The total efficiency is " << double(totalfound) / double(totaltotal) << endl;
1169  cout << " TIB: " << double(subdetfound[1]) / subdettotal[1] << " " << subdetfound[1] << "/" << subdettotal[1]
1170  << endl;
1171  cout << " TOB: " << double(subdetfound[2]) / subdettotal[2] << " " << subdetfound[2] << "/" << subdettotal[2]
1172  << endl;
1173  cout << " TID: " << double(subdetfound[3]) / subdettotal[3] << " " << subdetfound[3] << "/" << subdettotal[3]
1174  << endl;
1175  cout << " TEC: " << double(subdetfound[4]) / subdettotal[4] << " " << subdetfound[4] << "/" << subdettotal[4]
1176  << endl;
1177 }

References gather_cfg::cout, GetLayerName(), mps_fire::i, layerfound, and layertotal.

Referenced by algoAnalyze().

Member Data Documentation

◆ _autoIneffModTagging

bool SiStripHitEffFromCalibTree::_autoIneffModTagging
private

Definition at line 134 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _badModulesFile

string SiStripHitEffFromCalibTree::_badModulesFile
private

Definition at line 133 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _bunchx

unsigned int SiStripHitEffFromCalibTree::_bunchx
private

Definition at line 140 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _clusterMatchingMethod

unsigned int SiStripHitEffFromCalibTree::_clusterMatchingMethod
private

Definition at line 135 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _clusterTrajDist

float SiStripHitEffFromCalibTree::_clusterTrajDist
private

Definition at line 137 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _effPlotMin

float SiStripHitEffFromCalibTree::_effPlotMin
private

Definition at line 148 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeSummary(), and SiStripHitEffFromCalibTree().

◆ _ResXSig

float SiStripHitEffFromCalibTree::_ResXSig
private

Definition at line 136 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _showEndcapSides

bool SiStripHitEffFromCalibTree::_showEndcapSides
private

Definition at line 143 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeSummary(), and SiStripHitEffFromCalibTree().

◆ _showOnlyGoodModules

bool SiStripHitEffFromCalibTree::_showOnlyGoodModules
private

Definition at line 146 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeSummary(), and SiStripHitEffFromCalibTree().

◆ _showRings

bool SiStripHitEffFromCalibTree::_showRings
private

◆ _showTOB6TEC9

bool SiStripHitEffFromCalibTree::_showTOB6TEC9
private

◆ _spaceBetweenTrains

unsigned int SiStripHitEffFromCalibTree::_spaceBetweenTrains
private

Definition at line 141 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeSummaryVsBx(), and SiStripHitEffFromCalibTree().

◆ _stripsApvEdge

float SiStripHitEffFromCalibTree::_stripsApvEdge
private

Definition at line 138 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _title

TString SiStripHitEffFromCalibTree::_title
private

◆ _tkMapMin

float SiStripHitEffFromCalibTree::_tkMapMin
private

Definition at line 147 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap(), and SiStripHitEffFromCalibTree().

◆ _useCM

bool SiStripHitEffFromCalibTree::_useCM
private

Definition at line 142 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _useOnlyHighPurityTracks

bool SiStripHitEffFromCalibTree::_useOnlyHighPurityTracks
private

Definition at line 139 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ alllayerfound

int SiStripHitEffFromCalibTree::alllayerfound[35]
private

Definition at line 181 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummary().

◆ alllayertotal

int SiStripHitEffFromCalibTree::alllayertotal[35]
private

Definition at line 180 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummary().

◆ BadModules

map<unsigned int, double> SiStripHitEffFromCalibTree::BadModules
private

Definition at line 182 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeSQLite(), and makeTKMap().

◆ bxHisto

TH1F* SiStripHitEffFromCalibTree::bxHisto
private

Definition at line 153 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ CalibTree

TTree* SiStripHitEffFromCalibTree::CalibTree
private

Definition at line 128 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ CalibTreeFilenames

vector<string> SiStripHitEffFromCalibTree::CalibTreeFilenames
private

Definition at line 129 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ doSummary

unsigned int SiStripHitEffFromCalibTree::doSummary
private

Definition at line 132 of file SiStripHitEffFromCalibTree.cc.

Referenced by SiStripHitEffFromCalibTree().

◆ eventInfos

map<pair<unsigned int, unsigned int>, array<double, 3> > SiStripHitEffFromCalibTree::eventInfos
private

Definition at line 158 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ FileInPath_

edm::FileInPath SiStripHitEffFromCalibTree::FileInPath_
private

Definition at line 124 of file SiStripHitEffFromCalibTree.cc.

Referenced by SiStripHitEffFromCalibTree().

◆ fs

edm::Service<TFileService> SiStripHitEffFromCalibTree::fs
private

◆ goodlayerfound

int SiStripHitEffFromCalibTree::goodlayerfound[35]
private

Definition at line 179 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummary().

◆ goodlayertotal

int SiStripHitEffFromCalibTree::goodlayertotal[35]
private

Definition at line 178 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummary().

◆ hits

vector<hit> SiStripHitEffFromCalibTree::hits[23]
private

Definition at line 160 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeHotColdMaps().

◆ HotColdMaps

vector<TH2F*> SiStripHitEffFromCalibTree::HotColdMaps
private

Definition at line 161 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeHotColdMaps().

◆ instLumiHisto

TH1F* SiStripHitEffFromCalibTree::instLumiHisto
private

Definition at line 154 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ layerfound

long SiStripHitEffFromCalibTree::layerfound[23]
private

Definition at line 168 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), makeTKMap(), and totalStatistics().

◆ layerfound_perBx

map<unsigned int, vector<int> > SiStripHitEffFromCalibTree::layerfound_perBx
private

Definition at line 170 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsBx().

◆ layerfound_vsCM

vector<TH1F*> SiStripHitEffFromCalibTree::layerfound_vsCM
private

Definition at line 176 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsCM().

◆ layerfound_vsLumi

vector<TH1F*> SiStripHitEffFromCalibTree::layerfound_vsLumi
private

Definition at line 172 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ layerfound_vsPU

vector<TH1F*> SiStripHitEffFromCalibTree::layerfound_vsPU
private

Definition at line 174 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ layertotal

long SiStripHitEffFromCalibTree::layertotal[23]
private

Definition at line 169 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), makeTKMap(), and totalStatistics().

◆ layertotal_perBx

map<unsigned int, vector<int> > SiStripHitEffFromCalibTree::layertotal_perBx
private

Definition at line 171 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsBx().

◆ layertotal_vsCM

vector<TH1F*> SiStripHitEffFromCalibTree::layertotal_vsCM
private

Definition at line 177 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsCM().

◆ layertotal_vsLumi

vector<TH1F*> SiStripHitEffFromCalibTree::layertotal_vsLumi
private

Definition at line 173 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ layertotal_vsPU

vector<TH1F*> SiStripHitEffFromCalibTree::layertotal_vsPU
private

Definition at line 175 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ modCounter

map<unsigned int, pair<unsigned int, unsigned int> > SiStripHitEffFromCalibTree::modCounter[23]
private

Definition at line 162 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeTKMap().

◆ nModsMin

unsigned int SiStripHitEffFromCalibTree::nModsMin
private

◆ nTEClayers

unsigned int SiStripHitEffFromCalibTree::nTEClayers
private

◆ PUHisto

TH1F* SiStripHitEffFromCalibTree::PUHisto
private

Definition at line 155 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ quality_

SiStripQuality* SiStripHitEffFromCalibTree::quality_
private

◆ reader

SiStripDetInfoFileReader* SiStripHitEffFromCalibTree::reader
private

◆ threshold

float SiStripHitEffFromCalibTree::threshold
private

◆ tkmap

TrackerMap* SiStripHitEffFromCalibTree::tkmap
private

Definition at line 163 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().

◆ tkmapbad

TrackerMap* SiStripHitEffFromCalibTree::tkmapbad
private

Definition at line 164 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().

◆ tkmapden

TrackerMap* SiStripHitEffFromCalibTree::tkmapden
private

Definition at line 167 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().

◆ tkmapeff

TrackerMap* SiStripHitEffFromCalibTree::tkmapeff
private

Definition at line 165 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().

◆ tkmapnum

TrackerMap* SiStripHitEffFromCalibTree::tkmapnum
private

Definition at line 166 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().

cmsHarvester.nevents
nevents
Definition: cmsHarvester.py:3177
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
SiStripQuality::BadComponent::detid
uint32_t detid
Definition: SiStripQuality.h:35
SiStripHitEffFromCalibTree::layerfound
long layerfound[23]
Definition: SiStripHitEffFromCalibTree.cc:168
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
DDAxes::y
SiStripHitEffFromCalibTree::layerfound_vsCM
vector< TH1F * > layerfound_vsCM
Definition: SiStripHitEffFromCalibTree.cc:176
electrons_cff.bool
bool
Definition: electrons_cff.py:372
mps_fire.i
i
Definition: mps_fire.py:355
SiStripHitEffFromCalibTree::makeSummary
void makeSummary()
Definition: SiStripHitEffFromCalibTree.cc:1179
Bounds::width
virtual float width() const =0
SiStripHitEffFromCalibTree::_stripsApvEdge
float _stripsApvEdge
Definition: SiStripHitEffFromCalibTree.cc:138
TrackingMonitor_cfi.stripCluster
stripCluster
Definition: TrackingMonitor_cfi.py:20
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
SiStripHitEffFromCalibTree::threshold
float threshold
Definition: SiStripHitEffFromCalibTree.cc:130
hit::id
unsigned int id
Definition: SiStripHitEffFromCalibTree.cc:92
SiStripHitEffFromCalibTree::layerfound_perBx
map< unsigned int, vector< int > > layerfound_perBx
Definition: SiStripHitEffFromCalibTree.cc:170
hit::y
double y
Definition: SiStripHitEffFromCalibTree.cc:90
SiStripHitEffFromCalibTree::instLumiHisto
TH1F * instLumiHisto
Definition: SiStripHitEffFromCalibTree.cc:154
SiStripHitEffFromCalibTree::makeHotColdMaps
void makeHotColdMaps()
Definition: SiStripHitEffFromCalibTree.cc:875
AlCaHarvesting_cff.SiStripQuality
SiStripQuality
Definition: AlCaHarvesting_cff.py:223
SiStripHitEffFromCalibTree::_spaceBetweenTrains
unsigned int _spaceBetweenTrains
Definition: SiStripHitEffFromCalibTree.cc:141
TrackerTopology
Definition: TrackerTopology.h:16
SiStripHitEffFromCalibTree::_clusterTrajDist
float _clusterTrajDist
Definition: SiStripHitEffFromCalibTree.cc:137
SiStripHitEffFromCalibTree::alllayertotal
int alllayertotal[35]
Definition: SiStripHitEffFromCalibTree.cc:180
globals_cff.id1
id1
Definition: globals_cff.py:32
gather_cfg.cout
cout
Definition: gather_cfg.py:144
SiStripHitEffFromCalibTree::doSummary
unsigned int doSummary
Definition: SiStripHitEffFromCalibTree.cc:132
SiStripBadStrip::decode
data decode(const unsigned int &value) const
Definition: SiStripBadStrip.h:78
SiStripHitEffFromCalibTree::CalibTree
TTree * CalibTree
Definition: SiStripHitEffFromCalibTree.cc:128
SiStripHitEffFromCalibTree::SetBadComponents
void SetBadComponents(int i, int component, SiStripQuality::BadComponent &BC, std::stringstream ssV[4][19], int NBadComponent[4][19][4])
Definition: SiStripHitEffFromCalibTree.cc:1598
SiStripHitEffFromCalibTree::_autoIneffModTagging
bool _autoIneffModTagging
Definition: SiStripHitEffFromCalibTree.cc:134
TrackerMap::fill
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:3288
SiStripHitEffFromCalibTree::nTEClayers
unsigned int nTEClayers
Definition: SiStripHitEffFromCalibTree.cc:151
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DDAxes::x
SiStripBadStrip::put
bool put(const uint32_t &detID, const InputVector &vect)
Definition: SiStripBadStrip.h:65
SiStripHitEffFromCalibTree::tkmapnum
TrackerMap * tkmapnum
Definition: SiStripHitEffFromCalibTree.cc:166
SiStripHitEffFromCalibTree::tkmapbad
TrackerMap * tkmapbad
Definition: SiStripHitEffFromCalibTree.cc:164
SiStripDetInfoFileReader
Definition: SiStripDetInfoFileReader.h:30
SiStripBadStrip::getDataVectorBegin
ContainerIterator getDataVectorBegin() const
Definition: SiStripBadStrip.h:73
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
JetPlusTrackCorrections_cff.PU
PU
Definition: JetPlusTrackCorrections_cff.py:25
python.cmstools.all
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:26
end
#define end
Definition: vmac.h:39
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
mps_splice.mods
mods
Definition: mps_splice.py:43
SiStripHitEffFromCalibTree::BadModules
map< unsigned int, double > BadModules
Definition: SiStripHitEffFromCalibTree.cc:182
SiStripHitEffFromCalibTree::_title
TString _title
Definition: SiStripHitEffFromCalibTree.cc:149
TrackerGeometry::idToDetUnit
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: TrackerGeometry.cc:183
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
simKBmtfDigis_cfi.bx
bx
Definition: simKBmtfDigis_cfi.py:55
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
DetId
Definition: DetId.h:17
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
SiStripHitEffFromCalibTree::totalStatistics
void totalStatistics()
Definition: SiStripHitEffFromCalibTree.cc:1131
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
SiStripBadStrip::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripBadStrip.h:53
SiStripQuality::getBadComponentList
const std::vector< BadComponent > & getBadComponentList() const
Definition: SiStripQuality.h:119
SiStripBadStrip::getRegistryVectorBegin
RegistryIterator getRegistryVectorBegin() const
Definition: SiStripBadStrip.h:75
SiStripHitEffFromCalibTree::PUHisto
TH1F * PUHisto
Definition: SiStripHitEffFromCalibTree.cc:155
ConditionDBWriter< SiStripBadStrip >
SiStripHitEffFromCalibTree::makeSummaryVsLumi
void makeSummaryVsLumi()
Definition: SiStripHitEffFromCalibTree.cc:1498
SiStripHitEffFromCalibTree::modCounter
map< unsigned int, pair< unsigned int, unsigned int > > modCounter[23]
Definition: SiStripHitEffFromCalibTree.cc:162
TrapezoidalPlaneBounds::parameters
virtual const std::array< const float, 4 > parameters() const
Definition: TrapezoidalPlaneBounds.cc:49
SiStripQuality::compact
void compact(unsigned int &, std::vector< unsigned int > &)
Definition: SiStripQuality.cc:331
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
compare_using_db.ifile
ifile
Definition: compare_using_db.py:251
DDAxes::z
str
#define str(s)
Definition: TestProcessor.cc:48
edm::ESHandle< TrackerGeometry >
SiStripHitEffFromCalibTree::_clusterMatchingMethod
unsigned int _clusterMatchingMethod
Definition: SiStripHitEffFromCalibTree.cc:135
SiStripHitEffFromCalibTree::calcPhi
float calcPhi(float x, float y)
Definition: SiStripHitEffFromCalibTree.cc:1582
SiStripHitEffFromCalibTree::_showEndcapSides
bool _showEndcapSides
Definition: SiStripHitEffFromCalibTree.cc:143
TrackerMap
Definition: TrackerMap.h:76
SiStripHitEffFromCalibTree::makeSummaryVsCM
void makeSummaryVsCM()
Definition: SiStripHitEffFromCalibTree.cc:1536
dqmdumpme.k
k
Definition: dqmdumpme.py:60
SiStripHitEffFromCalibTree::makeTKMap
void makeTKMap(bool autoTagging)
Definition: SiStripHitEffFromCalibTree.cc:1003
SiStripDetId::TEC
static constexpr auto TEC
Definition: SiStripDetId.h:40
SiStripQuality::BadComponent::BadFibers
unsigned short BadFibers
Definition: SiStripQuality.h:37
SiStripHitEffFromCalibTree::layertotal_perBx
map< unsigned int, vector< int > > layertotal_perBx
Definition: SiStripHitEffFromCalibTree.cc:171
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
hit::z
double z
Definition: SiStripHitEffFromCalibTree.cc:91
SiStripHitEffFromCalibTree::layerfound_vsPU
vector< TH1F * > layerfound_vsPU
Definition: SiStripHitEffFromCalibTree.cc:174
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MuonTCMETValueMapProducer_cff.nLayers
nLayers
Definition: MuonTCMETValueMapProducer_cff.py:38
SiStripHitEffFromCalibTree::tkmap
TrackerMap * tkmap
Definition: SiStripHitEffFromCalibTree.cc:163
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
SiStripHitEffFromCalibTree::makeSummaryVsBx
void makeSummaryVsBx()
Definition: SiStripHitEffFromCalibTree.cc:1364
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
SiStripHitEffFromCalibTree::goodlayertotal
int goodlayertotal[35]
Definition: SiStripHitEffFromCalibTree.cc:178
edm::LogError
Definition: MessageLogger.h:183
a
double a
Definition: hdecay.h:119
SiStripHitEffFromCalibTree::hits
vector< hit > hits[23]
Definition: SiStripHitEffFromCalibTree.cc:160
SiStripHitEffFromCalibTree::_useCM
bool _useCM
Definition: SiStripHitEffFromCalibTree.cc:142
SiStripHitEffFromCalibTree::FileInPath_
edm::FileInPath FileInPath_
Definition: SiStripHitEffFromCalibTree.cc:124
SiStripHitEffFromCalibTree::layertotal_vsCM
vector< TH1F * > layertotal_vsCM
Definition: SiStripHitEffFromCalibTree.cc:177
SiStripHitEffFromCalibTree::bxHisto
TH1F * bxHisto
Definition: SiStripHitEffFromCalibTree.cc:153
SiStripHitEffFromCalibTree::nModsMin
unsigned int nModsMin
Definition: SiStripHitEffFromCalibTree.cc:131
SiStripQuality::BadComponent::BadModule
bool BadModule
Definition: SiStripQuality.h:38
TrackerTopology::tidSide
unsigned int tidSide(const DetId &id) const
Definition: TrackerTopology.h:190
createfilelist.int
int
Definition: createfilelist.py:10
SiStripHitEffFromCalibTree::GetLayerName
TString GetLayerName(Long_t k)
Definition: SiStripHitEffFromCalibTree.cc:1444
SiStripHitEffFromCalibTree::fs
edm::Service< TFileService > fs
Definition: SiStripHitEffFromCalibTree.cc:122
compare.overlay
def overlay(hists, ytitle, header, addon)
Definition: compare.py:123
SiStripDetId::TOB
static constexpr auto TOB
Definition: SiStripDetId.h:39
SiStripHitEffFromCalibTree::makeSQLite
void makeSQLite()
Definition: SiStripHitEffFromCalibTree.cc:1102
SiStripQuality::BadComponent::BadApvs
unsigned short BadApvs
Definition: SiStripQuality.h:36
SiStripQuality::fillBadComponents
void fillBadComponents()
Definition: SiStripQuality.cc:536
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
SiStripHitEffFromCalibTree::GetLayerSideName
TString GetLayerSideName(Long_t k)
Definition: SiStripHitEffFromCalibTree.cc:1541
TrapezoidalPlaneBounds
Definition: TrapezoidalPlaneBounds.h:15
get
#define get
muonGEMDigis_cfi.instLumi
instLumi
Definition: muonGEMDigis_cfi.py:10
StripTopology::nstrips
virtual int nstrips() const =0
SiStripHitEffFromCalibTree::_badModulesFile
string _badModulesFile
Definition: SiStripHitEffFromCalibTree.cc:133
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
DDAxes::phi
SiStripDetId::TID
static constexpr auto TID
Definition: SiStripDetId.h:38
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
nevt
int nevt
Definition: ReggeGribovPartonMCHadronizer.h:66
SiStripHitEffFromCalibTree::_tkMapMin
float _tkMapMin
Definition: SiStripHitEffFromCalibTree.cc:147
SiStripHitEffFromCalibTree::eventInfos
map< pair< unsigned int, unsigned int >, array< double, 3 > > eventInfos
Definition: SiStripHitEffFromCalibTree.cc:158
TrackerMap::save
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:810
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
SiStripHitEffFromCalibTree::alllayerfound
int alllayerfound[35]
Definition: SiStripHitEffFromCalibTree.cc:181
SiStripDetInfoFileReader::getNumberOfApvsAndStripLength
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
Definition: SiStripDetInfoFileReader.cc:101
writedatasetfile.run
run
Definition: writedatasetfile.py:27
SiStripHitEffFromCalibTree::HotColdMaps
vector< TH2F * > HotColdMaps
Definition: SiStripHitEffFromCalibTree.cc:161
SiStripHitEffFromCalibTree::_useOnlyHighPurityTracks
bool _useOnlyHighPurityTracks
Definition: SiStripHitEffFromCalibTree.cc:139
SiStripHitEffFromCalibTree::_effPlotMin
float _effPlotMin
Definition: SiStripHitEffFromCalibTree.cc:148
SiStripHitEffFromCalibTree::_ResXSig
float _ResXSig
Definition: SiStripHitEffFromCalibTree.cc:136
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
SiStripHitEffFromCalibTree::reader
SiStripDetInfoFileReader * reader
Definition: SiStripHitEffFromCalibTree.cc:123
BoundPlane
muons_cff.highPurity
highPurity
Definition: muons_cff.py:140
SiStripDetId::TIB
static constexpr auto TIB
Definition: SiStripDetId.h:37
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
SiStripBadStrip::RegistryIterator
Registry::const_iterator RegistryIterator
Definition: SiStripBadStrip.h:55
dqmMemoryStats.total
total
Definition: dqmMemoryStats.py:152
Pi
const double Pi
Definition: CosmicMuonParameters.h:18
SiStripHitEffFromCalibTree::layertotal_vsPU
vector< TH1F * > layertotal_vsPU
Definition: SiStripHitEffFromCalibTree.cc:175
SiStripHitEffFromCalibTree::layertotal
long layertotal[23]
Definition: SiStripHitEffFromCalibTree.cc:169
SiStripBadStrip::data::range
unsigned short range
Definition: SiStripBadStrip.h:34
SiStripHitEffFromCalibTree::ComputeEff
void ComputeEff(vector< TH1F * > &vhfound, vector< TH1F * > &vhtotal, string name)
Definition: SiStripHitEffFromCalibTree.cc:1462
StripGeomDetUnit::specificTopology
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
Definition: StripGeomDetUnit.cc:17
SiStripHitEffFromCalibTree::_bunchx
unsigned int _bunchx
Definition: SiStripHitEffFromCalibTree.cc:140
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
SiStripHitEffFromCalibTree::tkmapden
TrackerMap * tkmapden
Definition: SiStripHitEffFromCalibTree.cc:167
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
SiStripHitEffFromCalibTree::layertotal_vsLumi
vector< TH1F * > layertotal_vsLumi
Definition: SiStripHitEffFromCalibTree.cc:173
SiStripDetId
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
SiStripHitEffFromCalibTree::_showOnlyGoodModules
bool _showOnlyGoodModules
Definition: SiStripHitEffFromCalibTree.cc:146
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
mps_splice.line
line
Definition: mps_splice.py:76
SiStripHitEffFromCalibTree::quality_
SiStripQuality * quality_
Definition: SiStripHitEffFromCalibTree.cc:125
TrackerTopology::tecWheel
unsigned int tecWheel(const DetId &id) const
Definition: TrackerTopology.h:198
reco::component
Definition: component.h:57
SiStripHitEffFromCalibTree::goodlayerfound
int goodlayerfound[35]
Definition: SiStripHitEffFromCalibTree.cc:179
StripTopology
Definition: StripTopology.h:11
SiStripHitEffFromCalibTree::CalibTreeFilenames
vector< string > CalibTreeFilenames
Definition: SiStripHitEffFromCalibTree.cc:129
LaserClient_cfi.low
low
Definition: LaserClient_cfi.py:52
begin
#define begin
Definition: vmac.h:32
label
const char * label
Definition: PFTauDecayModeTools.cc:11
up
Definition: BitonicSort.h:7
SiStripBadStrip::getRegistryVectorEnd
RegistryIterator getRegistryVectorEnd() const
Definition: SiStripBadStrip.h:76
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163
hit
Definition: SiStripHitEffFromCalibTree.cc:88
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
SiStripHitEffFromCalibTree::tkmapeff
TrackerMap * tkmapeff
Definition: SiStripHitEffFromCalibTree.cc:165
TrackerMap::fillc
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:135
SiStripHitEffFromCalibTree::_showTOB6TEC9
bool _showTOB6TEC9
Definition: SiStripHitEffFromCalibTree.cc:145
SiStripHitEffFromCalibTree::layerfound_vsLumi
vector< TH1F * > layerfound_vsLumi
Definition: SiStripHitEffFromCalibTree.cc:172
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
StripGeomDetUnit
Definition: StripGeomDetUnit.h:15
SiStripHitEffFromCalibTree::_showRings
bool _showRings
Definition: SiStripHitEffFromCalibTree.cc:144
TrackerTopology::tibLayer
unsigned int tibLayer(const DetId &id) const
Definition: TrackerTopology.h:150
TrackerGeometry
Definition: TrackerGeometry.h:14
TrackerTopology::tecSide
unsigned int tecSide(const DetId &id) const
Definition: TrackerTopology.h:184