CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
SiStripHitEffFromCalibTree Class Reference
Inheritance diagram for SiStripHitEffFromCalibTree:
ConditionDBWriter< SiStripBadStrip > edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 SiStripHitEffFromCalibTree (const edm::ParameterSet &)
 
 ~SiStripHitEffFromCalibTree () override=default
 
- Public Member Functions inherited from ConditionDBWriter< SiStripBadStrip >
 ConditionDBWriter (const edm::ParameterSet &iConfig)
 
 ~ConditionDBWriter () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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
 
void computeEff (vector< TH1F *> &vhfound, vector< TH1F *> &vhtotal, string name)
 
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
 
SiStripDetInfo _detInfo
 
float _effPlotMin
 
float _ResXSig
 
bool _showEndcapSides
 
bool _showOnlyGoodModules
 
bool _showRings
 
bool _showTOB6TEC9
 
unsigned int _spaceBetweenTrains
 
float _stripsApvEdge
 
TString _title
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord_tkGeomToken
 
float _tkMapMin
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd_tTopoToken
 
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_
 
float threshold
 
TrackerMaptkmap
 
TrackerMaptkmapbad
 
TrackerMaptkmapden
 
TrackerMaptkmapeff
 
TrackerMaptkmapnum
 

Static Private Attributes

static constexpr int SiStripLayers = 22
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from ConditionDBWriter< SiStripBadStrip >
static void fillPSetDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 95 of file SiStripHitEffFromCalibTree.cc.

Constructor & Destructor Documentation

◆ SiStripHitEffFromCalibTree()

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

Definition at line 189 of file SiStripHitEffFromCalibTree.cc.

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

191  usesResource(TFileService::kSharedResource);
192  CalibTreeFilenames = conf.getUntrackedParameter<vector<std::string> >("CalibTreeFilenames");
193  threshold = conf.getParameter<double>("Threshold");
194  nModsMin = conf.getParameter<int>("nModsMin");
195  doSummary = conf.getParameter<int>("doSummary");
196  _badModulesFile = conf.getUntrackedParameter<std::string>("BadModulesFile", "");
197  _autoIneffModTagging = conf.getUntrackedParameter<bool>("AutoIneffModTagging", false);
198  _clusterMatchingMethod = conf.getUntrackedParameter<int>("ClusterMatchingMethod", 0);
199  _ResXSig = conf.getUntrackedParameter<double>("ResXSig", -1);
200  _clusterTrajDist = conf.getUntrackedParameter<double>("ClusterTrajDist", 64.0);
201  _stripsApvEdge = conf.getUntrackedParameter<double>("StripsApvEdge", 10.0);
202  _useOnlyHighPurityTracks = conf.getUntrackedParameter<bool>("UseOnlyHighPurityTracks", true);
203  _bunchx = conf.getUntrackedParameter<int>("BunchCrossing", 0);
204  _spaceBetweenTrains = conf.getUntrackedParameter<int>("SpaceBetweenTrains", 25);
205  _useCM = conf.getUntrackedParameter<bool>("UseCommonMode", false);
206  _showEndcapSides = conf.getUntrackedParameter<bool>("ShowEndcapSides", true);
207  _showRings = conf.getUntrackedParameter<bool>("ShowRings", false);
208  _showTOB6TEC9 = conf.getUntrackedParameter<bool>("ShowTOB6TEC9", false);
209  _showOnlyGoodModules = conf.getUntrackedParameter<bool>("ShowOnlyGoodModules", false);
210  _tkMapMin = conf.getUntrackedParameter<double>("TkMapMin", 0.9);
211  _effPlotMin = conf.getUntrackedParameter<double>("EffPlotMin", 0.9);
212  _title = conf.getParameter<std::string>("Title");
216 
217  nTEClayers = 9; // number of wheels
218  if (_showRings)
219  nTEClayers = 7; // number of rings
220 
222 }
static const std::string kSharedResource
Definition: TFileService.h:76
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string fullPath() const
Definition: FileInPath.cc:161
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > _tTopoToken
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > _tkGeomToken
SiStripDetInfo read(std::string filePath)
static constexpr char const *const kDefaultFile

◆ ~SiStripHitEffFromCalibTree()

SiStripHitEffFromCalibTree::~SiStripHitEffFromCalibTree ( )
overridedefault

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.

