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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void algoAnalyze (const edm::Event &e, const edm::EventSetup &c) 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

int alllayerfound [35]
 
int alllayertotal [35]
 
bool autoIneffModTagging_
 
map< unsigned int, double > BadModules
 
string badModulesFile_
 
unsigned int bunchX_
 
TH1F * bxHisto
 
TH1F * bxHisto_cutOnTracks
 
TTree * calibTree_
 
vector< string > calibTreeFileNames_
 
unsigned int clusterMatchingMethod_
 
float clusterTrajDist_
 
SiStripDetInfo detInfo_
 
float effPlotMin_
 
map< pair< unsigned int, unsigned int >, bool > event_used
 
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
 
TH1F * instLumiHisto_cutOnTracks
 
long layerfound [23]
 
map< unsigned int, vector< int > > layerfound_perBx
 
vector< TH1F * > layerfound_vsBX
 
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_vsBX
 
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
 
TH1F * PUHisto_cutOnTracks
 
SiStripQualityquality_
 
float resXSig_
 
bool showEndcapSides_
 
bool showOnlyGoodModules_
 
bool showRings_
 
bool showTOB6TEC9_
 
unsigned int spaceBetweenTrains_
 
bool storeModEff_
 
float stripsApvEdge_
 
float threshold_
 
TString title_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtkGeomToken_
 
TrackerMaptkmap
 
TrackerMaptkmapbad
 
TrackerMaptkmapden
 
TrackerMaptkmapeff
 
float tkMapMin_
 
TrackerMaptkmapnum
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 
bool useCM_
 
bool useOnlyHighPurityTracks_
 

Static Private Attributes

static constexpr double nBxInAnOrbit_ = 3565
 
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 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 199 of file SiStripHitEffFromCalibTree.cc.

References autoIneffModTagging_, badModulesFile_, bunchX_, calibTreeFileNames_, clusterMatchingMethod_, clusterTrajDist_, detInfo_, effPlotMin_, fileInPath_, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), TFileService::kSharedResource, nModsMin_, nTEClayers, quality_, SiStripDetInfoFileReader::read(), resXSig_, showEndcapSides_, showOnlyGoodModules_, showRings_, showTOB6TEC9_, AlCaHarvesting_cff::SiStripQuality, spaceBetweenTrains_, storeModEff_, AlCaHLTBitMon_QueryRunRegistry::string, stripsApvEdge_, threshold_, title_, tkMapMin_, useCM_, and useOnlyHighPurityTracks_.

204  usesResource(TFileService::kSharedResource);
205  calibTreeFileNames_ = conf.getUntrackedParameter<vector<std::string> >("CalibTreeFilenames");
206  threshold_ = conf.getParameter<double>("Threshold");
207  nModsMin_ = conf.getParameter<int>("nModsMin");
208  badModulesFile_ = conf.getUntrackedParameter<std::string>("BadModulesFile", "");
209  autoIneffModTagging_ = conf.getUntrackedParameter<bool>("AutoIneffModTagging", false);
210  clusterMatchingMethod_ = conf.getUntrackedParameter<int>("ClusterMatchingMethod", 0);
211  resXSig_ = conf.getUntrackedParameter<double>("ResXSig", -1);
212  clusterTrajDist_ = conf.getUntrackedParameter<double>("ClusterTrajDist", 64.0);
213  stripsApvEdge_ = conf.getUntrackedParameter<double>("StripsApvEdge", 10.0);
214  useOnlyHighPurityTracks_ = conf.getUntrackedParameter<bool>("UseOnlyHighPurityTracks", true);
215  bunchX_ = conf.getUntrackedParameter<int>("BunchCrossing", 0);
216  spaceBetweenTrains_ = conf.getUntrackedParameter<int>("SpaceBetweenTrains", 25);
217  useCM_ = conf.getUntrackedParameter<bool>("UseCommonMode", false);
218  showEndcapSides_ = conf.getUntrackedParameter<bool>("ShowEndcapSides", true);
219  showRings_ = conf.getUntrackedParameter<bool>("ShowRings", false);
220  showTOB6TEC9_ = conf.getUntrackedParameter<bool>("ShowTOB6TEC9", false);
221  showOnlyGoodModules_ = conf.getUntrackedParameter<bool>("ShowOnlyGoodModules", false);
222  tkMapMin_ = conf.getUntrackedParameter<double>("TkMapMin", 0.9);
223  effPlotMin_ = conf.getUntrackedParameter<double>("EffPlotMin", 0.9);
224  title_ = conf.getParameter<std::string>("Title");
225  storeModEff_ = conf.getUntrackedParameter<bool>("StoreModuleEff", false);
227 
228  nTEClayers = 9; // number of wheels
229  if (showRings_)
230  nTEClayers = 7; // number of rings
231 
233 }
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
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
T getUntrackedParameter(std::string const &, T const &) const
SiStripDetInfo read(std::string filePath)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
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 235 of file SiStripHitEffFromCalibTree.cc.

References a, funct::abs(), accept(), alllayerfound, alllayertotal, autoIneffModTagging_, badModulesFile_, nano_mu_local_reco_cff::bool, Surface::bounds(), bunchX_, nano_mu_digi_cff::bx, bxHisto, bxHisto_cutOnTracks, HltBtagPostValidation_cff::c, calibTree_, calibTreeFileNames_, clusterMatchingMethod_, clusterTrajDist_, SiStripBadStrip::decode(), detInfo_, MillePedeFileConverter_cfg::e, mps_fire::end, event_used, eventInfos, cppFunctionSkipper::exception, fs, SiStripQuality::getBadComponentList(), SiStripBadStrip::getDataVectorBegin(), SiStripDetInfo::getNumberOfApvsAndStripLength(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), goodlayerfound, goodlayertotal, muons_cff::highPurity, hits, mps_fire::i, l1ctLayer2EG_cff::id, hit::id, muonGEMDigis_cfi::instLumi, instLumiHisto, instLumiHisto_cutOnTracks, createfilelist::int, dqmiolumiharvest::j, dqmdumpme::k, MainPageGenerator::l, nano_mu_digi_cff::layer, layerfound, layerfound_perBx, layerfound_vsBX, layerfound_vsCM, layerfound_vsLumi, layerfound_vsPU, layertotal, layertotal_perBx, layertotal_vsBX, layertotal_vsCM, layertotal_vsLumi, layertotal_vsPU, mps_splice::line, LOGPRINT, TFileService::make(), makeHotColdMaps(), makeSQLite(), makeSummary(), makeSummaryVsBx(), makeSummaryVsCM(), makeSummaryVsLumi(), makeTKMap(), modCounter, mps_splice::mods, nBxInAnOrbit_, createIOVlist::nevents, nevt, nModsMin_, StripTopology::nstrips(), nTEClayers, MLClient_cfi::PU, PUHisto, PUHisto_cutOnTracks, quality, quality_, SiStripBadStrip::data::range, FastTimerService_cff::range, resXSig_, writedatasetfile::run, setBadComponents(), showRings_, showTOB6TEC9_, siStripLayers_, StripGeomDetUnit::specificTopology(), contentValuesCheck::ss, str, AlCaHLTBitMon_QueryRunRegistry::string, TrackingMonitor_cfi::stripCluster, stripsApvEdge_, GeomDet::surface(), SiStripDetId::TEC, threshold_, SiStripDetId::TIB, SiStripDetId::TID, tkGeomToken_, SiStripDetId::TOB, totalStatistics(), tTopoToken_, useCM_, useOnlyHighPurityTracks_, Bounds::width(), x, hit::x, testProducerWithPsetDescEmpty_cfi::x1, y, hit::y, z, and hit::z.

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

