Skip to content

Commit

Permalink
Merge pull request #12416 from rrabadan/recHits_and_clsterch_TkMaps_80X
Browse files Browse the repository at this point in the history
missing-, inactive-, valid-hits and clusterChargePerCm trackerMaps
  • Loading branch information
cmsbuild committed Nov 16, 2015
2 parents d7738bb + fc78f7e commit f875c41
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# APV shots monitoring
SiStripMonitorDigi.TkHistoMapNApvShots_On = True
SiStripMonitorDigi.TkHistoMapNStripApvShots_On= True
SiStripMonitorDigi.TkHistoMapMedianChargeApvShots_On= True
SiStripMonitorDigi.TkHistoMapMedianChargeApvShots_On= False

SiStripMonitorDigi.TH1NApvShots.subdetswitchon = True
SiStripMonitorDigi.TH1NApvShots.globalswitchon = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# APV shots monitoring
SiStripMonitorDigi.TkHistoMapNApvShots_On = True
SiStripMonitorDigi.TkHistoMapNStripApvShots_On= True
SiStripMonitorDigi.TkHistoMapMedianChargeApvShots_On= True
SiStripMonitorDigi.TkHistoMapMedianChargeApvShots_On= False
SiStripMonitorDigi.TH1NApvShots.subdetswitchon = True
SiStripMonitorDigi.TH1NApvShots.globalswitchon = True
SiStripMonitorDigi.TH1ChargeMedianApvShots.subdetswitchon = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@
cms.PSet(mapName=cms.untracked.string('StoNCorrOnTrack')),
cms.PSet(mapName=cms.untracked.string('NApvShots'),mapMax=cms.untracked.double(-1.),logScale=cms.untracked.bool(True)),
cms.PSet(mapName=cms.untracked.string('NApvShots'),logScale=cms.untracked.bool(True),psuMap=cms.untracked.bool(True),loadLVCabling=cms.untracked.bool(True),TopModules=cms.untracked.bool(True)),
cms.PSet(mapName=cms.untracked.string('MedianChargeApvShots'),mapMax=cms.untracked.double(-1.)),
# cms.PSet(mapName=cms.untracked.string('MedianChargeApvShots'),mapMax=cms.untracked.double(-1.)),
# cms.PSet(mapName=cms.untracked.string('ClusterCharge'),mapMax=cms.untracked.double(-1.)),
# cms.PSet(mapName=cms.untracked.string('ChargePerCMfromOrigin')),
cms.PSet(mapName=cms.untracked.string('ChargePerCMfromTrack')),
cms.PSet(mapName=cms.untracked.string('NumberMissingHits')),
cms.PSet(mapName=cms.untracked.string('NumberValidHits')),
cms.PSet(mapName=cms.untracked.string('NumberInactiveHits'))
)
)

Expand Down
2 changes: 2 additions & 0 deletions DQM/SiStripMonitorCluster/interface/SiStripMonitorCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer {

// TkHistoMap added
TkHistoMap* tkmapcluster;
TkHistoMap* tkmapclusterch;

int runNb, eventNb;
int firstEvent;
Expand Down Expand Up @@ -194,6 +195,7 @@ class SiStripMonitorCluster : public DQMEDAnalyzer {
bool globalswitchcstripvscpix;
bool globalswitchMultiRegions;
bool clustertkhistomapon;
bool clusterchtkhistomapon;
bool createTrendMEs;
bool trendVsLs_;
bool globalswitchnclusvscycletimeprof2don;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

SiStripCalZeroBiasMonitorCluster.TkHistoMap_On = cms.bool(False)

SiStripCalZeroBiasMonitorCluster.ClusterChTkHistoMap_On = cms.bool(False)

SiStripCalZeroBiasMonitorCluster.TopFolderName = cms.string('AlcaReco/SiStrip')

SiStripCalZeroBiasMonitorCluster.BPTXfilter = cms.PSet()
Expand Down
2 changes: 2 additions & 0 deletions DQM/SiStripMonitorCluster/python/SiStripMonitorCluster_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
ClusterLabel = cms.string(''),

TkHistoMap_On = cms.bool(True),

ClusterChTkHistoMap_On = cms.bool(True),

TopFolderName = cms.string('SiStrip'),

Expand Down
9 changes: 9 additions & 0 deletions DQM/SiStripMonitorCluster/src/SiStripMonitorCluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ SiStripMonitorCluster::SiStripMonitorCluster(const edm::ParameterSet& iConfig)
module_clusterWidth_vs_amplitude_on = ParametersClusWidthVsAmpTH2.getParameter<bool>("moduleswitchon");

clustertkhistomapon = conf_.getParameter<bool>("TkHistoMap_On");
clusterchtkhistomapon = conf_.getParameter<bool>("ClusterChTkHistoMap_On");
createTrendMEs = conf_.getParameter<bool>("CreateTrendMEs");
trendVsLs_ = conf_.getParameter<bool>("TrendVsLS");
Mod_On_ = conf_.getParameter<bool>("Mod_On");
Expand Down Expand Up @@ -257,6 +258,11 @@ void SiStripMonitorCluster::createMEs(const edm::EventSetup& es , DQMStore::IBoo
tkmapcluster = new TkHistoMap(ibooker , topFolderName_,"TkHMap_NumberOfCluster",0.,true);
else tkmapcluster = new TkHistoMap(ibooker , topFolderName_+"/TkHistoMap","TkHMap_NumberOfCluster",0.,false);
}
if (clusterchtkhistomapon) {
if ( (topFolderName_ == "SiStrip") or (std::string::npos != topFolderName_.find("HLT")) )
tkmapclusterch = new TkHistoMap(ibooker , topFolderName_,"TkHMap_ClusterCharge",0.,true);
else tkmapclusterch = new TkHistoMap(ibooker , topFolderName_+"/TkHistoMap","TkHMap_ClusterCharge",0.,false);
}

// loop over detectors and book MEs
edm::LogInfo("SiStripTkDQM|SiStripMonitorCluster")<<"nr. of activeDets: "<<activeDets.size();
Expand Down Expand Up @@ -604,6 +610,7 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
(mod_single.NumberOfClusters)->Fill(0.); // no clusters for this detector module,fill histogram with 0
}
if(clustertkhistomapon) tkmapcluster->fill(detid,0.);
if(clusterchtkhistomapon) tkmapclusterch->fill(detid,0.);
if (found_layer_me && layerswitchnumclusterprofon) layer_single.LayerNumberOfClusterProfile->Fill(iDet, 0.0);
continue; // no clusters for this detid => jump to next step of loop
}
Expand Down Expand Up @@ -643,6 +650,8 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
// add nr of strips of this cluster to total nr. of clusterized strips
total_clusterized_strips = total_clusterized_strips + cluster_width;

