From c73700c0f1c41e0de4249beeb7035c00befbe1e9 Mon Sep 17 00:00:00 2001 From: Andrea Venturi Date: Sun, 24 Jul 2016 18:24:52 +0200 Subject: [PATCH 1/7] New macro to produce trend plots of the cluster occupancy --- .../SiStripTools/bin/OccupancyPlotMacros.cc | 37 +++++++++++++++++++ .../SiStripTools/bin/OccupancyPlotMacros.h | 2 +- DPGAnalysis/SiStripTools/bin/classes_def.xml | 1 + 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/DPGAnalysis/SiStripTools/bin/OccupancyPlotMacros.cc b/DPGAnalysis/SiStripTools/bin/OccupancyPlotMacros.cc index d620bff6ebc50..349dcdfe8da32 100644 --- a/DPGAnalysis/SiStripTools/bin/OccupancyPlotMacros.cc +++ b/DPGAnalysis/SiStripTools/bin/OccupancyPlotMacros.cc @@ -18,6 +18,7 @@ #include #include #include "TROOT.h" +#include "DPGAnalysis/SiStripTools/interface/CommonAnalyzer.h" #include "OccupancyPlotMacros.h" //#include @@ -677,3 +678,39 @@ void PlotTrackerXsect(TFile* ff, const char* module) { } } + +TH1D* TrendPlotSingleBin(TFile* ff, const char* module, const char* hname, const int bin) { + + CommonAnalyzer caoccu(ff,"",module); + + TH1D* occutrend = new TH1D("occutrend","Average number of clusters vs run",10,0.,10.); + occutrend->SetCanExtend(TH1::kXaxis); + occutrend->Sumw2(); + + std::vector runs = caoccu.getRunList(); + std::sort(runs.begin(),runs.end()); + + { + for(unsigned int i=0;iFindBin(bin); + std::cout << runlabel << " " << " " << ibin << " " << occu->GetBinContent(ibin) << " " << occu->GetBinError(ibin) << std::endl; + const int jbin=occutrend->Fill(runlabel,occu->GetBinContent(ibin)); + occutrend->SetBinError(jbin,occu->GetBinError(ibin)); + + } + } + } + return occutrend; +} diff --git a/DPGAnalysis/SiStripTools/bin/OccupancyPlotMacros.h b/DPGAnalysis/SiStripTools/bin/OccupancyPlotMacros.h index 7e4be6c176533..8e21c4e2b6586 100644 --- a/DPGAnalysis/SiStripTools/bin/OccupancyPlotMacros.h +++ b/DPGAnalysis/SiStripTools/bin/OccupancyPlotMacros.h @@ -37,7 +37,7 @@ void PlotDebugFPIX_XYMap(TFile* ff, const char* module, const unsigned int offse void PlotTrackerXsect(TFile* ff, const char* module); TCanvas* drawMap(const char* cname, const TH1* hval, const TProfile* averadius, const TProfile* avez,const float mmin, const float mmax, std::pair(*size)(int), float(*scale)(float), const int color, const char* ptitle=""); - +TH1D* TrendPlotSingleBin(TFile* ff, const char* module, const char* hname, const int bin); #endif // DPGAnalysis_SiStripTools_OccupancyPlotMacros_h diff --git a/DPGAnalysis/SiStripTools/bin/classes_def.xml b/DPGAnalysis/SiStripTools/bin/classes_def.xml index 3dd492e9013be..be494d7ec1520 100644 --- a/DPGAnalysis/SiStripTools/bin/classes_def.xml +++ b/DPGAnalysis/SiStripTools/bin/classes_def.xml @@ -6,6 +6,7 @@ + From 1d2a97a5619aa43ab084fa6d114e9a3b03bc6878 Mon Sep 17 00:00:00 2001 From: Andrea Venturi Date: Sat, 30 Jul 2016 22:12:36 +0200 Subject: [PATCH 2/7] New common mode analyzer --- .../plugins/CommonModeAnalyzer.cc | 335 ++++++++++++++++++ .../python/commonmodeanalyzer_cfi.py | 17 + .../test/commonmodeanalyzer_cfg.py | 101 ++++++ 3 files changed, 453 insertions(+) create mode 100644 DPGAnalysis/SiStripTools/plugins/CommonModeAnalyzer.cc create mode 100644 DPGAnalysis/SiStripTools/python/commonmodeanalyzer_cfi.py create mode 100644 DPGAnalysis/SiStripTools/test/commonmodeanalyzer_cfg.py diff --git a/DPGAnalysis/SiStripTools/plugins/CommonModeAnalyzer.cc b/DPGAnalysis/SiStripTools/plugins/CommonModeAnalyzer.cc new file mode 100644 index 0000000000000..c2f6995cf1b53 --- /dev/null +++ b/DPGAnalysis/SiStripTools/plugins/CommonModeAnalyzer.cc @@ -0,0 +1,335 @@ +// -*- C++ -*- +// +// Package: SiStripTools +// Class: CommonModeAnalyzer +// +/**\class CommonModeAnalyzer CommonModeAnalyzer.cc DPGAnalysis/SiStripTools/plugins/CommonModeAnalyzer.cc + + Description: + + Implementation: + +*/ +// +// Original Author: Andrea Venturi +// Created: Tue Jul 19 11:56:00 CEST 2009 +// +// + + +// system include files +#include + +// user include files +#include "TH1D.h" +#include "TProfile.h" +#include +#include +#include + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/ESHandle.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" + +#include "FWCore/Utilities/interface/InputTag.h" + +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/DetId/interface/DetIdCollection.h" + +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h" + +#include "DPGAnalysis/SiStripTools/interface/EventWithHistory.h" +#include "DPGAnalysis/SiStripTools/interface/APVCyclePhaseCollection.h" + +#include "DPGAnalysis/SiStripTools/interface/RunHistogramManager.h" +#include "CommonTools/UtilAlgos/interface/DetIdSelector.h" + +#include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h" +#include "CalibTracker/Records/interface/SiStripDetCablingRcd.h" +#include "CondFormats/SiStripObjects/interface/FedChannelConnection.h" +#include "DataFormats/SiStripCommon/interface/SiStripConstants.h" +// +// class decleration +// + +class CommonModeAnalyzer : public edm::EDAnalyzer { +public: + explicit CommonModeAnalyzer(const edm::ParameterSet&); + ~CommonModeAnalyzer(); + + +private: + virtual void beginJob() override ; + virtual void beginRun(const edm::Run&, const edm::EventSetup&) override; + virtual void endRun(const edm::Run&, const edm::EventSetup&) override; + virtual void analyze(const edm::Event&, const edm::EventSetup&) override; + virtual void endJob() override ; + + void updateDetCabling( const edm::EventSetup& setup ); + + // ----------member data --------------------------- + + edm::EDGetTokenT > m_digicollectionToken; + edm::EDGetTokenT m_historyProductToken; + edm::EDGetTokenT m_apvphasecollToken; + edm::EDGetTokenT m_digibadmodulecollectionToken; + const std::string m_phasepart; + const bool m_ignorebadfedmod; + const bool m_ignorenotconnected; + int m_nevents; + + std::vector m_selections; + std::vector m_labels; + std::vector m_cmdist; + std::vector m_nmodules; + std::vector m_napvs; + std::vector m_cmvsdbxincycle; + std::vector m_cmvsbxrun; + std::vector m_cmvsorbitrun; + + RunHistogramManager m_rhm; + + uint32_t m_cacheIdDet; //!< DB cache ID used to establish if the cabling has changed during the run. + const SiStripDetCabling* m_detCabling; //!< The cabling object. + + +}; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// +CommonModeAnalyzer::CommonModeAnalyzer(const edm::ParameterSet& iConfig): + m_digicollectionToken(consumes >(iConfig.getParameter("digiCollection"))), + m_historyProductToken(consumes(iConfig.getParameter("historyProduct"))), + m_apvphasecollToken(consumes(iConfig.getParameter("apvPhaseCollection"))), + m_digibadmodulecollectionToken(consumes(iConfig.getParameter("badModuleDigiCollection"))), + m_phasepart(iConfig.getUntrackedParameter("phasePartition","None")), + m_ignorebadfedmod(iConfig.getParameter("ignoreBadFEDMod")), + m_ignorenotconnected(iConfig.getParameter("ignoreNotConnected")), + m_nevents(0), + m_selections(), + m_labels(), + m_cmdist(), + m_nmodules(), + m_napvs(), + m_cmvsdbxincycle(), + m_cmvsbxrun(), + m_cmvsorbitrun(), + m_rhm(consumesCollector()), + m_cacheIdDet(0), + m_detCabling(0) +{ + //now do what ever initialization is needed + + edm::Service tfserv; + + std::vector selconfigs = iConfig.getParameter >("selections"); + + for(std::vector::const_iterator selconfig=selconfigs.begin();selconfig!=selconfigs.end();++selconfig) { + std::string label = selconfig->getParameter("label"); + DetIdSelector selection(*selconfig); + m_selections.push_back(selection); + + { + std::string hname = label + "_CommonMode"; + std::string htitle = label + " Common Mode"; + m_cmdist.push_back(tfserv->make(hname.c_str(),htitle.c_str(),1024,-0.5,1024-0.5)); + m_cmdist.back()->GetXaxis()->SetTitle("ADC"); + } + { + std::string hname = label + "_nmodules"; + std::string htitle = label + " Number of Modules with CM value"; + m_nmodules.push_back(tfserv->make(hname.c_str(),htitle.c_str(),20000,-0.5,20000-0.5)); + m_nmodules.back()->GetXaxis()->SetTitle("#modules"); + } + { + std::string hname = label + "_napvs"; + std::string htitle = label + " Number of APVs with CM value"; + m_napvs.push_back(tfserv->make(hname.c_str(),htitle.c_str(),2000,-0.5,80000-0.5)); + m_napvs.back()->GetXaxis()->SetTitle("#apvs"); + } + { + std::string hname = label + "_CMvsDBXinCycle"; + std::string htitle = label + " Common Mode vs DBX in Cycle"; + m_cmvsdbxincycle.push_back(tfserv->make(hname.c_str(),htitle.c_str(),1000,-0.5,1000-0.5)); + m_cmvsdbxincycle.back()->GetXaxis()->SetTitle("DBX in cycle"); m_cmvsdbxincycle.back()->GetYaxis()->SetTitle("CM (ADC counts)"); + } + { + std::string hname = label + "_CMvsBX"; + std::string htitle = label + " Common Mode vs BX"; + m_cmvsbxrun.push_back(m_rhm.makeTProfile(hname.c_str(),htitle.c_str(),3565,-0.5,3565-0.5)); + } + { + std::string hname = label + "_CMvsOrbit"; + std::string htitle = label + " Common Mode vs Orbit"; + m_cmvsorbitrun.push_back(m_rhm.makeTProfile(hname.c_str(),htitle.c_str(),4*500,0,500*262144)); + } + } + +} + + +CommonModeAnalyzer::~CommonModeAnalyzer() +{ + + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) + + + + +} + + +// +// member functions +// + +// ------------ method called to for each event ------------ +void +CommonModeAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + + updateDetCabling( iSetup ); + + m_nevents++; + + edm::Handle he; + iEvent.getByToken(m_historyProductToken,he); + + edm::Handle apvphase; + iEvent.getByToken(m_apvphasecollToken,apvphase); + + Handle badmodules; + iEvent.getByToken(m_digibadmodulecollectionToken,badmodules); + + int thephase = APVCyclePhaseCollection::invalid; + if(apvphase.isValid() && !apvphase.failedToGet()) { + thephase = apvphase->getPhase(m_phasepart); + } + bool isphaseok = (thephase!=APVCyclePhaseCollection::invalid && + thephase!=APVCyclePhaseCollection::multiphase && + thephase!=APVCyclePhaseCollection::nopartition); + + Handle > digis; + iEvent.getByToken(m_digicollectionToken,digis); + + // loop on detector with digis + + std::vector nmodules(m_selections.size(),0); + std::vector napvs(m_selections.size(),0); + + for(edm::DetSetVector::const_iterator mod = digis->begin();mod!=digis->end();mod++) { + + std::vector conns = m_detCabling->getConnections(mod->detId()); + + if(!m_ignorebadfedmod || std::find(badmodules->begin(),badmodules->end(),mod->detId())==badmodules->end()) { + for(unsigned int isel=0;isel< m_selections.size(); ++isel) { + if(m_selections[isel].isSelected(mod->detId())) { + unsigned int strip = 0; + ++nmodules[isel]; + for(edm::DetSet::const_iterator digi=mod->begin();digi!=mod->end();digi++,strip++) { + LogDebug("StripNumber") << "Strip number " << strip; + if(!m_ignorenotconnected || + ((conns.size() > strip/2) && conns[strip/2] && conns[strip/2]->isConnected())) { + ++napvs[isel]; + m_cmdist[isel]->Fill(digi->adc()); + if(isphaseok) m_cmvsdbxincycle[isel]->Fill(he->deltaBXinCycle(thephase),digi->adc()); + if(m_cmvsbxrun[isel] && *(m_cmvsbxrun[isel])) (*(m_cmvsbxrun[isel]))->Fill(iEvent.bunchCrossing(),digi->adc()); + if(m_cmvsorbitrun[isel] && *(m_cmvsorbitrun[isel])) (*(m_cmvsorbitrun[isel]))->Fill(iEvent.orbitNumber(),digi->adc()); + } + else if(digi->adc()>0) { + edm::LogWarning("NonZeroCMWhenDisconnected") << " Non zero CM in " + << mod->detId() << " APV " << strip + << " with " << conns.size() + << " connections and connection pointer" << conns[strip/2]; + } + } + } + } + } + } + for(unsigned int isel=0;isel < m_selections.size(); ++isel) { + m_nmodules[isel]->Fill(nmodules[isel]); + m_napvs[isel]->Fill(napvs[isel]); + } +} + +void +CommonModeAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup&) +{ + + + m_rhm.beginRun(iRun); + + for(std::vector::const_iterator cmvsbx=m_cmvsbxrun.begin();cmvsbx!=m_cmvsbxrun.end();++cmvsbx) { + if(*cmvsbx && *(*cmvsbx)) { + (*(*cmvsbx))->GetXaxis()->SetTitle("BX"); (*(*cmvsbx))->GetYaxis()->SetTitle("CM (ADC counts)"); + } + } + for(std::vector::const_iterator cmvsorbit=m_cmvsorbitrun.begin();cmvsorbit!=m_cmvsorbitrun.end();++cmvsorbit) { + if(*cmvsorbit && *(*cmvsorbit)) { + (*(*cmvsorbit))->GetXaxis()->SetTitle("orbit"); (*(*cmvsorbit))->GetYaxis()->SetTitle("CM (ADC counts)"); + (*(*cmvsorbit))->SetCanExtend(TH1::kXaxis); + } + } + +} + +void +CommonModeAnalyzer::endRun(const edm::Run& iRun, const edm::EventSetup&) +{ +} + + +// ------------ method called once each job just before starting event loop ------------ +void +CommonModeAnalyzer::beginJob() +{ + +} + +// ------------ method called once each job just after ending the event loop ------------ +void +CommonModeAnalyzer::endJob() { + + edm::LogInfo("EndOfJob") << m_nevents << " analyzed events"; + +} +void CommonModeAnalyzer::updateDetCabling( const edm::EventSetup& setup ) +{ + uint32_t cache_id = setup.get().cacheIdentifier();//.get( cabling_ ); + + if ( m_cacheIdDet != cache_id ) { // If the cache ID has changed since the last update... + // Update the cabling object + edm::ESHandle c; + setup.get().get( c ); + m_detCabling = c.product(); + m_cacheIdDet = cache_id; + } // end of new cache ID check +} + + + +//define this as a plug-in +DEFINE_FWK_MODULE(CommonModeAnalyzer); diff --git a/DPGAnalysis/SiStripTools/python/commonmodeanalyzer_cfi.py b/DPGAnalysis/SiStripTools/python/commonmodeanalyzer_cfi.py new file mode 100644 index 0000000000000..027fe3353fc94 --- /dev/null +++ b/DPGAnalysis/SiStripTools/python/commonmodeanalyzer_cfi.py @@ -0,0 +1,17 @@ +import FWCore.ParameterSet.Config as cms + +commonmodeanalyzer = cms.EDAnalyzer('CommonModeAnalyzer', + digiCollection = cms.InputTag("siStripDigis","CommonMode"), + badModuleDigiCollection = cms.InputTag("siStripDigis"), + historyProduct = cms.InputTag("consecutiveHEs"), + apvPhaseCollection = cms.InputTag("APVPhases"), + phasePartition = cms.untracked.string("All"), + ignoreBadFEDMod = cms.bool(True), + ignoreNotConnected = cms.bool(True), + selections = cms.VPSet( + cms.PSet(label=cms.string("TIB"),selection=cms.untracked.vstring("0x1e000000-0x16000000")), + cms.PSet(label=cms.string("TEC"),selection=cms.untracked.vstring("0x1e000000-0x1c000000")), + cms.PSet(label=cms.string("TOB"),selection=cms.untracked.vstring("0x1e000000-0x1a000000")), + cms.PSet(label=cms.string("TID"),selection=cms.untracked.vstring("0x1e000000-0x18000000")) + ) + ) diff --git a/DPGAnalysis/SiStripTools/test/commonmodeanalyzer_cfg.py b/DPGAnalysis/SiStripTools/test/commonmodeanalyzer_cfg.py new file mode 100644 index 0000000000000..3ee5d90d34737 --- /dev/null +++ b/DPGAnalysis/SiStripTools/test/commonmodeanalyzer_cfg.py @@ -0,0 +1,101 @@ +import FWCore.ParameterSet.Config as cms +import FWCore.ParameterSet.VarParsing as VarParsing + +process = cms.Process("CommonModeAnalyzer") + +#prepare options + +options = VarParsing.VarParsing("analysis") + +options.register ('globalTag', + "DONOTEXIST", + VarParsing.VarParsing.multiplicity.singleton, # singleton or list + VarParsing.VarParsing.varType.string, # string, int, or float + "GlobalTag") + +options.parseArguments() + +# + +process.options = cms.untracked.PSet( + wantSummary = cms.untracked.bool(True), + fileMode = cms.untracked.string("FULLMERGE") + ) + +process.load("FWCore.MessageService.MessageLogger_cfi") + +process.MessageLogger.cout.placeholder = cms.untracked.bool(False) +process.MessageLogger.cout.threshold = cms.untracked.string("INFO") +process.MessageLogger.cout.default = cms.untracked.PSet( + limit = cms.untracked.int32(10000000) + ) +process.MessageLogger.cout.FwkReport = cms.untracked.PSet( + reportEvery = cms.untracked.int32(10000) + ) + +process.MessageLogger.cerr.placeholder = cms.untracked.bool(False) +process.MessageLogger.cerr.threshold = cms.untracked.string("WARNING") +process.MessageLogger.cerr.default = cms.untracked.PSet( + limit = cms.untracked.int32(10000000) + ) +process.MessageLogger.cerr.FwkReport = cms.untracked.PSet( + reportEvery = cms.untracked.int32(100000) + ) + +process.MessageLogger.debugModules=cms.untracked.vstring("commonmodeanalyzer") +#------------------------------------------------------------------ + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) ) + +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring(options.inputFiles), +# skipBadFiles = cms.untracked.bool(True), + inputCommands = cms.untracked.vstring("keep *", "drop *_MEtoEDMConverter_*_*") + ) + +#-------------------------------------- +process.load("Configuration.StandardSequences.RawToDigi_Data_cff") +process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.GeometryRecoDB_cff") +process.load("Configuration.StandardSequences.Reconstruction_cff") + +process.froml1abcHEs = cms.EDProducer("EventWithHistoryProducerFromL1ABC", + l1ABCCollection=cms.InputTag("scalersRawToDigi") + ) +process.load("DPGAnalysis.SiStripTools.apvcyclephaseproducerfroml1tsDB_cfi") +process.load("DPGAnalysis.SiStripTools.eventtimedistribution_cfi") +process.eventtimedistribution.historyProduct = cms.InputTag("froml1abcHEs") + +process.seqEventHistoryReco = cms.Sequence(process.froml1abcHEs + process.APVPhases) +process.seqEventHistory = cms.Sequence(process.eventtimedistribution) + +process.seqProducers = cms.Sequence(process.seqEventHistoryReco) + +process.load("DPGAnalysis.SiStripTools.commonmodeanalyzer_cfi") +process.commonmodeanalyzer.historyProduct = cms.InputTag("froml1abcHEs") +process.commonmodenoignorebadfedmod = process.commonmodeanalyzer.clone(ignoreBadFEDMod=False) +process.commonmodenoignore = process.commonmodenoignorebadfedmod.clone(ignoreNotConnected=False) + +process.siStripDigis.UnpackCommonModeValues=cms.bool(True) + +process.p0 = cms.Path( + process.siStripDigis + process.siStripZeroSuppression + + process.scalersRawToDigi + + process.seqProducers + + process.seqEventHistory + + process.commonmodeanalyzer + + process.commonmodenoignorebadfedmod + + process.commonmodenoignore + ) + +#----GlobalTag ------------------------ + +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, options.globalTag, '') + +process.TFileService = cms.Service('TFileService', + fileName = cms.string('CommonModeAnalyzer.root') + ) + +print process.dumpPython() From ba737bc5327e242505c20b2522b95ffb212e3180 Mon Sep 17 00:00:00 2001 From: venturia Date: Sun, 31 Jul 2016 11:51:21 +0200 Subject: [PATCH 3/7] Description of the CommonModeAnalyzer code --- DPGAnalysis/SiStripTools/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/DPGAnalysis/SiStripTools/README.md b/DPGAnalysis/SiStripTools/README.md index 1e4b638074c90..244320a32aca8 100644 --- a/DPGAnalysis/SiStripTools/README.md +++ b/DPGAnalysis/SiStripTools/README.md @@ -5,6 +5,10 @@ It is an `EDAnalyzer` which can be used to monitor the content of the `Level1Tri ### APVCyclePhaseProducerFromL1TS It is an `EDProducer` which produces an `APVCyclePhaseCollection` which contains, for each Tracker partition, an offset, between 0 and 69, to be used to compute the position of each event in the Tracker APV readout cycle from the orbit number and the bunch crossing number using `orbit*3564+bx-offset`. More details can be found [in this page](https://twiki.cern.ch/twiki/bin/view/CMS/APVReadoutCycle). The standard way of using it is to let the EventSetup provide the parameters using the record `SiStripConfObject` with the label `apvphaseoffsets` (configurable). If the configuration parameter `ignoreDB` is set to true, then the parameters are read from the configuration file and are: `defaultPartitionNames` usually equal to `TI,TO,TP,TM`, `defaultPhases` which contains a vector (one value per partition) of offsets which are used as offset when no resync has been issued, `magicOffset` which is used to correct the orbit number of the last resync to compute the phase when a resync has been issued using the expression: `(defaultPhase + (lastresyncorbit+magicOffset)*3564%70)%70`, and `useEC0` if we want to use `lastEC0orbit` instead of `lastresyncorbit` to compute the phase. Examples of configurations can be found in the `python` directory. +### CommonModeAnalyzer +It is an `EDAnalyzer` that produces histograms of the common mode values provided by the FEDs and by the Strip unpacker. The user can define one or more subset of modules whose common mode values have to be analyzed. The definition of these subsets is done with the configuration parameter `selections` and the syntax used for the `DetIdSelector` class has to be used for the parameter `selection` while the parameter `label` is used to define the labels used in the histogram names and titles associated to that selection. The boolean parameters `ignoreFEDBadMod` and `ignoreNotConnected` can be used to configure the analyzer to ignore the modules which are declared as bad by the unpacker and the channels which are not connected, respectively: setting both parameters as `True` removes all the common mode values at zero and it help to identify genunely low common mode values. The parameter `digiCollection` is used to define the name of the common mode collection and the parameter `badModuleDigiCollection` is used to define the name of the collection of bad modules produced by the unpacker. The parameter `historyProduct` defines the name of the collection of `EventWithHistory` objects, the parameter `apvPhaseCollection` defines the collection of APV phases offsets and the parameter `phasePartition` defines the partition whose APV phase has to be considered: using `All` means that the phases of the four partitions have to agree. These parameters are needed because one of the histogram which is produced is the average common mode value as a function of the distance of the events from the start of the APV cycle after the previous L1A and, therefore, the distance from the previous L1A is needed, using `EventWithHistory` and the APV cycle phase is needed. The other histograms which are produced are: the distribution of the common mode values in all the events and in all the channels belonging to one of the selections, the average common mode value as a function of the orbit number (time evolution), the average common mode values as a function of the BX number. +An example of configuration can be found in `python/commonmodeanalyzer_cfi.py`. The file `test/commonmodeanalyzer_cfg.py` is an example of a full configuration. + ### ...MultiplicityProducer There are three specializations of the `EDProducer` `plugins/MultiplicityProducer.cc` template: `SiStripMultiplicityProducer`, `SiPixelMultiplicityProducer`, `SiStripDigiMultiplicityProducer`. This plugin produce simple objects which contain the numbers of strip/pixel clusters or strip digis in subsets of the detector in a given event. Examples of configurations can be found in: @@ -33,6 +37,7 @@ It produces histograms to correlate the multiplicities obtained from `Multiplici * `test/apvphaseproducertest_cfg.py` to study the correlation of the strip multiplicities with the APV cycle and determine if the knowledge of the APV cycle phase offsets is still under control * `test/bsvsbpix_cfg.py`to correlate the beamspot position with the average position of the BPIX ladders. It requires the macros described below to show its results. * `test/OccupancyPlotsTest_cfg.py` to measure the hit occupancy and multiplicity in the different detector region (rZ view). It requires the macros described below to show its results. +* `test/commonmodeanalyzer_cfg.py` to monitor the common mode values in different detector parts. It requires the parameter `globalTag` in the command line. ## ROOT Macros This package contains a library of ROOT macros that can be loaded by executing `gSystem->Load("libDPGAnalysisSiStripToolsMacros.so")` From 85cec37281b1cf97ec228f0dc7a4e1d589206e7e Mon Sep 17 00:00:00 2001 From: venturia Date: Sun, 31 Jul 2016 11:57:05 +0200 Subject: [PATCH 4/7] Update README.md --- DPGAnalysis/SiStripTools/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DPGAnalysis/SiStripTools/README.md b/DPGAnalysis/SiStripTools/README.md index 244320a32aca8..4356afd378204 100644 --- a/DPGAnalysis/SiStripTools/README.md +++ b/DPGAnalysis/SiStripTools/README.md @@ -6,7 +6,7 @@ It is an `EDAnalyzer` which can be used to monitor the content of the `Level1Tri It is an `EDProducer` which produces an `APVCyclePhaseCollection` which contains, for each Tracker partition, an offset, between 0 and 69, to be used to compute the position of each event in the Tracker APV readout cycle from the orbit number and the bunch crossing number using `orbit*3564+bx-offset`. More details can be found [in this page](https://twiki.cern.ch/twiki/bin/view/CMS/APVReadoutCycle). The standard way of using it is to let the EventSetup provide the parameters using the record `SiStripConfObject` with the label `apvphaseoffsets` (configurable). If the configuration parameter `ignoreDB` is set to true, then the parameters are read from the configuration file and are: `defaultPartitionNames` usually equal to `TI,TO,TP,TM`, `defaultPhases` which contains a vector (one value per partition) of offsets which are used as offset when no resync has been issued, `magicOffset` which is used to correct the orbit number of the last resync to compute the phase when a resync has been issued using the expression: `(defaultPhase + (lastresyncorbit+magicOffset)*3564%70)%70`, and `useEC0` if we want to use `lastEC0orbit` instead of `lastresyncorbit` to compute the phase. Examples of configurations can be found in the `python` directory. ### CommonModeAnalyzer -It is an `EDAnalyzer` that produces histograms of the common mode values provided by the FEDs and by the Strip unpacker. The user can define one or more subset of modules whose common mode values have to be analyzed. The definition of these subsets is done with the configuration parameter `selections` and the syntax used for the `DetIdSelector` class has to be used for the parameter `selection` while the parameter `label` is used to define the labels used in the histogram names and titles associated to that selection. The boolean parameters `ignoreFEDBadMod` and `ignoreNotConnected` can be used to configure the analyzer to ignore the modules which are declared as bad by the unpacker and the channels which are not connected, respectively: setting both parameters as `True` removes all the common mode values at zero and it help to identify genunely low common mode values. The parameter `digiCollection` is used to define the name of the common mode collection and the parameter `badModuleDigiCollection` is used to define the name of the collection of bad modules produced by the unpacker. The parameter `historyProduct` defines the name of the collection of `EventWithHistory` objects, the parameter `apvPhaseCollection` defines the collection of APV phases offsets and the parameter `phasePartition` defines the partition whose APV phase has to be considered: using `All` means that the phases of the four partitions have to agree. These parameters are needed because one of the histogram which is produced is the average common mode value as a function of the distance of the events from the start of the APV cycle after the previous L1A and, therefore, the distance from the previous L1A is needed, using `EventWithHistory` and the APV cycle phase is needed. The other histograms which are produced are: the distribution of the common mode values in all the events and in all the channels belonging to one of the selections, the average common mode value as a function of the orbit number (time evolution), the average common mode values as a function of the BX number. +It is an `EDAnalyzer` that produces histograms of the common mode values provided by the FEDs and by the Strip unpacker. The user can define one or more subset of modules whose common mode values have to be analyzed. The definition of these subsets is done with the configuration parameter `selections` and the syntax used for the `DetIdSelector` class has to be used for the parameter `selection` while the parameter `label` is used to define the labels used in the histogram names and titles associated to that selection. The boolean parameters `ignoreFEDBadMod` and `ignoreNotConnected` can be used to configure the analyzer to ignore the modules which are declared as bad by the unpacker and the channels which are not connected, respectively: setting both parameters as `True` removes all the common mode values at zero and it help to identify genunely low common mode values. The parameter `digiCollection` is used to define the name of the common mode collection and the parameter `badModuleDigiCollection` is used to define the name of the collection of bad modules produced by the unpacker. The parameter `historyProduct` defines the name of the collection of `EventWithHistory` objects, the parameter `apvPhaseCollection` defines the collection of APV phases offsets and the parameter `phasePartition` defines the partition whose APV phase has to be considered: using `All` means that the phases of the four partitions have to agree. These parameters are needed because one of the histogram which is produced is the average common mode value as a function of the distance of the events from the start of the APV cycle after the previous L1A and, therefore, the distance from the previous L1A is needed, using `EventWithHistory` and the APV cycle phase is needed. The other histograms which are produced are: the distribution of the common mode values in all the events and in all the channels belonging to one of the selections, the average common mode value as a function of the orbit number (time evolution), the average common mode values as a function of the BX number, the distribution of the number of modules and APVs whose common mode values have been monitored per event. An example of configuration can be found in `python/commonmodeanalyzer_cfi.py`. The file `test/commonmodeanalyzer_cfg.py` is an example of a full configuration. ### ...MultiplicityProducer From 2704f90e58bbd6f8e5baba7b0d85d8f97d3538d7 Mon Sep 17 00:00:00 2001 From: venturia Date: Sun, 31 Jul 2016 12:01:12 +0200 Subject: [PATCH 5/7] Description of the TrendPlotSingleBin macro --- DPGAnalysis/SiStripTools/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/DPGAnalysis/SiStripTools/README.md b/DPGAnalysis/SiStripTools/README.md index 4356afd378204..73599971d83e4 100644 --- a/DPGAnalysis/SiStripTools/README.md +++ b/DPGAnalysis/SiStripTools/README.md @@ -97,6 +97,11 @@ As the macro `PlotOnTrackOccupancy` but for results obtained with the phase 1 ge ### PlotOnTrackOccupancyPhase2 As the macro `PlotOnTrackOccupancy` but for results obtained with the phase 2 geometry +### TrendPlotSingleBin +`TrendPlotSingleBin(TFile* ff, const char* module, const char* hname, const int bin)` + +It has to be used with the output root file of `OccupancyPlots` and it produces a trend plot of the average occupancy or cluster multiplicity as a function of the run number for a specific part of the detector defined by the bin `bin` in the configuration of the `OccupancyPlots` job. + ## Scripts ### merge_and_move_generic_fromCrab.sh Script which helps to merge root files produced by a crab2 job and saved in the `res` sudirectory of output crab directory. From ce926dc179838bb4ff39bb317f6db9896d6176f5 Mon Sep 17 00:00:00 2001 From: venturia Date: Sun, 31 Jul 2016 12:04:42 +0200 Subject: [PATCH 6/7] Update README.md --- DPGAnalysis/SiStripTools/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DPGAnalysis/SiStripTools/README.md b/DPGAnalysis/SiStripTools/README.md index 73599971d83e4..86a0e56c1faa2 100644 --- a/DPGAnalysis/SiStripTools/README.md +++ b/DPGAnalysis/SiStripTools/README.md @@ -41,8 +41,7 @@ It produces histograms to correlate the multiplicities obtained from `Multiplici ## ROOT Macros This package contains a library of ROOT macros that can be loaded by executing `gSystem->Load("libDPGAnalysisSiStripToolsMacros.so")` -in the root interactive section, followed by -`#include "DPGAnalysis/SiStripTools/bin/DPGAnalysisSiStripToolsMacrosLinkDef.h"` in case Root 6 is used. +in the root interactive section. In case Root 6 is used the autocompletion of the macro names using the TAB is available only after a macro is executed. ### BSvsBPIXPlot `BSvsBPIXPlot(TFile* ff, const char* bsmodule, const char* occumodule, const int run)` From 919fe90ef50a687f76093a438e0829d1e91173f7 Mon Sep 17 00:00:00 2001 From: venturia Date: Sun, 31 Jul 2016 12:19:44 +0200 Subject: [PATCH 7/7] added a comment in a line --- DPGAnalysis/SiStripTools/test/commonmodeanalyzer_cfg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DPGAnalysis/SiStripTools/test/commonmodeanalyzer_cfg.py b/DPGAnalysis/SiStripTools/test/commonmodeanalyzer_cfg.py index 3ee5d90d34737..c6a9a86705881 100644 --- a/DPGAnalysis/SiStripTools/test/commonmodeanalyzer_cfg.py +++ b/DPGAnalysis/SiStripTools/test/commonmodeanalyzer_cfg.py @@ -98,4 +98,4 @@ fileName = cms.string('CommonModeAnalyzer.root') ) -print process.dumpPython() +#print process.dumpPython()