◆ computeEff()

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

Definition at line 1525 of file SiStripHitEffFromCalibTree.cc.

References MillePedeFileConverter_cfg::e, dqm-mbProfile::format, fs, mps_fire::i, TFileService::make(), Skims_PA_cff::name, MuonTCMETValueMapProducer_cff::nLayers, nTEClayers, showRings_, and siStripLayers_.

Referenced by makeSummaryVsCM(), and makeSummaryVsLumi().

1525  {
1526  unsigned int nLayers = siStripLayers_;
1527  if (showRings_)
1528  nLayers = 20;
1529 
1530  TH1F* hfound;
1531  TH1F* htotal;
1532 
1533  for (unsigned int ilayer = 1; ilayer < nLayers; ilayer++) {
1534  hfound = vhfound[ilayer];
1535  htotal = vhtotal[ilayer];
1536 
1537  hfound->Sumw2();
1538  htotal->Sumw2();
1539 
1540  // new ROOT version: TGraph::Divide don't handle null or negative values
1541  for (Long_t i = 0; i < hfound->GetNbinsX() + 1; ++i) {
1542  if (hfound->GetBinContent(i) == 0)
1543  hfound->SetBinContent(i, 1e-6);
1544  if (htotal->GetBinContent(i) == 0)
1545  htotal->SetBinContent(i, 1);
1546  }
1547 
1548  TGraphAsymmErrors* geff = fs->make<TGraphAsymmErrors>(hfound->GetNbinsX());
1549  geff->SetName(Form("%s_layer%i", name.c_str(), ilayer));
1550  geff->BayesDivide(hfound, htotal);
1551  if (name == "effVsLumi")
1552  geff->SetTitle(
1553  fmt::format("Hit Efficiency vs inst. lumi. - {}", ::layerName(ilayer, showRings_, nTEClayers)).c_str());
1554  if (name == "effVsPU")
1555  geff->SetTitle(fmt::format("Hit Efficiency vs pileup - {}", ::layerName(ilayer, showRings_, nTEClayers)).c_str());
1556  if (name == "effVsCM")
1557  geff->SetTitle(
1558  fmt::format("Hit Efficiency vs common Mode - {}", ::layerName(ilayer, showRings_, nTEClayers)).c_str());
1559  geff->SetMarkerStyle(20);
1560  }
1561 }
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 1606 of file SiStripHitEffFromCalibTree.cc.

References dqmdumpme::k, nTEClayers, and showRings_.

Referenced by makeSummary().

1606  {
1607  TString layername = "";
1608  TString ringlabel = "D";
1609  if (showRings_)
1610  ringlabel = "R";
1611  if (k > 0 && k < 5) {
1612  layername = TString("TIB L") + k;
1613  } else if (k > 4 && k < 11) {
1614  layername = TString("TOB L") + (k - 4);
1615  } else if (k > 10 && k < 14) {
1616  layername = TString("TID- ") + ringlabel + (k - 10);
1617  } else if (k > 13 && k < 17) {
1618  layername = TString("TID+ ") + ringlabel + (k - 13);
1619  } else if (k > 16 && k < 17 + nTEClayers) {
1620  layername = TString("TEC- ") + ringlabel + (k - 16);
1621  } else if (k > 16 + nTEClayers) {
1622  layername = TString("TEC+ ") + ringlabel + (k - 16 - nTEClayers);
1623  }
1624 
1625  return layername;
1626 }

◆ getNewObject()

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

Implements ConditionDBWriter< SiStripBadStrip >.

Definition at line 1628 of file SiStripHitEffFromCalibTree.cc.

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

1628  {
1629  //Need this for a Condition DB Writer
1630  //Initialize a return variable
1631  auto obj = std::make_unique<SiStripBadStrip>();
1632 
1635 
1636  for (; rIter != rIterEnd; ++rIter) {
1638  quality_->getDataVectorBegin() + rIter->iend);
1639  if (!obj->put(rIter->detid, range))
1640  edm::LogError("SiStripHitEffFromCalibTree")
1641  << "[SiStripHitEffFromCalibTree::getNewObject] detid already exists" << std::endl;
1642  }
1643 
1644  return obj;
1645 }
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 907 of file SiStripHitEffFromCalibTree.cc.

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

Referenced by algoAnalyze().