if(clusterchtkhistomapon) tkmapclusterch->fill(detid,static_cast<float>(clusterIter->charge()));

// cluster signal and noise from the amplitudes
float cluster_signal = 0.0;
float cluster_noise = 0.0;
Expand Down
6 changes: 5 additions & 1 deletion DQM/SiStripMonitorTrack/interface/SiStripMonitorTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ class SiStripMonitorTrack : public DQMEDAnalyzer {
std::string topFolderName_;

//******* TkHistoMaps
TkHistoMap *tkhisto_StoNCorrOnTrack, *tkhisto_NumOnTrack, *tkhisto_NumOffTrack;
TkHistoMap *tkhisto_StoNCorrOnTrack, *tkhisto_NumOnTrack, *tkhisto_NumOffTrack;
TkHistoMap *tkhisto_ClChPerCMfromOrigin, *tkhisto_ClChPerCMfromTrack;
TkHistoMap *tkhisto_NumMissingHits, *tkhisto_NumberInactiveHits, *tkhisto_NumberValidHits;
//******** TkHistoMaps
int numTracks;

struct ModMEs{
MonitorElement* ClusterStoNCorr;
Expand Down Expand Up @@ -211,6 +214,7 @@ class SiStripMonitorTrack : public DQMEDAnalyzer {
bool HistoFlag_On_;
bool ring_flag;
bool TkHistoMap_On_;
bool clchCMoriginTkHmap_On_;

std::string TrackProducer_;
std::string TrackLabel_;
Expand Down
3 changes: 2 additions & 1 deletion DQM/SiStripMonitorTrack/python/SiStripMonitorTrack_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
Trend_On = cms.bool(False),
HistoFlag_On = cms.bool(False),
TkHistoMap_On = cms.bool(True),

clchCMoriginTkHmap_On = cms.bool(False),

ClusterConditions = cms.PSet( On = cms.bool(False),
minStoN = cms.double(0.0),
maxStoN = cms.double(2000.0),
Expand Down
44 changes: 43 additions & 1 deletion DQM/SiStripMonitorTrack/src/SiStripMonitorTrack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,13 @@ void SiStripMonitorTrack::book(DQMStore::IBooker & ibooker , const TrackerTopolo
tkhisto_StoNCorrOnTrack = new TkHistoMap(ibooker , topFolderName_ ,"TkHMap_StoNCorrOnTrack", 0.0,true);
tkhisto_NumOnTrack = new TkHistoMap(ibooker , topFolderName_, "TkHMap_NumberOfOnTrackCluster", 0.0,true);
tkhisto_NumOffTrack = new TkHistoMap(ibooker , topFolderName_, "TkHMap_NumberOfOfffTrackCluster",0.0,true);
tkhisto_ClChPerCMfromTrack = new TkHistoMap(ibooker , topFolderName_, "TkHMap_ChargePerCMfromTrack",0.0,true);
tkhisto_NumMissingHits = new TkHistoMap(ibooker , topFolderName_, "TkHMap_NumberMissingHits",0.0,true);
tkhisto_NumberInactiveHits = new TkHistoMap(ibooker , topFolderName_, "TkHMap_NumberInactiveHits",0.0,true);
tkhisto_NumberValidHits = new TkHistoMap(ibooker , topFolderName_, "TkHMap_NumberValidHits",0.0,true);
}
if (clchCMoriginTkHmap_On_)
tkhisto_ClChPerCMfromOrigin = new TkHistoMap(ibooker , topFolderName_, "TkHMap_ChargePerCMfromOrigin",0.0,true);
//******** TkHistoMaps

std::vector<uint32_t> vdetId_;
Expand Down Expand Up @@ -657,6 +663,18 @@ void SiStripMonitorTrack::trajectoryStudy(const edm::Ref<std::vector<Trajectory>
TrajectoryStateOnSurface updatedtsos=traj_mes_iterator->updatedState();
ConstRecHitPointer ttrh=traj_mes_iterator->recHit();

if (TkHistoMap_On_ && (numTracks > 0)) {
uint32_t thedetid=ttrh->rawId();
if ( thedetid > 369120277-1 ) {
if ( (ttrh->getType()==1) )
tkhisto_NumMissingHits->add(thedetid,static_cast<float>(1./numTracks));
if ( (ttrh->getType()==2) )
tkhisto_NumberInactiveHits->add(thedetid,static_cast<float>(1./numTracks));
if ( (ttrh->getType()==0) )
tkhisto_NumberValidHits->add(thedetid,static_cast<float>(1./numTracks));
}
}

if (!ttrh->isValid()) continue;

const ProjectedSiStripRecHit2D* projhit = dynamic_cast<const ProjectedSiStripRecHit2D*>( ttrh->hit() );
Expand Down Expand Up @@ -821,7 +839,8 @@ void SiStripMonitorTrack::trackStudyFromTrack(edm::Handle<reco::TrackCollection
// edm::ESHandle<TransientTrackBuilder> builder;
// es.get<TransientTrackRecord>().get("TransientTrackBuilder",builder);
// const TransientTrackBuilder* transientTrackBuilder = builder.product();


numTracks = trackCollectionHandle->size();
reco::TrackCollection trackCollection = *trackCollectionHandle;
for (reco::TrackCollection::const_iterator track = trackCollection.begin(), etrack = trackCollection.end();
track!=etrack; ++track) {
Expand All @@ -831,6 +850,19 @@ void SiStripMonitorTrack::trackStudyFromTrack(edm::Handle<reco::TrackCollection

for (trackingRecHit_iterator hit = track->recHitsBegin(), ehit = track->recHitsEnd();
hit!=ehit; ++hit) {

if (TkHistoMap_On_ && (numTracks > 0)) {
uint32_t thedetid=(*hit)->rawId();
if ( thedetid > 369120277-1 ) {
if ( ((*hit)->getType()==1) )
tkhisto_NumMissingHits->add(thedetid,static_cast<float>(1./numTracks));
if ( ((*hit)->getType()==2) )
tkhisto_NumberInactiveHits->add(thedetid,static_cast<float>(1./numTracks));
if ( ((*hit)->getType()==0) )
tkhisto_NumberValidHits->add(thedetid,static_cast<float>(1./numTracks));
}
}

if (!(*hit)->isValid()) continue;
DetId detID = (*hit)->geographicalId();
if (detID.det() != DetId::Tracker) continue;
Expand Down Expand Up @@ -883,6 +915,7 @@ void SiStripMonitorTrack::trackStudyFromTrack(edm::Handle<reco::TrackCollection
//------------------------------------------------------------------------
void SiStripMonitorTrack::trackStudyFromTrajectory(edm::Handle<TrajTrackAssociationCollection> TItkAssociatorCollection, const edm::EventSetup& es) {
//Perform track study
numTracks = TItkAssociatorCollection->size();
int i=0;
for(TrajTrackAssociationCollection::const_iterator it = TItkAssociatorCollection->begin();it != TItkAssociatorCollection->end(); ++it){
const edm::Ref<std::vector<Trajectory> > traj_iterator = it->key;
Expand Down Expand Up @@ -1049,6 +1082,15 @@ bool SiStripMonitorTrack::clusterInfos(SiStripClusterInfo* cluster, const uint32
LocalVector locDir(locVtx.x(), locVtx.y(), locVtx.z());
float dQdx_fromOrigin = siStripClusterTools::chargePerCM(detid, *cluster, locDir);

if (TkHistoMap_On_ && (flag == OnTrack)) {
uint32_t adet=cluster->detId();
tkhisto_ClChPerCMfromTrack->fill(adet,dQdx_fromTrack);
}
if (clchCMoriginTkHmap_On_ && (flag == OffTrack)){
uint32_t adet=cluster->detId();
tkhisto_ClChPerCMfromOrigin->fill(adet,dQdx_fromOrigin);
}

if(flag==OnTrack){
if (MEs.iSubdet != nullptr) MEs.iSubdet->totNClustersOnTrack++;
// layerMEs
Expand Down

0 comments on commit f875c41

Please sign in to comment.