References _autoIneffModTagging, _badModulesFile, _bunchx, _clusterMatchingMethod, _clusterTrajDist, _detInfo, _ResXSig, _showRings, _showTOB6TEC9, _stripsApvEdge, _tkGeomToken, _tTopoToken, _useCM, _useOnlyHighPurityTracks, a, funct::abs(), accept(), alllayerfound, alllayertotal, electrons_cff::bool, Surface::bounds(), simKBmtfDigis_cfi::bx, bxHisto, c, CalibTree, CalibTreeFilenames, SiStripBadStrip::decode(), MillePedeFileConverter_cfg::e, mps_fire::end, eventInfos, cppFunctionSkipper::exception, fs, SiStripQuality::getBadComponentList(), SiStripBadStrip::getDataVectorBegin(), SiStripDetInfo::getNumberOfApvsAndStripLength(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), goodlayerfound, goodlayertotal, muons_cff::highPurity, hits, mps_fire::i, triggerObjects_cff::id, hit::id, compare_using_db::ifile, muonGEMDigis_cfi::instLumi, instLumiHisto, createfilelist::int, dqmiolumiharvest::j, dqmdumpme::k, cmsLHEtoEOSManager::l, phase1PixelTopology::layer, layerfound, layerfound_perBx, layerfound_vsCM, layerfound_vsLumi, layerfound_vsPU, phase1PixelTopology::layerName, layertotal, layertotal_perBx, layertotal_vsCM, layertotal_vsLumi, layertotal_vsPU, mps_splice::line, LOGPRINT, TFileService::make(), makeHotColdMaps(), makeSQLite(), makeSummary(), makeSummaryVsBx(), makeSummaryVsCM(), makeSummaryVsLumi(), makeTKMap(), modCounter, mps_splice::mods, cmsHarvester::nevents, nevt, nModsMin, StripTopology::nstrips(), nTEClayers, MLClient_cfi::PU, PUHisto, quality, quality_, SiStripBadStrip::data::range, FastTimerService_cff::range, writedatasetfile::run, setBadComponents(), SiStripLayers, StripGeomDetUnit::specificTopology(), contentValuesCheck::ss, str, AlCaHLTBitMon_QueryRunRegistry::string, TrackingMonitor_cfi::stripCluster, GeomDet::surface(), SiStripDetId::TEC, threshold, SiStripDetId::TIB, SiStripDetId::TID, SiStripDetId::TOB, totalStatistics(), Bounds::width(), x, hit::x, testProducerWithPsetDescEmpty_cfi::x1, y, hit::y, z, and hit::z.

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

◆ algoBeginJob()

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

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 224 of file SiStripHitEffFromCalibTree.cc.

224 {}

◆ algoEndJob()

void SiStripHitEffFromCalibTree::algoEndJob ( )
overrideprivatevirtual

Reimplemented from ConditionDBWriter< SiStripBadStrip >.

Definition at line 226 of file SiStripHitEffFromCalibTree.cc.

226 {}

◆ computeEff()

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

Definition at line 1451 of file SiStripHitEffFromCalibTree.cc.

References _showRings, MillePedeFileConverter_cfg::e, dqm-mbProfile::format, fs, mps_fire::i, phase1PixelTopology::layerName, TFileService::make(), Skims_PA_cff::name, MuonTCMETValueMapProducer_cff::nLayers, nTEClayers, and SiStripLayers.

Referenced by makeSummaryVsCM(), and makeSummaryVsLumi().

1451  {
1452  unsigned int nLayers = SiStripLayers;
1453  if (_showRings)
1454  nLayers = 20;
1455 
1456  TH1F* hfound;
1457  TH1F* htotal;
1458 
1459  for (unsigned int ilayer = 1; ilayer < nLayers; ilayer++) {
1460  hfound = vhfound[ilayer];
1461  htotal = vhtotal[ilayer];
1462 
1463  hfound->Sumw2();
1464  htotal->Sumw2();
1465 
1466  // new ROOT version: TGraph::Divide don't handle null or negative values
1467  for (Long_t i = 0; i < hfound->GetNbinsX() + 1; ++i) {
1468  if (hfound->GetBinContent(i) == 0)
1469  hfound->SetBinContent(i, 1e-6);
1470  if (htotal->GetBinContent(i) == 0)
1471  htotal->SetBinContent(i, 1);
1472  }
1473 
1474  TGraphAsymmErrors* geff = fs->make<TGraphAsymmErrors>(hfound->GetNbinsX());
1475  geff->SetName(Form("%s_layer%i", name.c_str(), ilayer));
1476  geff->BayesDivide(hfound, htotal);
1477  if (name == "effVsLumi")
1478  geff->SetTitle(
1479  fmt::format("Hit Efficiency vs inst. lumi. - {}", ::layerName(ilayer, _showRings, nTEClayers)).c_str());
1480  if (name == "effVsPU")
1481  geff->SetTitle(fmt::format("Hit Efficiency vs pileup - {}", ::layerName(ilayer, _showRings, nTEClayers)).c_str());
1482  if (name == "effVsCM")
1483  geff->SetTitle(
1484  fmt::format("Hit Efficiency vs common Mode - {}", ::layerName(ilayer, _showRings, nTEClayers)).c_str());
1485  geff->SetMarkerStyle(20);
1486  }
1487 }
constexpr char const * layerName[numberOfLayers]
edm::Service< TFileService > fs
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64