907  {
908  LOGPRINT << "Entering hot cold map generation!\n";
909  TStyle* gStyle = new TStyle("gStyle", "myStyle");
910  gStyle->cd();
911  gStyle->SetPalette(1);
912  gStyle->SetCanvasColor(kWhite);
913  gStyle->SetOptStat(0);
914  //Here we make the hot/cold color maps that we love so very much
915  //Already have access to the data as a private variable
916  //Create all of the histograms in the TFileService
917  TH2F* temph2;
918  for (Long_t maplayer = 1; maplayer <= siStripLayers_; maplayer++) {
919  //Initialize all of the histograms
920  if (maplayer > 0 && maplayer <= 4) {
921  //We are in the TIB
922  temph2 = fs->make<TH2F>(Form("%s%i", "TIB", (int)(maplayer)), "TIB", 100, -1, 361, 100, -100, 100);
923  temph2->GetXaxis()->SetTitle("Phi");
924  temph2->GetXaxis()->SetBinLabel(1, TString("360"));
925  temph2->GetXaxis()->SetBinLabel(50, TString("180"));
926  temph2->GetXaxis()->SetBinLabel(100, TString("0"));
927  temph2->GetYaxis()->SetTitle("Global Z");
928  temph2->SetOption("colz");
929  HotColdMaps.push_back(temph2);
930  } else if (maplayer > 4 && maplayer <= 10) {
931  //We are in the TOB
932  temph2 = fs->make<TH2F>(Form("%s%i", "TOB", (int)(maplayer - 4)), "TOB", 100, -1, 361, 100, -120, 120);
933  temph2->GetXaxis()->SetTitle("Phi");
934  temph2->GetXaxis()->SetBinLabel(1, TString("360"));
935  temph2->GetXaxis()->SetBinLabel(50, TString("180"));
936  temph2->GetXaxis()->SetBinLabel(100, TString("0"));
937  temph2->GetYaxis()->SetTitle("Global Z");
938  temph2->SetOption("colz");
939  HotColdMaps.push_back(temph2);
940  } else if (maplayer > 10 && maplayer <= 13) {
941  //We are in the TID
942  //Split by +/-
943  temph2 = fs->make<TH2F>(Form("%s%i", "TID-", (int)(maplayer - 10)), "TID-", 100, -100, 100, 100, -100, 100);
944  temph2->GetXaxis()->SetTitle("Global Y");
945  temph2->GetXaxis()->SetBinLabel(1, TString("+Y"));
946  temph2->GetXaxis()->SetBinLabel(50, TString("0"));
947  temph2->GetXaxis()->SetBinLabel(100, TString("-Y"));
948  temph2->GetYaxis()->SetTitle("Global X");
949  temph2->GetYaxis()->SetBinLabel(1, TString("-X"));
950  temph2->GetYaxis()->SetBinLabel(50, TString("0"));
951  temph2->GetYaxis()->SetBinLabel(100, TString("+X"));
952  temph2->SetOption("colz");
953  HotColdMaps.push_back(temph2);
954  temph2 = fs->make<TH2F>(Form("%s%i", "TID+", (int)(maplayer - 10)), "TID+", 100, -100, 100, 100, -100, 100);
955  temph2->GetXaxis()->SetTitle("Global Y");
956  temph2->GetXaxis()->SetBinLabel(1, TString("+Y"));
957  temph2->GetXaxis()->SetBinLabel(50, TString("0"));
958  temph2->GetXaxis()->SetBinLabel(100, TString("-Y"));
959  temph2->GetYaxis()->SetTitle("Global X");
960  temph2->GetYaxis()->SetBinLabel(1, TString("-X"));
961  temph2->GetYaxis()->SetBinLabel(50, TString("0"));
962  temph2->GetYaxis()->SetBinLabel(100, TString("+X"));
963  temph2->SetOption("colz");
964  HotColdMaps.push_back(temph2);
965  } else if (maplayer > 13) {
966  //We are in the TEC
967  //Split by +/-
968  temph2 = fs->make<TH2F>(Form("%s%i", "TEC-", (int)(maplayer - 13)), "TEC-", 100, -120, 120, 100, -120, 120);
969  temph2->GetXaxis()->SetTitle("Global Y");
970  temph2->GetXaxis()->SetBinLabel(1, TString("+Y"));
971  temph2->GetXaxis()->SetBinLabel(50, TString("0"));
972  temph2->GetXaxis()->SetBinLabel(100, TString("-Y"));
973  temph2->GetYaxis()->SetTitle("Global X");
974  temph2->GetYaxis()->SetBinLabel(1, TString("-X"));
975  temph2->GetYaxis()->SetBinLabel(50, TString("0"));
976  temph2->GetYaxis()->SetBinLabel(100, TString("+X"));
977  temph2->SetOption("colz");
978  HotColdMaps.push_back(temph2);
979  temph2 = fs->make<TH2F>(Form("%s%i", "TEC+", (int)(maplayer - 13)), "TEC+", 100, -120, 120, 100, -120, 120);
980  temph2->GetXaxis()->SetTitle("Global Y");
981  temph2->GetXaxis()->SetBinLabel(1, TString("+Y"));
982  temph2->GetXaxis()->SetBinLabel(50, TString("0"));
983  temph2->GetXaxis()->SetBinLabel(100, TString("-Y"));
984  temph2->GetYaxis()->SetTitle("Global X");
985  temph2->GetYaxis()->SetBinLabel(1, TString("-X"));
986  temph2->GetYaxis()->SetBinLabel(50, TString("0"));
987  temph2->GetYaxis()->SetBinLabel(100, TString("+X"));
988  temph2->SetOption("colz");
989  HotColdMaps.push_back(temph2);
990  }
991  }
992  for (Long_t mylayer = 1; mylayer <= siStripLayers_; mylayer++) {
993  //Determine what kind of plot we want to write out
994  //Loop through the entirety of each layer
995  //Create an array of the histograms
996  vector<hit>::const_iterator iter;
997  for (iter = hits[mylayer].begin(); iter != hits[mylayer].end(); iter++) {
998  //Looping over the particular layer
999  //Fill by 360-x to get the proper location to compare with TKMaps of phi
1000  //Also global xy is messed up
1001  if (mylayer > 0 && mylayer <= 4) {
1002  //We are in the TIB
1003  float phi = ::calcPhi(iter->x, iter->y);
1004  HotColdMaps[mylayer - 1]->Fill(360. - phi, iter->z, 1.);
1005  } else if (mylayer > 4 && mylayer <= 10) {
1006  //We are in the TOB
1007  float phi = ::calcPhi(iter->x, iter->y);
1008  HotColdMaps[mylayer - 1]->Fill(360. - phi, iter->z, 1.);
1009  } else if (mylayer > 10 && mylayer <= 13) {
1010  //We are in the TID
1011  //There are 2 different maps here
1012  int side = (((iter->id) >> 13) & 0x3);
1013  if (side == 1)
1014  HotColdMaps[(mylayer - 1) + (mylayer - 11)]->Fill(-iter->y, iter->x, 1.);
1015  else if (side == 2)
1016  HotColdMaps[(mylayer - 1) + (mylayer - 10)]->Fill(-iter->y, iter->x, 1.);
1017  //if(side == 1) HotColdMaps[(mylayer - 1) + (mylayer - 11)]->Fill(iter->x,iter->y,1.);
1018  //else if(side == 2) HotColdMaps[(mylayer - 1) + (mylayer - 10)]->Fill(iter->x,iter->y,1.);
1019  } else if (mylayer > 13) {
1020  //We are in the TEC
1021  //There are 2 different maps here
1022  int side = (((iter->id) >> 18) & 0x3);
1023  if (side == 1)
1024  HotColdMaps[(mylayer + 2) + (mylayer - 14)]->Fill(-iter->y, iter->x, 1.);
1025  else if (side == 2)
1026  HotColdMaps[(mylayer + 2) + (mylayer - 13)]->Fill(-iter->y, iter->x, 1.);
1027  //if(side == 1) HotColdMaps[(mylayer + 2) + (mylayer - 14)]->Fill(iter->x,iter->y,1.);
1028  //else if(side == 2) HotColdMaps[(mylayer + 2) + (mylayer - 13)]->Fill(iter->x,iter->y,1.);
1029  }
1030  }
1031  }
1032  LOGPRINT << "Finished HotCold Map Generation\n";
1033 }
#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 1183 of file SiStripHitEffFromCalibTree.cc.

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

Referenced by algoAnalyze().

1183  {
1184  //Generate the SQLite file for use in the Database of the bad modules!
1185  LOGPRINT << "Entering SQLite file generation!\n";
1186  std::vector<unsigned int> BadStripList;
1187  unsigned short NStrips;
1188  unsigned int id1;
1189  std::unique_ptr<SiStripQuality> pQuality = std::make_unique<SiStripQuality>(detInfo_);
1190  //This is the list of the bad strips, use to mask out entire APVs
1191  //Now simply go through the bad hit list and mask out things that
1192  //are bad!
1193  for (const auto& it : BadModules) {
1194  //We need to figure out how many strips are in this particular module
1195  //To Mask correctly!
1196  NStrips = detInfo_.getNumberOfApvsAndStripLength(it.first).first * 128;
1197  LOGPRINT << "Number of strips module " << it.first << " is " << NStrips;
1198  BadStripList.push_back(pQuality->encode(0, NStrips, 0));
1199  //Now compact into a single bad module
1200  id1 = (unsigned int)it.first;
1201  LOGPRINT << "ID1 shoudl match list of modules above " << id1;
1202  quality_->compact(id1, BadStripList);
1203  SiStripQuality::Range range(BadStripList.begin(), BadStripList.end());
1204  quality_->put(id1, range);
1205  BadStripList.clear();
1206  }
1207  //Fill all the bad components now
1209 }
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 1259 of file SiStripHitEffFromCalibTree.cc.

References python.cmstools::all(), alllayerfound, alllayertotal, MillePedeFileConverter_cfg::e, effPlotMin_, newFWLiteAna::found, fs, getLayerSideName(), goodlayerfound, goodlayertotal, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, label, LOGPRINT, TFileService::make(), MuonTCMETValueMapProducer_cff::nLayers, nTEClayers, compare::overlay(), showEndcapSides_, showOnlyGoodModules_, showRings_, showTOB6TEC9_, siStripLayers_, and title_.

Referenced by algoAnalyze().

