Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ class CTPPSDiamondDQMSource : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<
/// Number of OOT indices monitored
static constexpr unsigned int FIRST_RUN_W_PIXELS = 300000;

bool perLSsaving_; //to avoid nanoDQMIO crashing, driven by DQMServices/Core/python/DQMStore_cfi.py

/// plots related to the whole system
struct GlobalPlots {
GlobalPlots() = default;
Expand Down Expand Up @@ -167,7 +169,12 @@ class CTPPSDiamondDQMSource : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<
// MonitorElement* trackTimeVsXAngleProfile = nullptr;

PotPlots() = default;
PotPlots(DQMStore::IBooker& ibooker, unsigned int id, unsigned int windowsNum, bool plotOnline, bool plotOffline);
PotPlots(DQMStore::IBooker& ibooker,
unsigned int id,
unsigned int windowsNum,
bool plotOnline,
bool plotOffline,
bool perLSsaving);
};
/// plots related to one Diamond plane
struct PlanePlots {
Expand Down Expand Up @@ -217,7 +224,6 @@ class CTPPSDiamondDQMSource : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<
// edm::ESGetToken<LHCInfo, LHCInfoRcd> ctppsLhcInfoToken_;

bool excludeMultipleHits_;
bool perLSsaving_; //to avoid nanoDQMIO crashing, driven by DQMServices/Core/python/DQMStore_cfi.py
const bool extract_digi_info_;
struct DiamondShifts {
double global, withPixels;
Expand Down Expand Up @@ -273,8 +279,12 @@ CTPPSDiamondDQMSource::SectorPlots::SectorPlots(DQMStore::IBooker& ibooker, unsi
}

//----------------------------------------------------------------------------------------------------
CTPPSDiamondDQMSource::PotPlots::PotPlots(
DQMStore::IBooker& ibooker, unsigned int id, unsigned int windowsNum, bool plotOnline, bool plotOffline)
CTPPSDiamondDQMSource::PotPlots::PotPlots(DQMStore::IBooker& ibooker,
unsigned int id,
unsigned int windowsNum,
bool plotOnline,
bool plotOffline,
bool perLSsaving)
: HitCounter(0),
MHCounter(0),
LeadingOnlyCounter(0),
Expand Down Expand Up @@ -328,7 +338,7 @@ CTPPSDiamondDQMSource::PotPlots::PotPlots(
13);
}

if (plotOffline) {
if (plotOffline && !perLSsaving) {
ibooker.setCurrentFolder(path + "/timing_profiles");
// TOTVsLS=ibooker.book2D("ToT vs LS",title +" ToT vs LS;LS;ToT(ns)",4000,0,4000, 200,5,25);
// trackTimeVsLS=ibooker.book2D("track time vs LS",title+" track time vs LS;LS;track_time(ns)",4000,0,4000, 500, -25, 25);
Expand Down Expand Up @@ -576,7 +586,8 @@ CTPPSDiamondDQMSource::ChannelPlots::ChannelPlots(DQMStore::IBooker& ibooker, un
//----------------------------------------------------------------------------------------------------

CTPPSDiamondDQMSource::CTPPSDiamondDQMSource(const edm::ParameterSet& ps)
: tokenPixelTrack_(
: perLSsaving_(ps.getUntrackedParameter<bool>("perLSsaving", false)),
tokenPixelTrack_(
consumes<edm::DetSetVector<CTPPSPixelLocalTrack>>(ps.getParameter<edm::InputTag>("tagPixelLocalTracks"))),
tokenDiamondHit_(
consumes<edm::DetSetVector<CTPPSDiamondRecHit>>(ps.getParameter<edm::InputTag>("tagDiamondRecHits"))),
Expand All @@ -586,7 +597,6 @@ CTPPSDiamondDQMSource::CTPPSDiamondDQMSource(const edm::ParameterSet& ps)
ctppsGeometryEventToken_(esConsumes<CTPPSGeometry, VeryForwardRealGeometryRecord>()),
// ctppsLhcInfoToken_(esConsumes<LHCInfo, LHCInfoRcd>()),
excludeMultipleHits_(ps.getParameter<bool>("excludeMultipleHits")),
perLSsaving_(ps.getUntrackedParameter<bool>("perLSsaving", false)),
extract_digi_info_(ps.getParameter<bool>("extractDigiInfo")),
centralOOT_(-999),
verbosity_(ps.getUntrackedParameter<unsigned int>("verbosity", 0)),
Expand Down Expand Up @@ -660,7 +670,7 @@ void CTPPSDiamondDQMSource::bookHistograms(DQMStore::IBooker& ibooker, const edm
// per-pot plots
const CTPPSDiamondDetId rpId(chId.rpId());
if (potPlots_.count(rpId) == 0)
potPlots_[rpId] = PotPlots(ibooker, rpId, windowsNum_, plotOnline_, plotOffline_);
potPlots_[rpId] = PotPlots(ibooker, rpId, windowsNum_, plotOnline_, plotOffline_, perLSsaving_);

// per-sector plots
const CTPPSDiamondDetId secId(chId.armId());
Expand Down Expand Up @@ -969,7 +979,7 @@ void CTPPSDiamondDQMSource::analyze(const edm::Event& event, const edm::EventSet
for (int i = 0; i < numOfBins; ++i)
trackHistoInTimeTmp->Fill(trackHistoInTimeTmp->GetBinCenter(startBin + i));
}
if (plotOffline_) {
if (plotOffline_ && !perLSsaving_) {
// potPlots_[detId_pot].trackTimeVsLS->Fill(event.luminosityBlock(),track.time());
potPlots_[detId_pot].trackTimeVsBX->Fill(event.bunchCrossing(), track.time());
//potPlots_[detId_pot].trackTimeVsXAngle->Fill(hLhcInfo->crossingAngle(), track.time());
Expand Down Expand Up @@ -1360,7 +1370,7 @@ void CTPPSDiamondDQMSource::checkEventNumber(const CTPPSDiamondDetId& detId,
//----------------------------------------------------------------------------------------------------

void CTPPSDiamondDQMSource::dqmEndRun(edm::Run const&, edm::EventSetup const&) {
if (plotOffline_)
if (plotOffline_ && !perLSsaving_)
for (const auto& rpPlots : potPlots_) {
auto plots = rpPlots.second;
// *(plots.TOTVsLSProfile->getTProfile())=*plots.TOTVsLS->getTH2F()->ProfileX();
Expand Down
2 changes: 2 additions & 0 deletions DQM/CTPPS/python/ctppsDQM_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
dqmPerLSsaving.toModify(ctppsDiamondDQMSource, perLSsaving=True)
dqmPerLSsaving.toModify(diamondSampicDQMSourceOffline, perLSsaving=True)
dqmPerLSsaving.toModify(ctppsCommonDQMSourceOffline, perLSsaving=True)
dqmPerLSsaving.toModify(ctppsDiamondDQMOfflineSource, perLSsaving=True)
dqmPerLSsaving.toModify(totemTimingDQMSource, perLSsaving=True)

_ctppsDQMOfflineSource = cms.Sequence(
ctppsPixelDQMOfflineSource
Expand Down
2 changes: 2 additions & 0 deletions DQM/CTPPS/python/diamondSampicDQMSource_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

samplesForNoise = cms.untracked.uint32(6),

perLSsaving = cms.untracked.bool(False), #driven by DQMServices/Core/python/DQMStore_cfi.py

verbosity = cms.untracked.uint32(10),
plotOnline=cms.untracked.bool(False)
)
50 changes: 48 additions & 2 deletions DQMServices/Core/python/nanoDQMIO_perLSoutput_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,54 @@
MEsToSave = cms.untracked.vstring(*( #Using tuple to avoid python limit of 255 arguments
#as suggested in:
#https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuidePoolInputSources#Example_3_More_than_255_input_fi
'Muons/MuonRecoAnalyzer/', #Folder and its subfolders
'Muons/MuonIdDQM/GlobalMuons/hDT1Pullx' #particular ME

#Examples:
#'Muons/MuonRecoAnalyzer/', #Folder and its subfolders
#'Muons/MuonIdDQM/GlobalMuons/hDT1Pullx' #particular ME

#Version 0.1 for nanoDQMIO in CMSSW_12_1_0 ReReco of Pilot Test Runs taken in Autumn 2021
#DT
'DT/02-Segments/03-MeanT0/T0MeanAllWheels',

#ECAL
'EcalBarrel/EBOccupancyTask/EBOT digi occupancy',
'EcalEndcap/EEOccupancyTask/EEOT digi occupancy EE -',
'EcalEndcap/EEOccupancyTask/EEOT digi occupancy EE +',

#Muon POG
'Muons/MuonRecoAnalyzer/',
'Muons/MuonIdDQM/GlobalMuons/',

#Tracker/Tracking
#PixelPhase1
'PixelPhase1/Phase1_MechanicalView/',
'PixelPhase1/Tracks/',

#SiStrip
'SiStrip/MechanicalView/',

#Tracking histograms:
'Tracking/PrimaryVertices/highPurityTracks/pt_0to1/offline/',
'Tracking/TrackParameters/generalTracks/LSanalysis/',
'Tracking/TrackParameters/highPurityTracks/pt_1/LSanalysis/',
'Tracking/TrackParameters/highPurityTracks/pt_0to1/LSanalysis/',
'Tracking/TrackParameters/highPurityTracks/dzPV0p1/LSanalysis/',
'Tracking/TrackParameters/generalTracks/GeneralProperties/',
'Tracking/TrackParameters/highPurityTracks/pt_1/GeneralProperties/',
'Tracking/TrackParameters/highPurityTracks/pt_0to1/GeneralProperties/',
'Tracking/TrackParameters/highPurityTracks/dzPV0p1/GeneralProperties/',
'Tracking/TrackParameters/generalTracks/HitProperties/',
'Tracking/TrackParameters/highPurityTracks/pt_1/HitProperties/',
'Tracking/TrackParameters/highPurityTracks/pt_0to1/HitProperties/',
'Tracking/TrackParameters/highPurityTracks/dzPV0p1/HitProperties/',
'Tracking/TrackParameters/generalTracks/HitProperties/Pixel/',
'Tracking/TrackParameters/highPurityTracks/pt_1/HitProperties/Pixel/',
'Tracking/TrackParameters/highPurityTracks/pt_0to1/HitProperties/Pixel/',
'Tracking/TrackParameters/highPurityTracks/dzPV0p1/HitProperties/Pixel/',
'Tracking/TrackParameters/generalTracks/HitProperties/Strip/',
'Tracking/TrackParameters/highPurityTracks/pt_1/HitProperties/Strip/',
'Tracking/TrackParameters/highPurityTracks/pt_0to1/HitProperties/Strip/',
'Tracking/TrackParameters/highPurityTracks/dzPV0p1/HitProperties/Strip/'
)
)
)