◆ getLayerSideName()

TString SiStripHitEffFromCalibTree::getLayerSideName ( Long_t  k)
private

Definition at line 1532 of file SiStripHitEffFromCalibTree.cc.

References _showRings, dqmdumpme::k, and nTEClayers.

Referenced by makeSummary().

1532  {
1533  TString layername = "";
1534  TString ringlabel = "D";
1535  if (_showRings)
1536  ringlabel = "R";
1537  if (k > 0 && k < 5) {
1538  layername = TString("TIB L") + k;
1539  } else if (k > 4 && k < 11) {
1540  layername = TString("TOB L") + (k - 4);
1541  } else if (k > 10 && k < 14) {
1542  layername = TString("TID- ") + ringlabel + (k - 10);
1543  } else if (k > 13 && k < 17) {
1544  layername = TString("TID+ ") + ringlabel + (k - 13);
1545  } else if (k > 16 && k < 17 + nTEClayers) {
1546  layername = TString("TEC- ") + ringlabel + (k - 16);
1547  } else if (k > 16 + nTEClayers) {
1548  layername = TString("TEC+ ") + ringlabel + (k - 16 - nTEClayers);
1549  }
1550 
1551  return layername;
1552 }

◆ getNewObject()

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

Implements ConditionDBWriter< SiStripBadStrip >.

Definition at line 1554 of file SiStripHitEffFromCalibTree.cc.

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

1554  {
1555  //Need this for a Condition DB Writer
1556  //Initialize a return variable
1557  auto obj = std::make_unique<SiStripBadStrip>();
1558 
1561 
1562  for (; rIter != rIterEnd; ++rIter) {
1564  quality_->getDataVectorBegin() + rIter->iend);
1565  if (!obj->put(rIter->detid, range))
1566  edm::LogError("SiStripHitEffFromCalibTree")
1567  << "[SiStripHitEffFromCalibTree::getNewObject] detid already exists" << std::endl;
1568  }
1569 
1570  return obj;
1571 }
ContainerIterator getDataVectorBegin() const
Registry::const_iterator RegistryIterator
RegistryIterator getRegistryVectorEnd() const
std::pair< ContainerIterator, ContainerIterator > Range
RegistryIterator getRegistryVectorBegin() const

◆ makeHotColdMaps()

void SiStripHitEffFromCalibTree::makeHotColdMaps ( )
private

Definition at line 872 of file SiStripHitEffFromCalibTree.cc.

References fs, hits, HotColdMaps, LOGPRINT, TFileService::make(), phi, and SiStripLayers.

Referenced by algoAnalyze().

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

◆ makeSQLite()

void SiStripHitEffFromCalibTree::makeSQLite ( )
private

Definition at line 1110 of file SiStripHitEffFromCalibTree.cc.

References _detInfo, BadModules, SiStripQuality::compact(), SiStripQuality::fillBadComponents(), SiStripDetInfo::getNumberOfApvsAndStripLength(), globals_cff::id1, createfilelist::int, LOGPRINT, SiStripBadStrip::put(), quality_, and FastTimerService_cff::range.

Referenced by algoAnalyze().