1259  {
1260  //setTDRStyle();
1261 
1262  int nLayers = 34;
1263  if (showRings_)
1264  nLayers = 30;
1265  if (!showEndcapSides_) {
1266  if (!showRings_)
1268  else
1269  nLayers = 20;
1270  }
1271 
1272  TH1F* found = fs->make<TH1F>("found", "found", nLayers + 1, 0, nLayers + 1);
1273  TH1F* all = fs->make<TH1F>("all", "all", nLayers + 1, 0, nLayers + 1);
1274  TH1F* found2 = fs->make<TH1F>("found2", "found2", nLayers + 1, 0, nLayers + 1);
1275  TH1F* all2 = fs->make<TH1F>("all2", "all2", nLayers + 1, 0, nLayers + 1);
1276  // first bin only to keep real data off the y axis so set to -1
1277  found->SetBinContent(0, -1);
1278  all->SetBinContent(0, 1);
1279 
1280  // new ROOT version: TGraph::Divide don't handle null or negative values
1281  for (Long_t i = 1; i < nLayers + 2; ++i) {
1282  found->SetBinContent(i, 1e-6);
1283  all->SetBinContent(i, 1);
1284  found2->SetBinContent(i, 1e-6);
1285  all2->SetBinContent(i, 1);
1286  }
1287 
1288  TCanvas* c7 = new TCanvas("c7", " test ", 10, 10, 800, 600);
1289  c7->SetFillColor(0);
1290  c7->SetGrid();
1291 
1292  int nLayers_max = nLayers + 1; // barrel+endcap
1293  if (!showEndcapSides_)
1294  nLayers_max = 11; // barrel
1295  for (Long_t i = 1; i < nLayers_max; ++i) {
1296  LOGPRINT << "Fill only good modules layer " << i << ": S = " << goodlayerfound[i]
1297  << " B = " << goodlayertotal[i];
1298  if (goodlayertotal[i] > 5) {
1299  found->SetBinContent(i, goodlayerfound[i]);
1300  all->SetBinContent(i, goodlayertotal[i]);
1301  }
1302 
1303  LOGPRINT << "Filling all modules layer " << i << ": S = " << alllayerfound[i] << " B = " << alllayertotal[i];
1304  if (alllayertotal[i] > 5) {
1305  found2->SetBinContent(i, alllayerfound[i]);
1306  all2->SetBinContent(i, alllayertotal[i]);
1307  }
1308  }
1309 
1310  // endcap - merging sides
1311  if (!showEndcapSides_) {
1312  for (Long_t i = 11; i < 14; ++i) { // TID disks
1313  LOGPRINT << "Fill only good modules layer " << i << ": S = " << goodlayerfound[i] + goodlayerfound[i + 3]
1314  << " B = " << goodlayertotal[i] + goodlayertotal[i + 3];
1315  if (goodlayertotal[i] + goodlayertotal[i + 3] > 5) {
1316  found->SetBinContent(i, goodlayerfound[i] + goodlayerfound[i + 3]);
1317  all->SetBinContent(i, goodlayertotal[i] + goodlayertotal[i + 3]);
1318  }
1319  LOGPRINT << "Filling all modules layer " << i << ": S = " << alllayerfound[i] + alllayerfound[i + 3]
1320  << " B = " << alllayertotal[i] + alllayertotal[i + 3];
1321  if (alllayertotal[i] + alllayertotal[i + 3] > 5) {
1322  found2->SetBinContent(i, alllayerfound[i] + alllayerfound[i + 3]);
1323  all2->SetBinContent(i, alllayertotal[i] + alllayertotal[i + 3]);
1324  }
1325  }
1326  for (Long_t i = 17; i < 17 + nTEClayers; ++i) { // TEC disks
1327  LOGPRINT << "Fill only good modules layer " << i - 3
1328  << ": S = " << goodlayerfound[i] + goodlayerfound[i + nTEClayers]
1329  << " B = " << goodlayertotal[i] + goodlayertotal[i + nTEClayers];
1330  if (goodlayertotal[i] + goodlayertotal[i + nTEClayers] > 5) {
1331  found->SetBinContent(i - 3, goodlayerfound[i] + goodlayerfound[i + nTEClayers]);
1332  all->SetBinContent(i - 3, goodlayertotal[i] + goodlayertotal[i + nTEClayers]);
1333  }
1334  LOGPRINT << "Filling all modules layer " << i - 3 << ": S = " << alllayerfound[i] + alllayerfound[i + nTEClayers]
1335  << " B = " << alllayertotal[i] + alllayertotal[i + nTEClayers];
1336  if (alllayertotal[i] + alllayertotal[i + nTEClayers] > 5) {
1337  found2->SetBinContent(i - 3, alllayerfound[i] + alllayerfound[i + nTEClayers]);
1338  all2->SetBinContent(i - 3, alllayertotal[i] + alllayertotal[i + nTEClayers]);
1339  }
1340  }
1341  }
1342 
1343  found->Sumw2();
1344  all->Sumw2();
1345 
1346  found2->Sumw2();
1347  all2->Sumw2();
1348 
1349  TGraphAsymmErrors* gr = fs->make<TGraphAsymmErrors>(nLayers + 1);
1350  gr->SetName("eff_good");
1351  gr->BayesDivide(found, all);
1352 
1353  TGraphAsymmErrors* gr2 = fs->make<TGraphAsymmErrors>(nLayers + 1);
1354  gr2->SetName("eff_all");
1355  gr2->BayesDivide(found2, all2);
1356 
1357  for (int j = 0; j < nLayers + 1; j++) {
1358  gr->SetPointError(j, 0., 0., gr->GetErrorYlow(j), gr->GetErrorYhigh(j));
1359  gr2->SetPointError(j, 0., 0., gr2->GetErrorYlow(j), gr2->GetErrorYhigh(j));
1360  }
1361 
1362  gr->GetXaxis()->SetLimits(0, nLayers);
1363  gr->SetMarkerColor(2);
1364  gr->SetMarkerSize(1.2);
1365  gr->SetLineColor(2);
1366  gr->SetLineWidth(4);
1367  gr->SetMarkerStyle(20);
1368  gr->SetMinimum(effPlotMin_);
1369  gr->SetMaximum(1.001);
1370  gr->GetYaxis()->SetTitle("Efficiency");
1371  gStyle->SetTitleFillColor(0);
1372  gStyle->SetTitleBorderSize(0);
1373  gr->SetTitle(title_);
1374 
1375  gr2->GetXaxis()->SetLimits(0, nLayers);
1376  gr2->SetMarkerColor(1);
1377  gr2->SetMarkerSize(1.2);
1378  gr2->SetLineColor(1);
1379  gr2->SetLineWidth(4);
1380  gr2->SetMarkerStyle(21);
1381  gr2->SetMinimum(effPlotMin_);
1382  gr2->SetMaximum(1.001);
1383  gr2->GetYaxis()->SetTitle("Efficiency");
1384  gr2->SetTitle(title_);
1385 
1386  for (Long_t k = 1; k < nLayers + 1; k++) {
1387  TString label;
1388  if (showEndcapSides_)
1390  else
1391  label = ::layerName(k, showRings_, nTEClayers);
1392  if (!showTOB6TEC9_) {
1393  if (k == 10)
1394  label = "";
1395  if (!showRings_ && k == nLayers)
1396  label = "";
1397  if (!showRings_ && showEndcapSides_ && k == 25)
1398  label = "";
1399  }
1400  if (!showRings_) {
1401  if (showEndcapSides_) {
1402  gr->GetXaxis()->SetBinLabel(((k + 1) * 100 + 2) / (nLayers)-4, label);
1403  gr2->GetXaxis()->SetBinLabel(((k + 1) * 100 + 2) / (nLayers)-4, label);
1404  } else {
1405  gr->GetXaxis()->SetBinLabel((k + 1) * 100 / (nLayers)-6, label);
1406  gr2->GetXaxis()->SetBinLabel((k + 1) * 100 / (nLayers)-6, label);
1407  }
1408  } else {
1409  if (showEndcapSides_) {
1410  gr->GetXaxis()->SetBinLabel((k + 1) * 100 / (nLayers)-4, label);
1411  gr2->GetXaxis()->SetBinLabel((k + 1) * 100 / (nLayers)-4, label);
1412  } else {
1413  gr->GetXaxis()->SetBinLabel((k + 1) * 100 / (nLayers)-7, label);
1414  gr2->GetXaxis()->SetBinLabel((k + 1) * 100 / (nLayers)-7, label);
1415  }
1416  }
1417  }
1418 
1419  gr->Draw("AP");
1420  gr->GetXaxis()->SetNdivisions(36);
1421 
1422  c7->cd();
1423  TPad* overlay = new TPad("overlay", "", 0, 0, 1, 1);
1424  overlay->SetFillStyle(4000);
1425  overlay->SetFillColor(0);
1426  overlay->SetFrameFillStyle(4000);
1427  overlay->Draw("same");
1428  overlay->cd();
1429  if (!showOnlyGoodModules_)
1430  gr2->Draw("AP");
1431 
1432  TLegend* leg = new TLegend(0.70, 0.27, 0.88, 0.40);
1433  leg->AddEntry(gr, "Good Modules", "p");
1434  if (!showOnlyGoodModules_)
1435  leg->AddEntry(gr2, "All Modules", "p");
1436  leg->SetTextSize(0.020);
1437  leg->SetFillColor(0);
1438  leg->Draw("same");
1439 
1440  c7->SaveAs("Summary.png");
1441  c7->SaveAs("Summary.C");
1442 }
#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 1444 of file SiStripHitEffFromCalibTree.cc.

