Skip to content

Commit

Permalink
add to the pixeOnly dqm and harvesting step
Browse files Browse the repository at this point in the history
address review comments

add plot for ntracks associated

simplify ntracks
  • Loading branch information
sroychow committed Nov 19, 2021
1 parent 99d0671 commit fb564ba
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ class SiPixelPhase1MonitorTrackSoA : public DQMEDAnalyzer {
private:
edm::EDGetTokenT<PixelTrackHeterogeneous> tokenSoATrack_;
std::string topFolderName_;
bool useQualityCut_;
pixelTrack::Quality minQuality_;
MonitorElement* hnTracks;
MonitorElement* hnHits;
MonitorElement* hchi2;
MonitorElement* hpt;
MonitorElement* heta;
MonitorElement* hphi;
MonitorElement* hz;
MonitorElement* htip;
};

//
Expand All @@ -50,20 +53,21 @@ class SiPixelPhase1MonitorTrackSoA : public DQMEDAnalyzer {
SiPixelPhase1MonitorTrackSoA::SiPixelPhase1MonitorTrackSoA(const edm::ParameterSet& iConfig) {
tokenSoATrack_ = consumes<PixelTrackHeterogeneous>(iConfig.getParameter<edm::InputTag>("pixelTrackSrc"));
topFolderName_ = iConfig.getParameter<std::string>("TopFolderName"); //"SiPixelHeterogeneous/PixelTrackSoA";
useQualityCut_ = iConfig.getParameter<bool>("useQualityCut");
minQuality_ = pixelTrack::qualityByName(iConfig.getParameter<std::string>("minQuality"));
}

SiPixelPhase1MonitorTrackSoA::~SiPixelPhase1MonitorTrackSoA() {
// do anything here that needs to be done at desctruction time
// (e.g. close files, deallocate resources etc.)
edm::LogInfo("SiPixelPhase1MonitorTrackSoA") << ">>> Destroy SiPixelPhase1MonitorTrackSoA ";
}

// -- Analyze
//
void SiPixelPhase1MonitorTrackSoA::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
auto const& tsoa = *iEvent.get(tokenSoATrack_);
auto maxTracks = tsoa.stride();

auto const* quality = tsoa.qualityData();
int32_t nTracks = 0;
for (int32_t it = 0; it < maxTracks; ++it) {
auto nHits = tsoa.nHits(it);
Expand All @@ -72,16 +76,20 @@ void SiPixelPhase1MonitorTrackSoA::analyze(const edm::Event& iEvent, const edm::
float pt = tsoa.pt(it);
if (!(pt > 0.))
continue;
if (useQualityCut_ && quality[it] < minQuality_)
continue;
float chi2 = tsoa.chi2(it);
float phi = tsoa.phi(it);
float zip = tsoa.zip(it);
float eta = tsoa.eta(it);
float tip = tsoa.tip(it);
hchi2->Fill(chi2);
hnHits->Fill(nHits);
hpt->Fill(pt);
heta->Fill(eta);
hphi->Fill(phi);
hz->Fill(zip);
htip->Fill(tip);
nTracks++;
}
hnTracks->Fill(nTracks);
Expand All @@ -93,7 +101,6 @@ void SiPixelPhase1MonitorTrackSoA::analyze(const edm::Event& iEvent, const edm::
void SiPixelPhase1MonitorTrackSoA::bookHistograms(DQMStore::IBooker& ibooker,
edm::Run const& iRun,
edm::EventSetup const& iSetup) {
//std::string top_folder = ""//
ibooker.cd();
ibooker.setCurrentFolder(topFolderName_);
hnTracks = ibooker.book1D("nTracks", ";Number of tracks per event;#entries", 1001, -0.5, 1000.5);
Expand All @@ -103,15 +110,16 @@ void SiPixelPhase1MonitorTrackSoA::bookHistograms(DQMStore::IBooker& ibooker,
heta = ibooker.book1D("eta", ";Track #eta;#entries", 30, -3., 3.);
hphi = ibooker.book1D("phi", ";Track #phi;#entries", 30, -M_PI, M_PI);
hz = ibooker.book1D("z", ";Track z;#entries", 30, -30., 30.);
htip = ibooker.book1D("tip", "", 100, -0.5, 0.5);
}

void SiPixelPhase1MonitorTrackSoA::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
// monitorpixelTrackSoA
edm::ParameterSetDescription desc;
desc.add<edm::InputTag>("pixelTrackSrc", edm::InputTag("pixelTracksSoA"));
desc.add<std::string>("TopFolderName", "SiPixelHeterogeneous/PixelTrackSoA");
descriptions.add("monitorpixelTrackSoA", desc);
// or use the following to generate the label from the module's C++ type
//descriptions.addWithDefaultLabel(desc);
desc.add<bool>("useQualityCut", false);
desc.add<std::string>("minQuality", "loose");
descriptions.addWithDefaultLabel(desc);
}
DEFINE_FWK_MODULE(SiPixelPhase1MonitorTrackSoA);
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

class SiPixelPhase1MonitorVertexSoA : public DQMEDAnalyzer {
public:
using IndToEdm = std::vector<uint16_t>;
explicit SiPixelPhase1MonitorVertexSoA(const edm::ParameterSet&);
~SiPixelPhase1MonitorVertexSoA() override;
void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override;
Expand All @@ -42,6 +43,7 @@ class SiPixelPhase1MonitorVertexSoA : public DQMEDAnalyzer {
MonitorElement* hz;
MonitorElement* hchi2;
MonitorElement* hptv2;
MonitorElement* hntrks;
};

//
Expand All @@ -57,7 +59,6 @@ SiPixelPhase1MonitorVertexSoA::SiPixelPhase1MonitorVertexSoA(const edm::Paramete
SiPixelPhase1MonitorVertexSoA::~SiPixelPhase1MonitorVertexSoA() {
// do anything here that needs to be done at desctruction time
// (e.g. close files, deallocate resources etc.)
edm::LogInfo("SiPixelPhase1MonitorVertexSoA") << ">>> Destroy SiPixelPhase1MonitorVertexSoA ";
}

// -- Analyze
Expand All @@ -78,16 +79,18 @@ void SiPixelPhase1MonitorVertexSoA::analyze(const edm::Event& iEvent, const edm:
dydz = bs.dydz();
}
for (int iv = 0; iv < nVertices; iv++) {
auto z = vsoa.zv[iv];
auto si = vsoa.sortInd[iv];
auto z = vsoa.zv[si];
auto x = x0 + dxdz * z;
auto y = y0 + dydz * z;
z += z0;
hx->Fill(x);
hy->Fill(y);
hz->Fill(z);
if (vsoa.ndof[iv] != 0)
hchi2->Fill(vsoa.chi2[iv] / vsoa.ndof[iv]);
hptv2->Fill(vsoa.ptv2[iv]);
auto ndof = vsoa.ndof[si];
hchi2->Fill(vsoa.chi2[si] / ndof);
hptv2->Fill(vsoa.ptv2[si]);
hntrks->Fill(ndof + 1);
}
hnVertex->Fill(nVertices);
}
Expand All @@ -102,11 +105,12 @@ void SiPixelPhase1MonitorVertexSoA::bookHistograms(DQMStore::IBooker& ibooker,
ibooker.cd();
ibooker.setCurrentFolder(topFolderName_);
hnVertex = ibooker.book1D("nVertex", ";# of Vertex;#entries", 101, -0.5, 100.5);
hx = ibooker.book1D("vx", ";Vertez x;#entries", 30, -30., 30);
hy = ibooker.book1D("vy", ";Vertez y;#entries", 30, -30., 30);
hx = ibooker.book1D("vx", ";Vertez x;#entries", 10, -5., 5.);
hy = ibooker.book1D("vy", ";Vertez y;#entries", 10, -5., 5.);
hz = ibooker.book1D("vz", ";Vertez z;#entries", 30, -30., 30);
hchi2 = ibooker.book1D("chi2", ";Vertex chi-squared over ndof;#entries", 40, 0., 20.);
hchi2 = ibooker.book1D("chi2", ";Vertex chi-squared;#entries", 40, 0., 20.);
hptv2 = ibooker.book1D("ptsq", ";Vertex p_T squared;#entries", 200, 0., 200.);
hntrks = ibooker.book1D("ntrk", ";#tracks associated;#entries", 100, -0.5, 99.5);
}

void SiPixelPhase1MonitorVertexSoA::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
Expand All @@ -115,8 +119,6 @@ void SiPixelPhase1MonitorVertexSoA::fillDescriptions(edm::ConfigurationDescripti
desc.add<edm::InputTag>("pixelVertexSrc", edm::InputTag("pixelVerticesSoA"));
desc.add<edm::InputTag>("beamSpotSrc", edm::InputTag("offlineBeamSpot"));
desc.add<std::string>("TopFolderName", "SiPixelHeterogeneous/PixelVertexSoA");
descriptions.add("monitorpixelVertexSoA", desc);
// or use the following to generate the label from the module's C++ type
//descriptions.addWithDefaultLabel(desc);
descriptions.addWithDefaultLabel(desc);
}
DEFINE_FWK_MODULE(SiPixelPhase1MonitorVertexSoA);
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import FWCore.ParameterSet.Config as cms
from DQM.SiPixelPhase1Heterogeneous.monitorpixelTrackSoA_cfi import *
from DQM.SiPixelPhase1Heterogeneous.monitorpixelVertexSoA_cfi import *
from DQM.SiPixelPhase1Heterogeneous.siPixelPhase1MonitorTrackSoA_cfi import *
from DQM.SiPixelPhase1Heterogeneous.siPixelPhase1MonitorVertexSoA_cfi import *

monitorpixelSoASource = cms.Sequence(monitorpixelTrackSoA * monitorpixelVertexSoA)
monitorpixelSoASource = cms.Sequence(siPixelPhase1MonitorTrackSoA * siPixelPhase1MonitorVertexSoA)
4 changes: 3 additions & 1 deletion DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from DQMServices.Components.DQMFEDIntegrityClient_cff import *
from DQMOffline.L1Trigger.L1TriggerDqmOffline_cff import *
from DQM.SiTrackerPhase2.Phase2TrackerDQMHarvesting_cff import *
from DQM.SiPixelPhase1Heterogeneous.SiPixelPhase1HeterogenousDQMHarvesting_cff import *

DQMNone = cms.Sequence()

Expand Down Expand Up @@ -185,7 +186,8 @@
dqmFastTimerServiceClient )

DQMHarvestPixelTracking = cms.Sequence( pixelTrackingEffFromHitPattern *
pixelVertexResolutionClient )
pixelVertexResolutionClient *
siPixelPhase1HeterogenousDQMHarvesting )

DQMHarvestOuterTracker = cms.Sequence(
OuterTrackerClient *
Expand Down
4 changes: 3 additions & 1 deletion DQMOffline/Configuration/python/DQMOffline_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from DQM.CastorMonitor.castor_dqm_sourceclient_offline_cff import *
from DQM.CTPPS.ctppsDQM_cff import *
from DQM.SiTrackerPhase2.Phase2TrackerDQMFirstStep_cff import *
from DQM.SiPixelPhase1Heterogeneous.SiPixelPhase1HeterogenousDQM_FirstStep_cff import *

DQMNone = cms.Sequence()

Expand Down Expand Up @@ -164,7 +165,8 @@
from Validation.RecoTau.DQMSequences_cfi import *

DQMOfflinePixelTracking = cms.Sequence( pixelTracksMonitoring *
pixelPVMonitor )
pixelPVMonitor *
monitorpixelSoASource )

DQMOuterTracker = cms.Sequence( DQMOfflineDCS *
OuterTrackerSource *
Expand Down

0 comments on commit fb564ba

Please sign in to comment.