1110  {
1111  //Generate the SQLite file for use in the Database of the bad modules!
1112  LOGPRINT << "Entering SQLite file generation!\n";
1113  std::vector<unsigned int> BadStripList;
1114  unsigned short NStrips;
1115  unsigned int id1;
1116  std::unique_ptr<SiStripQuality> pQuality = std::make_unique<SiStripQuality>(_detInfo);
1117  //This is the list of the bad strips, use to mask out entire APVs
1118  //Now simply go through the bad hit list and mask out things that
1119  //are bad!
1120  map<unsigned int, double>::const_iterator it;
1121  for (it = BadModules.begin(); it != BadModules.end(); it++) {
1122  //We need to figure out how many strips are in this particular module
1123  //To Mask correctly!
1124  NStrips = _detInfo.getNumberOfApvsAndStripLength((*it).first).first * 128;
1125  LOGPRINT << "Number of strips module " << (*it).first << " is " << NStrips;
1126  BadStripList.push_back(pQuality->encode(0, NStrips, 0));
1127  //Now compact into a single bad module
1128  id1 = (unsigned int)(*it).first;
1129  LOGPRINT << "ID1 shoudl match list of modules above " << id1;
1130  quality_->compact(id1, BadStripList);
1131  SiStripQuality::Range range(BadStripList.begin(), BadStripList.end());
1132  quality_->put(id1, range);
1133  BadStripList.clear();
1134  }
1135  //Fill all the bad components now
1137 }
map< unsigned int, double > BadModules
#define LOGPRINT
void compact(uint32_t detid, std::vector< unsigned int > &)
void fillBadComponents()
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
std::pair< ContainerIterator, ContainerIterator > Range
bool put(const uint32_t &detID, const InputVector &vect)

◆ makeSummary()

void SiStripHitEffFromCalibTree::makeSummary ( )
private

Definition at line 1187 of file SiStripHitEffFromCalibTree.cc.

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

Referenced by algoAnalyze().

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

◆ makeSummaryVsBx()

void SiStripHitEffFromCalibTree::makeSummaryVsBx ( )
private

Definition at line 1371 of file SiStripHitEffFromCalibTree.cc.

References _showRings, _spaceBetweenTrains, MillePedeFileConverter_cfg::e, dqmMemoryStats::float, dqm-mbProfile::format, newFWLiteAna::found, fs, layerfound_perBx, phase1PixelTopology::layerName, layertotal_perBx, LOGPRINT, LaserClient_cfi::low, TFileService::make(), MuonTCMETValueMapProducer_cff::nLayers, nTEClayers, SiStripLayers, dqmMemoryStats::total, and up.

Referenced by algoAnalyze().

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

◆ makeSummaryVsCM()

void SiStripHitEffFromCalibTree::makeSummaryVsCM ( )
private

Definition at line 1527 of file SiStripHitEffFromCalibTree.cc.

References computeEff(), layerfound_vsCM, layertotal_vsCM, and LOGPRINT.

Referenced by algoAnalyze().

1527  {
1528  LOGPRINT << "Computing efficiency vs CM";
1530 }
#define LOGPRINT
void computeEff(vector< TH1F *> &vhfound, vector< TH1F *> &vhtotal, string name)

◆ makeSummaryVsLumi()

void SiStripHitEffFromCalibTree::makeSummaryVsLumi ( )
private

Definition at line 1489 of file SiStripHitEffFromCalibTree.cc.

References _showRings, computeEff(), instLumiHisto, layerfound_vsLumi, layerfound_vsPU, layertotal_vsLumi, layertotal_vsPU, LOGPRINT, MuonTCMETValueMapProducer_cff::nLayers, PUHisto, and SiStripLayers.

Referenced by algoAnalyze().

1489  {
1490  LOGPRINT << "Computing efficiency vs lumi";
1491 
1492  if (instLumiHisto->GetEntries()) // from infos per event
1493  LOGPRINT << "Avg conditions (avg+/-rms): lumi :" << instLumiHisto->GetMean() << "+/-" << instLumiHisto->GetRMS()
1494  << " pu: " << PUHisto->GetMean() << "+/-" << PUHisto->GetRMS();
1495 
1496  else { // from infos per hit
1497 
1498  unsigned int nLayers = SiStripLayers;
1499  if (_showRings)
1500  nLayers = 20;
1501  unsigned int nLayersForAvg = 0;
1502  float layerLumi = 0;
1503  float layerPU = 0;
1504  float avgLumi = 0;
1505  float avgPU = 0;
1506 
1507  LOGPRINT << "Lumi summary: (avg over trajectory measurements)";
1508  for (unsigned int ilayer = 1; ilayer < nLayers; ilayer++) {
1509  layerLumi = layertotal_vsLumi[ilayer]->GetMean();
1510  layerPU = layertotal_vsPU[ilayer]->GetMean();
1511  //LOGPRINT<<" layer "<<ilayer<<" lumi: "<<layerLumi<<" pu: "<<layerPU<<endl;
1512  if (layerLumi != 0 && layerPU != 0) {
1513  avgLumi += layerLumi;
1514  avgPU += layerPU;
1515  nLayersForAvg++;
1516  }
1517  }
1518  avgLumi /= nLayersForAvg;
1519  avgPU /= nLayersForAvg;
1520  LOGPRINT << "Avg conditions: lumi :" << avgLumi << " pu: " << avgPU;
1521  }
1522 
1525 }
#define LOGPRINT
void computeEff(vector< TH1F *> &vhfound, vector< TH1F *> &vhtotal, string name)