References MillePedeFileConverter_cfg::e, nano_mu_digi_cff::float, dqm-mbProfile::format, newFWLiteAna::found, fs, layerfound_perBx, layerfound_vsBX, layertotal_perBx, layertotal_vsBX, LOGPRINT, LaserClient_cfi::low, TFileService::make(), nBxInAnOrbit_, MuonTCMETValueMapProducer_cff::nLayers, nTEClayers, showRings_, siStripLayers_, spaceBetweenTrains_, dqmMemoryStats::total, and up.

Referenced by algoAnalyze().

1444  {
1445  LOGPRINT << "Computing efficiency vs bx";
1446 
1447  unsigned int nLayers = siStripLayers_;
1448  if (showRings_)
1449  nLayers = 20;
1450 
1451  for (unsigned int ilayer = 1; ilayer < nLayers; ilayer++) {
1452  for (unsigned int ibx = 0; ibx <= nBxInAnOrbit_; ibx++) {
1453  layerfound_vsBX[ilayer]->SetBinContent(ibx, 1e-6);
1454  layertotal_vsBX[ilayer]->SetBinContent(ibx, 1);
1455  }
1456 
1457  for (const auto& iterMapvsBx : layerfound_perBx) {
1458  layerfound_vsBX[ilayer]->SetBinContent(iterMapvsBx.first, iterMapvsBx.second[ilayer]);
1459  }
1460  for (const auto& iterMapvsBx : layertotal_perBx) {
1461  if (iterMapvsBx.second[ilayer] > 0) {
1462  layertotal_vsBX[ilayer]->SetBinContent(iterMapvsBx.first, iterMapvsBx.second[ilayer]);
1463  }
1464  }
1465 
1466  layerfound_vsBX[ilayer]->Sumw2();
1467  layertotal_vsBX[ilayer]->Sumw2();
1468 
1469  TGraphAsymmErrors* geff = fs->make<TGraphAsymmErrors>(nBxInAnOrbit_ - 1);
1470  geff->SetName(Form("effVsBx_layer%i", ilayer));
1471 
1472  geff->SetTitle(fmt::format("Hit Efficiency vs bx - {}", ::layerName(ilayer, showRings_, nTEClayers)).c_str());
1473  geff->BayesDivide(layerfound_vsBX[ilayer], layertotal_vsBX[ilayer]);
1474 
1475  //Average over trains
1476  TGraphAsymmErrors* geff_avg = fs->make<TGraphAsymmErrors>();
1477  geff_avg->SetName(Form("effVsBxAvg_layer%i", ilayer));
1478  geff_avg->SetTitle(fmt::format("Hit Efficiency vs bx - {}", ::layerName(ilayer, showRings_, nTEClayers)).c_str());
1479  geff_avg->SetMarkerStyle(20);
1480  int ibx = 0;
1481  int previous_bx = -80;
1482  int delta_bx = 0;
1483  int nbx = 0;
1484  int found = 0;
1485  int total = 0;
1486  double sum_bx = 0;
1487  int ipt = 0;
1488  float low, up, eff;
1489  int firstbx = 0;
1490  for (const auto& iterMapvsBx : layertotal_perBx) {
1491  ibx = iterMapvsBx.first;
1492  delta_bx = ibx - previous_bx;
1493  // consider a new train
1494  if (delta_bx > (int)spaceBetweenTrains_ && nbx > 0 && total > 0) {
1495  eff = found / (float)total;
1496  //LOGPRINT<<"new train "<<ipt<<" "<<sum_bx/nbx<<" "<<eff<<endl;
1497  geff_avg->SetPoint(ipt, sum_bx / nbx, eff);
1498  low = TEfficiency::Bayesian(total, found, .683, 1, 1, false);
1499  up = TEfficiency::Bayesian(total, found, .683, 1, 1, true);
1500  geff_avg->SetPointError(ipt, sum_bx / nbx - firstbx, previous_bx - sum_bx / nbx, eff - low, up - eff);
1501  ipt++;
1502  sum_bx = 0;
1503  found = 0;
1504  total = 0;
1505  nbx = 0;
1506  firstbx = ibx;
1507  }
1508  sum_bx += ibx;
1509  found += layerfound_vsBX[ilayer]->GetBinContent(ibx);
1510  total += layertotal_vsBX[ilayer]->GetBinContent(ibx);
1511  nbx++;
1512 
1513  previous_bx = ibx;
1514  }
1515  //last train
1516  eff = found / (float)total;
1517  //LOGPRINT<<"new train "<<ipt<<" "<<sum_bx/nbx<<" "<<eff<<endl;
1518  geff_avg->SetPoint(ipt, sum_bx / nbx, eff);
1519  low = TEfficiency::Bayesian(total, found, .683, 1, 1, false);
1520  up = TEfficiency::Bayesian(total, found, .683, 1, 1, true);
1521  geff_avg->SetPointError(ipt, sum_bx / nbx - firstbx, previous_bx - sum_bx / nbx, eff - low, up - eff);
1522  }
1523 }
Definition: BitonicSort.h:7
map< unsigned int, vector< int > > layertotal_perBx
#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 1601 of file SiStripHitEffFromCalibTree.cc.

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

Referenced by algoAnalyze().

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

◆ makeSummaryVsLumi()

void SiStripHitEffFromCalibTree::makeSummaryVsLumi ( )
private

Definition at line 1563 of file SiStripHitEffFromCalibTree.cc.

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

Referenced by algoAnalyze().