◆ makeTKMap()

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

Definition at line 1000 of file SiStripHitEffFromCalibTree.cc.

References _showRings, _title, _tkMapMin, BadModules, TrackerMap::fill(), TrackerMap::fillc(), fs, mps_fire::i, layerfound, phase1PixelTopology::layerName, layertotal, LOGPRINT, TFileService::make(), modCounter, nModsMin, nTEClayers, TrackerMap::save(), SiStripLayers, threshold, tkmap, tkmapbad, tkmapden, tkmapeff, and tkmapnum.

Referenced by algoAnalyze().

1000  {
1001  LOGPRINT << "Entering TKMap generation!\n";
1002  tkmap = new TrackerMap(" Detector Inefficiency ");
1003  tkmapbad = new TrackerMap(" Inefficient Modules ");
1004  tkmapeff = new TrackerMap(_title.Data());
1005  tkmapnum = new TrackerMap(" Detector numerator ");
1006  tkmapden = new TrackerMap(" Detector denominator ");
1007 
1008  double myeff, mynum, myden, myeff_up;
1009  double layer_min_eff = 0;
1010 
1011  for (Long_t i = 1; i <= SiStripLayers; i++) {
1012  //Loop over every layer, extracting the information from
1013  //the map of the efficiencies
1014  layertotal[i] = 0;
1015  layerfound[i] = 0;
1016  TH1F* hEffInLayer =
1017  fs->make<TH1F>(Form("eff_layer%i", int(i)), Form("Module efficiency in layer %i", int(i)), 201, 0, 1.005);
1018 
1019  map<unsigned int, pair<unsigned int, unsigned int> >::const_iterator ih;
1020  for (ih = modCounter[i].begin(); ih != modCounter[i].end(); ih++) {
1021  //We should be in the layer in question, and looping over all of the modules in said layer
1022  //Generate the list for the TKmap, and the bad module list
1023  mynum = (double)(((*ih).second).second);
1024  myden = (double)(((*ih).second).first);
1025  if (myden > 0)
1026  myeff = mynum / myden;
1027  else
1028  myeff = 0;
1029  hEffInLayer->Fill(myeff);
1030 
1031  if (!autoTagging) {
1032  if ((myden >= nModsMin) && (myeff < threshold)) {
1033  //We have a bad module, put it in the list!
1034  BadModules[(*ih).first] = myeff;
1035  tkmapbad->fillc((*ih).first, 255, 0, 0);
1036  LOGPRINT << "Layer " << i << " (" << ::layerName(i, _showRings, nTEClayers) << ") module " << (*ih).first
1037  << " efficiency: " << myeff << " , " << mynum << "/" << myden;
1038  } else {
1039  //Fill the bad list with empty results for every module
1040  tkmapbad->fillc((*ih).first, 255, 255, 255);
1041  }
1042  if (myeff < threshold)
1043  LOGPRINT << "Layer " << i << " (" << ::layerName(i, _showRings, nTEClayers) << ") module " << (*ih).first
1044  << " efficiency: " << myeff << " , " << mynum << "/" << myden;
1045  if (myden < nModsMin) {
1046  LOGPRINT << "Layer " << i << " (" << ::layerName(i, _showRings, nTEClayers) << ") module " << (*ih).first
1047  << " is under occupancy at " << myden;
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  layer_min_eff =
1066  hEffInLayer->GetMean() - 2.5 * hEffInLayer->GetRMS(); // uses RMS in case the distribution is wide
1067  if (threshold > 2.5 * hEffInLayer->GetRMS())
1068  layer_min_eff = hEffInLayer->GetMean() - threshold; // otherwise uses the parameter 'threshold'
1069  LOGPRINT << "Layer " << i << " threshold for bad modules: <" << layer_min_eff
1070  << " (layer mean: " << hEffInLayer->GetMean() << " rms: " << hEffInLayer->GetRMS() << ")";
1071 
1072  hEffInLayer->GetXaxis()->SetRange(1, hEffInLayer->GetNbinsX() + 1);
1073 
1074  for (ih = modCounter[i].begin(); ih != modCounter[i].end(); ih++) {
1075  // Second loop over modules to tag inefficient ones
1076  mynum = (double)(((*ih).second).second);
1077  myden = (double)(((*ih).second).first);
1078  if (myden > 0)
1079  myeff = mynum / myden;
1080  else
1081  myeff = 0;
1082  // upper limit on the efficiency
1083  myeff_up = TEfficiency::Bayesian(myden, mynum, .99, 1, 1, true);
1084  if ((myden >= nModsMin) && (myeff_up < layer_min_eff)) {
1085  //We have a bad module, put it in the list!
1086  BadModules[(*ih).first] = myeff;
1087  tkmapbad->fillc((*ih).first, 255, 0, 0);
1088  } else {
1089  //Fill the bad list with empty results for every module
1090  tkmapbad->fillc((*ih).first, 255, 255, 255);
1091  }
1092  if (myeff_up < layer_min_eff + 0.08) // printing message also for modules slighly above (8%) the limit
1093  LOGPRINT << "Layer " << i << " (" << ::layerName(i, _showRings, nTEClayers) << ") module " << (*ih).first
1094  << " efficiency: " << myeff << " , " << mynum << "/" << myden << " , upper limit: " << myeff_up;
1095  if (myden < nModsMin) {
1096  LOGPRINT << "Layer " << i << " (" << ::layerName(i, _showRings, nTEClayers) << ") module " << (*ih).first
1097  << " layer " << i << " is under occupancy at " << myden;
1098  }
1099  }
1100  }
1101  }
1102  tkmap->save(true, 0, 0, "SiStripHitEffTKMap.png");
1103  tkmapbad->save(true, 0, 0, "SiStripHitEffTKMapBad.png");
1104  tkmapeff->save(true, _tkMapMin, 1., "SiStripHitEffTKMapEff.png");
1105  tkmapnum->save(true, 0, 0, "SiStripHitEffTKMapNum.png");
1106  tkmapden->save(true, 0, 0, "SiStripHitEffTKMapDen.png");
1107  LOGPRINT << "Finished TKMap Generation\n";
1108 }
map< unsigned int, double > BadModules
constexpr char const * layerName[numberOfLayers]
#define LOGPRINT
edm::Service< TFileService > fs
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:811
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:135
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:3289
map< unsigned int, pair< unsigned int, unsigned int > > modCounter[23]

◆ 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 1573 of file SiStripHitEffFromCalibTree.cc.

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

Referenced by algoAnalyze().

1574  {
1575  int napv = _detInfo.getNumberOfApvsAndStripLength(BC.detid).first;
1576 
1577  ssV[i][component] << "\n\t\t " << BC.detid << " \t " << BC.BadModule << " \t " << ((BC.BadFibers) & 0x1) << " ";
1578  if (napv == 4)
1579  ssV[i][component] << "x " << ((BC.BadFibers >> 1) & 0x1);
1580 
1581  if (napv == 6)
1582  ssV[i][component] << ((BC.BadFibers >> 1) & 0x1) << " " << ((BC.BadFibers >> 2) & 0x1);
1583  ssV[i][component] << " \t " << ((BC.BadApvs) & 0x1) << " " << ((BC.BadApvs >> 1) & 0x1) << " ";
1584  if (napv == 4)
1585  ssV[i][component] << "x x " << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1);
1586  if (napv == 6)
1587  ssV[i][component] << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1) << " "
1588  << ((BC.BadApvs >> 4) & 0x1) << " " << ((BC.BadApvs >> 5) & 0x1) << " ";
1589 
1590  if (BC.BadApvs) {
1591  NBadComponent[i][0][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) + ((BC.BadApvs >> 3) & 0x1) +
1592  ((BC.BadApvs >> 2) & 0x1) + ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
1593  NBadComponent[i][component][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) +
1594  ((BC.BadApvs >> 3) & 0x1) + ((BC.BadApvs >> 2) & 0x1) +
1595  ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
1596  }
1597  if (BC.BadFibers) {
1598  NBadComponent[i][0][1] += ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
1599  NBadComponent[i][component][1] +=
1600  ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
1601  }
1602  if (BC.BadModule) {
1603  NBadComponent[i][0][0]++;
1604  NBadComponent[i][component][0]++;
1605  }
1606 }
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const

◆ totalStatistics()

void SiStripHitEffFromCalibTree::totalStatistics ( )
private

Definition at line 1139 of file SiStripHitEffFromCalibTree.cc.

References _showRings, mps_fire::i, layerfound, phase1PixelTopology::layerName, layertotal, LOGPRINT, nTEClayers, and SiStripLayers.

Referenced by algoAnalyze().

1139  {
1140  //Calculate the statistics by layer
1141  int totalfound = 0;
1142  int totaltotal = 0;
1143  double layereff;
1144  int subdetfound[5];
1145  int subdettotal[5];
1146 
1147  for (Long_t i = 1; i < 5; i++) {
1148  subdetfound[i] = 0;
1149  subdettotal[i] = 0;
1150  }
1151 
1152  for (Long_t i = 1; i <= SiStripLayers; i++) {
1153  layereff = double(layerfound[i]) / double(layertotal[i]);
1154  LOGPRINT << "Layer " << i << " (" << ::layerName(i, _showRings, nTEClayers) << ") has total efficiency " << layereff
1155  << " " << layerfound[i] << "/" << layertotal[i];
1156  totalfound += layerfound[i];
1157  totaltotal += layertotal[i];
1158  if (i < 5) {
1159  subdetfound[1] += layerfound[i];
1160  subdettotal[1] += layertotal[i];
1161  }
1162  if (i >= 5 && i < 11) {
1163  subdetfound[2] += layerfound[i];
1164  subdettotal[2] += layertotal[i];
1165  }
1166  if (i >= 11 && i < 14) {
1167  subdetfound[3] += layerfound[i];
1168  subdettotal[3] += layertotal[i];
1169  }
1170  if (i >= 14) {
1171  subdetfound[4] += layerfound[i];
1172  subdettotal[4] += layertotal[i];
1173  }
1174  }
1175 
1176  LOGPRINT << "The total efficiency is " << double(totalfound) / double(totaltotal);
1177  LOGPRINT << " TIB: " << double(subdetfound[1]) / subdettotal[1] << " " << subdetfound[1] << "/"
1178  << subdettotal[1];
1179  LOGPRINT << " TOB: " << double(subdetfound[2]) / subdettotal[2] << " " << subdetfound[2] << "/"
1180  << subdettotal[2];
1181  LOGPRINT << " TID: " << double(subdetfound[3]) / subdettotal[3] << " " << subdetfound[3] << "/"
1182  << subdettotal[3];
1183  LOGPRINT << " TEC: " << double(subdetfound[4]) / subdettotal[4] << " " << subdetfound[4] << "/"
1184  << subdettotal[4];
1185 }
constexpr char const * layerName[numberOfLayers]
#define LOGPRINT