1563  {
1564  LOGPRINT << "Computing efficiency vs lumi";
1565 
1566  if (instLumiHisto->GetEntries()) // from infos per event
1567  LOGPRINT << "Avg conditions (avg+/-rms): lumi :" << instLumiHisto->GetMean() << "+/-" << instLumiHisto->GetRMS()
1568  << " pu: " << PUHisto->GetMean() << "+/-" << PUHisto->GetRMS();
1569 
1570  else { // from infos per hit
1571 
1572  unsigned int nLayers = siStripLayers_;
1573  if (showRings_)
1574  nLayers = 20;
1575  unsigned int nLayersForAvg = 0;
1576  float layerLumi = 0;
1577  float layerPU = 0;
1578  float avgLumi = 0;
1579  float avgPU = 0;
1580 
1581  LOGPRINT << "Lumi summary: (avg over trajectory measurements)";
1582  for (unsigned int ilayer = 1; ilayer < nLayers; ilayer++) {
1583  layerLumi = layertotal_vsLumi[ilayer]->GetMean();
1584  layerPU = layertotal_vsPU[ilayer]->GetMean();
1585  //LOGPRINT<<" layer "<<ilayer<<" lumi: "<<layerLumi<<" pu: "<<layerPU<<endl;
1586  if (layerLumi != 0 && layerPU != 0) {
1587  avgLumi += layerLumi;
1588  avgPU += layerPU;
1589  nLayersForAvg++;
1590  }
1591  }
1592  avgLumi /= nLayersForAvg;
1593  avgPU /= nLayersForAvg;
1594  LOGPRINT << "Avg conditions: lumi :" << avgLumi << " pu: " << avgPU;
1595  }
1596 
1599 }
#define LOGPRINT
void computeEff(vector< TH1F *> &vhfound, vector< TH1F *> &vhtotal, string name)

◆ makeTKMap()

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

Definition at line 1035 of file SiStripHitEffFromCalibTree.cc.

References BadModules, TrackerMap::fill(), TrackerMap::fillc(), fs, mps_fire::i, layerfound, layertotal, LOGPRINT, TFileService::make(), modCounter, nModsMin_, nTEClayers, TrackerMap::save(), showRings_, siStripLayers_, storeModEff_, threshold_, title_, tkmap, tkmapbad, tkmapden, tkmapeff, tkMapMin_, and tkmapnum.

Referenced by algoAnalyze().

1035  {
1036  LOGPRINT << "Entering TKMap generation!\n";
1037 
1038  TTree* tree = nullptr;
1039  unsigned int t_DetId, t_found, t_total;
1040  unsigned char t_layer;
1041  bool t_isTaggedIneff;
1042  float t_threshold;
1043  if (storeModEff_) {
1044  tree = fs->make<TTree>("ModEff", "ModEff");
1045  tree->Branch("DetId", &t_DetId, "DetId/i");
1046  tree->Branch("Layer", &t_layer, "Layer/b");
1047  tree->Branch("FoundHits", &t_found, "FoundHits/i");
1048  tree->Branch("AllHits", &t_total, "AllHits/i");
1049  tree->Branch("IsTaggedIneff", &t_isTaggedIneff, "IsTaggedIneff/O");
1050  tree->Branch("TagThreshold", &t_threshold, "TagThreshold/F");
1051  }
1052 
1053  tkmap = new TrackerMap(" Detector Inefficiency ");
1054  tkmapbad = new TrackerMap(" Inefficient Modules ");
1055  tkmapeff = new TrackerMap(title_.Data());
1056  tkmapnum = new TrackerMap(" Detector numerator ");
1057  tkmapden = new TrackerMap(" Detector denominator ");
1058 
1059  double myeff, mynum, myden, myeff_up;
1060  double layer_min_eff = 0;
1061 
1062  for (Long_t i = 1; i <= siStripLayers_; i++) {
1063  //Loop over every layer, extracting the information from
1064  //the map of the efficiencies
1065  layertotal[i] = 0;
1066  layerfound[i] = 0;
1067  TH1F* hEffInLayer =
1068  fs->make<TH1F>(Form("eff_layer%i", int(i)), Form("Module efficiency in layer %i", int(i)), 201, 0, 1.005);
1069 
1070  for (const auto& ih : modCounter[i]) {
1071  //We should be in the layer in question, and looping over all of the modules in said layer
1072  //Generate the list for the TKmap, and the bad module list
1073  mynum = (double)((ih.second).second);
1074  myden = (double)((ih.second).first);
1075  if (myden > 0)
1076  myeff = mynum / myden;
1077  else
1078  myeff = 0;
1079  hEffInLayer->Fill(myeff);
1080 
1081  if (!autoTagging) {
1082  if ((myden >= nModsMin_) && (myeff < threshold_)) {
1083  //We have a bad module, put it in the list!
1084  BadModules[ih.first] = myeff;
1085  tkmapbad->fillc(ih.first, 255, 0, 0);
1086  LOGPRINT << "Layer " << i << " (" << ::layerName(i, showRings_, nTEClayers) << ") module " << ih.first
1087  << " efficiency: " << myeff << " , " << mynum << "/" << myden;
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 < threshold_)
1093  LOGPRINT << "Layer " << i << " (" << ::layerName(i, showRings_, nTEClayers) << ") module " << ih.first
1094  << " efficiency: " << myeff << " , " << mynum << "/" << myden;
1095  if (myden < nModsMin_) {
1096  LOGPRINT << "Layer " << i << " (" << ::layerName(i, showRings_, nTEClayers) << ") module " << ih.first
1097  << " is under occupancy at " << myden;
1098  }
1099  }
1100 
1101  if (storeModEff_) {
1102  t_DetId = ih.first;
1103  t_layer = i;
1104  t_found = mynum;
1105  t_total = myden;
1106  t_isTaggedIneff = false;
1107  t_threshold = 0;
1108  tree->Fill();
1109  }
1110 
1111  //Put any module into the TKMap
1112  tkmap->fill(ih.first, 1. - myeff);
1113  tkmapeff->fill(ih.first, myeff);
1114  tkmapnum->fill(ih.first, mynum);
1115  tkmapden->fill(ih.first, myden);
1116 
1117  //Add the number of hits in the layer
1118  layertotal[i] += long(myden);
1119  layerfound[i] += long(mynum);
1120  }
1121 
1122  if (autoTagging) {
1123  //Compute threshold to use for each layer
1124  hEffInLayer->GetXaxis()->SetRange(3, hEffInLayer->GetNbinsX() + 1); // Remove from the avg modules below 1%
1125  layer_min_eff =
1126  hEffInLayer->GetMean() - 2.5 * hEffInLayer->GetRMS(); // uses RMS in case the distribution is wide
1127  if (threshold_ > 2.5 * hEffInLayer->GetRMS())
1128  layer_min_eff = hEffInLayer->GetMean() - threshold_; // otherwise uses the parameter 'threshold'
1129  LOGPRINT << "Layer " << i << " threshold for bad modules: <" << layer_min_eff
1130  << " (layer mean: " << hEffInLayer->GetMean() << " rms: " << hEffInLayer->GetRMS() << ")";
1131 
1132  hEffInLayer->GetXaxis()->SetRange(1, hEffInLayer->GetNbinsX() + 1);
1133 
1134  for (const auto& ih : modCounter[i]) {
1135  // Second loop over modules to tag inefficient ones
1136  mynum = (double)((ih.second).second);
1137  myden = (double)((ih.second).first);
1138  if (myden > 0)
1139  myeff = mynum / myden;
1140  else
1141  myeff = 0;
1142  // upper limit on the efficiency
1143  myeff_up = TEfficiency::Bayesian(myden, mynum, .99, 1, 1, true);
1144  if ((myden >= nModsMin_) && (myeff_up < layer_min_eff)) {
1145  //We have a bad module, put it in the list!
1146  BadModules[ih.first] = myeff;
1147  tkmapbad->fillc(ih.first, 255, 0, 0);
1148  t_isTaggedIneff = true;
1149  } else {
1150  //Fill the bad list with empty results for every module
1151  tkmapbad->fillc(ih.first, 255, 255, 255);
1152  t_isTaggedIneff = false;
1153  }
1154  if (myeff_up < layer_min_eff + 0.08) // printing message also for modules slighly above (8%) the limit
1155  LOGPRINT << "Layer " << i << " (" << ::layerName(i, showRings_, nTEClayers) << ") module " << ih.first
1156  << " efficiency: " << myeff << " , " << mynum << "/" << myden << " , upper limit: " << myeff_up;
1157  if (myden < nModsMin_) {
1158  LOGPRINT << "Layer " << i << " (" << ::layerName(i, showRings_, nTEClayers) << ") module " << ih.first
1159  << " layer " << i << " is under occupancy at " << myden;
1160  }
1161 
1162  if (storeModEff_) {
1163  t_DetId = ih.first;
1164  t_layer = i;
1165  t_found = mynum;
1166  t_total = myden;
1167  t_threshold = layer_min_eff;
1168  tree->Fill();
1169  }
1170  }
1171  }
1172  }
1173  tkmap->save(true, 0, 0, "SiStripHitEffTKMap.png");
1174  tkmapbad->save(true, 0, 0, "SiStripHitEffTKMapBad.png");
1175  tkmapeff->save(true, tkMapMin_, 1., "SiStripHitEffTKMapEff.png");
1176  tkmapnum->save(true, 0, 0, "SiStripHitEffTKMapNum.png");
1177  tkmapden->save(true, 0, 0, "SiStripHitEffTKMapDen.png");
1178  LOGPRINT << "Finished TKMap Generation\n";
1179  if (storeModEff_)
1180  LOGPRINT << "Modules efficiencies stored in tree\n";
1181 }
map< unsigned int, double > BadModules
#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:844
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:135
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
Definition: tree.py:1
void fill(int layer, int ring, int nmod, float x)
Definition: TrackerMap.cc:3443
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 1647 of file SiStripHitEffFromCalibTree.cc.

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