Member Data Documentation

◆ _autoIneffModTagging

bool SiStripHitEffFromCalibTree::_autoIneffModTagging
private

Definition at line 135 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _badModulesFile

string SiStripHitEffFromCalibTree::_badModulesFile
private

Definition at line 134 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _bunchx

unsigned int SiStripHitEffFromCalibTree::_bunchx
private

Definition at line 141 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _clusterMatchingMethod

unsigned int SiStripHitEffFromCalibTree::_clusterMatchingMethod
private

Definition at line 136 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _clusterTrajDist

float SiStripHitEffFromCalibTree::_clusterTrajDist
private

Definition at line 138 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _detInfo

SiStripDetInfo SiStripHitEffFromCalibTree::_detInfo
private

◆ _effPlotMin

float SiStripHitEffFromCalibTree::_effPlotMin
private

Definition at line 149 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeSummary(), and SiStripHitEffFromCalibTree().

◆ _ResXSig

float SiStripHitEffFromCalibTree::_ResXSig
private

Definition at line 137 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _showEndcapSides

bool SiStripHitEffFromCalibTree::_showEndcapSides
private

Definition at line 144 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeSummary(), and SiStripHitEffFromCalibTree().

◆ _showOnlyGoodModules

bool SiStripHitEffFromCalibTree::_showOnlyGoodModules
private

Definition at line 147 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 142 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeSummaryVsBx(), and SiStripHitEffFromCalibTree().

◆ _stripsApvEdge

float SiStripHitEffFromCalibTree::_stripsApvEdge
private

Definition at line 139 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _title

TString SiStripHitEffFromCalibTree::_title
private

◆ _tkGeomToken

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiStripHitEffFromCalibTree::_tkGeomToken
private

Definition at line 152 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _tkMapMin

float SiStripHitEffFromCalibTree::_tkMapMin
private

Definition at line 148 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap(), and SiStripHitEffFromCalibTree().

◆ _tTopoToken

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripHitEffFromCalibTree::_tTopoToken
private

Definition at line 153 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _useCM

bool SiStripHitEffFromCalibTree::_useCM
private

Definition at line 143 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ _useOnlyHighPurityTracks

bool SiStripHitEffFromCalibTree::_useOnlyHighPurityTracks
private

Definition at line 140 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ alllayerfound

int SiStripHitEffFromCalibTree::alllayerfound[35]
private

Definition at line 185 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummary().

◆ alllayertotal

int SiStripHitEffFromCalibTree::alllayertotal[35]
private

Definition at line 184 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummary().

◆ BadModules

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

Definition at line 186 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeSQLite(), and makeTKMap().

◆ bxHisto

TH1F* SiStripHitEffFromCalibTree::bxHisto
private

Definition at line 157 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ CalibTree

TTree* SiStripHitEffFromCalibTree::CalibTree
private

Definition at line 129 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ CalibTreeFilenames

vector<string> SiStripHitEffFromCalibTree::CalibTreeFilenames
private

Definition at line 130 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ doSummary

unsigned int SiStripHitEffFromCalibTree::doSummary
private

Definition at line 133 of file SiStripHitEffFromCalibTree.cc.

Referenced by SiStripHitEffFromCalibTree().

◆ eventInfos

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

Definition at line 162 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ FileInPath_

edm::FileInPath SiStripHitEffFromCalibTree::FileInPath_
private

Definition at line 125 of file SiStripHitEffFromCalibTree.cc.

Referenced by SiStripHitEffFromCalibTree().

◆ fs

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

◆ goodlayerfound

int SiStripHitEffFromCalibTree::goodlayerfound[35]
private

Definition at line 183 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummary().

◆ goodlayertotal

int SiStripHitEffFromCalibTree::goodlayertotal[35]
private

Definition at line 182 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummary().

◆ hits

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

Definition at line 164 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeHotColdMaps().

◆ HotColdMaps

vector<TH2F*> SiStripHitEffFromCalibTree::HotColdMaps
private

Definition at line 165 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeHotColdMaps().

◆ instLumiHisto

TH1F* SiStripHitEffFromCalibTree::instLumiHisto
private

Definition at line 158 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ layerfound

long SiStripHitEffFromCalibTree::layerfound[23]
private

Definition at line 172 of file SiStripHitEffFromCalibTree.cc.

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

◆ layerfound_perBx

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

Definition at line 174 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsBx().

◆ layerfound_vsCM

vector<TH1F*> SiStripHitEffFromCalibTree::layerfound_vsCM
private

Definition at line 180 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsCM().

◆ layerfound_vsLumi

vector<TH1F*> SiStripHitEffFromCalibTree::layerfound_vsLumi
private

Definition at line 176 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ layerfound_vsPU

vector<TH1F*> SiStripHitEffFromCalibTree::layerfound_vsPU
private

Definition at line 178 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ layertotal

long SiStripHitEffFromCalibTree::layertotal[23]
private

Definition at line 173 of file SiStripHitEffFromCalibTree.cc.

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

◆ layertotal_perBx

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

Definition at line 175 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsBx().

◆ layertotal_vsCM

vector<TH1F*> SiStripHitEffFromCalibTree::layertotal_vsCM
private

Definition at line 181 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsCM().

◆ layertotal_vsLumi

vector<TH1F*> SiStripHitEffFromCalibTree::layertotal_vsLumi
private

Definition at line 177 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ layertotal_vsPU

vector<TH1F*> SiStripHitEffFromCalibTree::layertotal_vsPU
private

Definition at line 179 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 166 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 159 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ quality_

SiStripQuality* SiStripHitEffFromCalibTree::quality_
private

◆ SiStripLayers

constexpr int SiStripHitEffFromCalibTree::SiStripLayers = 22
staticprivate

◆ threshold

float SiStripHitEffFromCalibTree::threshold
private

◆ tkmap

TrackerMap* SiStripHitEffFromCalibTree::tkmap
private

Definition at line 167 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().

◆ tkmapbad

TrackerMap* SiStripHitEffFromCalibTree::tkmapbad
private

Definition at line 168 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().

◆ tkmapden

TrackerMap* SiStripHitEffFromCalibTree::tkmapden
private

Definition at line 171 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().

◆ tkmapeff

TrackerMap* SiStripHitEffFromCalibTree::tkmapeff
private

Definition at line 169 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().

◆ tkmapnum

TrackerMap* SiStripHitEffFromCalibTree::tkmapnum
private

Definition at line 170 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().