Referenced by algoAnalyze().

1648  {
1649  int napv = detInfo_.getNumberOfApvsAndStripLength(BC.detid).first;
1650 
1651  ssV[i][component] << "\n\t\t " << BC.detid << " \t " << BC.BadModule << " \t " << ((BC.BadFibers) & 0x1) << " ";
1652  if (napv == 4)
1653  ssV[i][component] << "x " << ((BC.BadFibers >> 1) & 0x1);
1654 
1655  if (napv == 6)
1656  ssV[i][component] << ((BC.BadFibers >> 1) & 0x1) << " " << ((BC.BadFibers >> 2) & 0x1);
1657  ssV[i][component] << " \t " << ((BC.BadApvs) & 0x1) << " " << ((BC.BadApvs >> 1) & 0x1) << " ";
1658  if (napv == 4)
1659  ssV[i][component] << "x x " << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1);
1660  if (napv == 6)
1661  ssV[i][component] << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1) << " "
1662  << ((BC.BadApvs >> 4) & 0x1) << " " << ((BC.BadApvs >> 5) & 0x1) << " ";
1663 
1664  if (BC.BadApvs) {
1665  NBadComponent[i][0][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) + ((BC.BadApvs >> 3) & 0x1) +
1666  ((BC.BadApvs >> 2) & 0x1) + ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
1667  NBadComponent[i][component][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) +
1668  ((BC.BadApvs >> 3) & 0x1) + ((BC.BadApvs >> 2) & 0x1) +
1669  ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
1670  }
1671  if (BC.BadFibers) {
1672  NBadComponent[i][0][1] += ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
1673  NBadComponent[i][component][1] +=
1674  ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
1675  }
1676  if (BC.BadModule) {
1677  NBadComponent[i][0][0]++;
1678  NBadComponent[i][component][0]++;
1679  }
1680 }
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const

◆ totalStatistics()

void SiStripHitEffFromCalibTree::totalStatistics ( )
private

Definition at line 1211 of file SiStripHitEffFromCalibTree.cc.

References mps_fire::i, layerfound, layertotal, LOGPRINT, nTEClayers, showRings_, and siStripLayers_.

Referenced by algoAnalyze().

1211  {
1212  //Calculate the statistics by layer
1213  int totalfound = 0;
1214  int totaltotal = 0;
1215  double layereff;
1216  int subdetfound[5];
1217  int subdettotal[5];
1218 
1219  for (Long_t i = 1; i < 5; i++) {
1220  subdetfound[i] = 0;
1221  subdettotal[i] = 0;
1222  }
1223 
1224  for (Long_t i = 1; i <= siStripLayers_; i++) {
1225  layereff = double(layerfound[i]) / double(layertotal[i]);
1226  LOGPRINT << "Layer " << i << " (" << ::layerName(i, showRings_, nTEClayers) << ") has total efficiency " << layereff
1227  << " " << layerfound[i] << "/" << layertotal[i];
1228  totalfound += layerfound[i];
1229  totaltotal += layertotal[i];
1230  if (i < 5) {
1231  subdetfound[1] += layerfound[i];
1232  subdettotal[1] += layertotal[i];
1233  }
1234  if (i >= 5 && i < 11) {
1235  subdetfound[2] += layerfound[i];
1236  subdettotal[2] += layertotal[i];
1237  }
1238  if (i >= 11 && i < 14) {
1239  subdetfound[3] += layerfound[i];
1240  subdettotal[3] += layertotal[i];
1241  }
1242  if (i >= 14) {
1243  subdetfound[4] += layerfound[i];
1244  subdettotal[4] += layertotal[i];
1245  }
1246  }
1247 
1248  LOGPRINT << "The total efficiency is " << double(totalfound) / double(totaltotal);
1249  LOGPRINT << " TIB: " << double(subdetfound[1]) / subdettotal[1] << " " << subdetfound[1] << "/"
1250  << subdettotal[1];
1251  LOGPRINT << " TOB: " << double(subdetfound[2]) / subdettotal[2] << " " << subdetfound[2] << "/"
1252  << subdettotal[2];
1253  LOGPRINT << " TID: " << double(subdetfound[3]) / subdettotal[3] << " " << subdetfound[3] << "/"
1254  << subdettotal[3];
1255  LOGPRINT << " TEC: " << double(subdetfound[4]) / subdettotal[4] << " " << subdetfound[4] << "/"
1256  << subdettotal[4];
1257 }
#define LOGPRINT

Member Data Documentation

◆ alllayerfound

int SiStripHitEffFromCalibTree::alllayerfound[35]
private

Definition at line 195 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummary().

◆ alllayertotal

int SiStripHitEffFromCalibTree::alllayertotal[35]
private

Definition at line 194 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummary().

◆ autoIneffModTagging_

bool SiStripHitEffFromCalibTree::autoIneffModTagging_
private

Definition at line 139 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ BadModules

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

Definition at line 196 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeSQLite(), and makeTKMap().

◆ badModulesFile_

string SiStripHitEffFromCalibTree::badModulesFile_
private

Definition at line 138 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ bunchX_

unsigned int SiStripHitEffFromCalibTree::bunchX_
private

Definition at line 145 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ bxHisto

TH1F* SiStripHitEffFromCalibTree::bxHisto
private

Definition at line 159 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ bxHisto_cutOnTracks

TH1F* SiStripHitEffFromCalibTree::bxHisto_cutOnTracks
private

Definition at line 163 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ calibTree_

TTree* SiStripHitEffFromCalibTree::calibTree_
private

Definition at line 134 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ calibTreeFileNames_

vector<string> SiStripHitEffFromCalibTree::calibTreeFileNames_
private

Definition at line 135 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ clusterMatchingMethod_

unsigned int SiStripHitEffFromCalibTree::clusterMatchingMethod_
private

Definition at line 140 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ clusterTrajDist_

float SiStripHitEffFromCalibTree::clusterTrajDist_
private

Definition at line 142 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ detInfo_

SiStripDetInfo SiStripHitEffFromCalibTree::detInfo_
private

◆ effPlotMin_

float SiStripHitEffFromCalibTree::effPlotMin_
private

Definition at line 153 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeSummary(), and SiStripHitEffFromCalibTree().

◆ event_used

map<pair<unsigned int, unsigned int>, bool> SiStripHitEffFromCalibTree::event_used
private

Definition at line 170 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ eventInfos

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

Definition at line 168 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ fileInPath_

edm::FileInPath SiStripHitEffFromCalibTree::fileInPath_
private

Definition at line 128 of file SiStripHitEffFromCalibTree.cc.

Referenced by SiStripHitEffFromCalibTree().

◆ fs

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

◆ goodlayerfound

int SiStripHitEffFromCalibTree::goodlayerfound[35]
private

Definition at line 193 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummary().

◆ goodlayertotal

int SiStripHitEffFromCalibTree::goodlayertotal[35]
private

Definition at line 192 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummary().

◆ hits

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

Definition at line 172 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeHotColdMaps().

◆ HotColdMaps

vector<TH2F*> SiStripHitEffFromCalibTree::HotColdMaps
private

Definition at line 173 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeHotColdMaps().

◆ instLumiHisto

TH1F* SiStripHitEffFromCalibTree::instLumiHisto
private

Definition at line 160 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ instLumiHisto_cutOnTracks

TH1F* SiStripHitEffFromCalibTree::instLumiHisto_cutOnTracks
private

Definition at line 164 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ layerfound

long SiStripHitEffFromCalibTree::layerfound[23]
private

Definition at line 180 of file SiStripHitEffFromCalibTree.cc.

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

◆ layerfound_perBx

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

Definition at line 182 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsBx().

◆ layerfound_vsBX

vector<TH1F*> SiStripHitEffFromCalibTree::layerfound_vsBX
private

Definition at line 190 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsBx().

◆ layerfound_vsCM

vector<TH1F*> SiStripHitEffFromCalibTree::layerfound_vsCM
private

Definition at line 188 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsCM().

◆ layerfound_vsLumi

vector<TH1F*> SiStripHitEffFromCalibTree::layerfound_vsLumi
private

Definition at line 184 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ layerfound_vsPU

vector<TH1F*> SiStripHitEffFromCalibTree::layerfound_vsPU
private

Definition at line 186 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ layertotal

long SiStripHitEffFromCalibTree::layertotal[23]
private

Definition at line 181 of file SiStripHitEffFromCalibTree.cc.

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

◆ layertotal_perBx

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

Definition at line 183 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsBx().

◆ layertotal_vsBX

vector<TH1F*> SiStripHitEffFromCalibTree::layertotal_vsBX
private

Definition at line 191 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsBx().

◆ layertotal_vsCM

vector<TH1F*> SiStripHitEffFromCalibTree::layertotal_vsCM
private

Definition at line 189 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsCM().

◆ layertotal_vsLumi

vector<TH1F*> SiStripHitEffFromCalibTree::layertotal_vsLumi
private

Definition at line 185 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ layertotal_vsPU

vector<TH1F*> SiStripHitEffFromCalibTree::layertotal_vsPU
private

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

Referenced by algoAnalyze(), and makeTKMap().

◆ nBxInAnOrbit_

constexpr double SiStripHitEffFromCalibTree::nBxInAnOrbit_ = 3565
staticprivate

Definition at line 124 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsBx().

◆ nModsMin_

unsigned int SiStripHitEffFromCalibTree::nModsMin_
private

◆ nTEClayers

unsigned int SiStripHitEffFromCalibTree::nTEClayers
private

◆ PUHisto

TH1F* SiStripHitEffFromCalibTree::PUHisto
private

Definition at line 161 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and makeSummaryVsLumi().

◆ PUHisto_cutOnTracks

TH1F* SiStripHitEffFromCalibTree::PUHisto_cutOnTracks
private

Definition at line 165 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ quality_

SiStripQuality* SiStripHitEffFromCalibTree::quality_
private

◆ resXSig_

float SiStripHitEffFromCalibTree::resXSig_
private

Definition at line 141 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ showEndcapSides_

bool SiStripHitEffFromCalibTree::showEndcapSides_
private

Definition at line 148 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeSummary(), and SiStripHitEffFromCalibTree().

◆ showOnlyGoodModules_

bool SiStripHitEffFromCalibTree::showOnlyGoodModules_
private

Definition at line 151 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeSummary(), and SiStripHitEffFromCalibTree().

◆ showRings_

bool SiStripHitEffFromCalibTree::showRings_
private

◆ showTOB6TEC9_

bool SiStripHitEffFromCalibTree::showTOB6TEC9_
private

◆ siStripLayers_

constexpr int SiStripHitEffFromCalibTree::siStripLayers_ = 22
staticprivate

◆ spaceBetweenTrains_

unsigned int SiStripHitEffFromCalibTree::spaceBetweenTrains_
private

Definition at line 146 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeSummaryVsBx(), and SiStripHitEffFromCalibTree().

◆ storeModEff_

bool SiStripHitEffFromCalibTree::storeModEff_
private

Definition at line 155 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap(), and SiStripHitEffFromCalibTree().

◆ stripsApvEdge_

float SiStripHitEffFromCalibTree::stripsApvEdge_
private

Definition at line 143 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ threshold_

float SiStripHitEffFromCalibTree::threshold_
private

◆ title_

TString SiStripHitEffFromCalibTree::title_
private

◆ tkGeomToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiStripHitEffFromCalibTree::tkGeomToken_
private

Definition at line 131 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ tkmap

TrackerMap* SiStripHitEffFromCalibTree::tkmap
private

Definition at line 175 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().

◆ tkmapbad

TrackerMap* SiStripHitEffFromCalibTree::tkmapbad
private

Definition at line 176 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().

◆ tkmapden

TrackerMap* SiStripHitEffFromCalibTree::tkmapden
private

Definition at line 179 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().

◆ tkmapeff

TrackerMap* SiStripHitEffFromCalibTree::tkmapeff
private

Definition at line 177 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().

◆ tkMapMin_

float SiStripHitEffFromCalibTree::tkMapMin_
private

Definition at line 152 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap(), and SiStripHitEffFromCalibTree().

◆ tkmapnum

TrackerMap* SiStripHitEffFromCalibTree::tkmapnum
private

Definition at line 178 of file SiStripHitEffFromCalibTree.cc.

Referenced by makeTKMap().

◆ tTopoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripHitEffFromCalibTree::tTopoToken_
private

Definition at line 132 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze().

◆ useCM_

bool SiStripHitEffFromCalibTree::useCM_
private

Definition at line 147 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().

◆ useOnlyHighPurityTracks_

bool SiStripHitEffFromCalibTree::useOnlyHighPurityTracks_
private

Definition at line 144 of file SiStripHitEffFromCalibTree.cc.

Referenced by algoAnalyze(), and SiStripHitEffFromCalibTree().