26 tracksCollection_in_EventTree(
true),
71 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::beginRun] There are "<<
tkgeom->detUnits().size() <<
" detectors instantiated in the geometry" << std::endl;
85 book(ibooker , tTopo);
107 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::analyse] " <<
"Run " << e.
id().
run() <<
" Event " << e.
id().
event() << std::endl;
115 for (std::map<std::string, SubDetMEs>::iterator iSubDet =
SubDetMEsMap.begin();
117 iSubDet->second.totNClustersOnTrack = 0;
118 iSubDet->second.totNClustersOffTrack = 0;
129 std::map<std::string, MonitorElement*>::iterator iME;
130 std::map<std::string, LayerMEs>::iterator iLayerME;
132 for (std::map<std::string, SubDetMEs>::iterator iSubDet =
SubDetMEsMap.begin();
160 std::vector<uint32_t> vdetId_;
163 for (std::vector<uint32_t>::const_iterator detid_iter=vdetId_.begin();detid_iter!=vdetId_.end();detid_iter++){
164 uint32_t
detid = *detid_iter;
167 edm::LogError(
"SiStripMonitorTrack")<<
"[" <<__PRETTY_FUNCTION__ <<
"] invalid detid " << detid<< std::endl;
179 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_id);
204 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(hid);
228 theModMEs.
ClusterPos=ibooker.
book1D(hidmanager.
createHistoId(
"ClusterPosition_OnTrack",name,
id).c_str(),hidmanager.
createHistoId(
"ClusterPosition_OnTrack",name,
id).c_str(),total_nr_strips,0.5,total_nr_strips+0.5);
259 hname = hidmanager.
createHistoLayer(
"Summary_ClusterStoNCorr",name,layer_id,
"OnTrack");
263 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeCorr",name,layer_id,
"OnTrack");
267 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge",name,layer_id,
"OnTrack");
270 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge",name,layer_id,
"OffTrack");
274 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise",name,layer_id,
"OnTrack");
277 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise",name,layer_id,
"OffTrack");
281 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth",name,layer_id,
"OnTrack");
284 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth",name,layer_id,
"OffTrack");
289 if (layer_id.find(
"TEC") != std::string::npos && !
flag_ring) total_nr_strips = 3 * 2 * 128;
291 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition",name,layer_id,
"OnTrack");
294 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition",name,layer_id,
"OffTrack");
306 subdet_tag =
"__" +
name;
321 completeName =
"Summary_TotalNumberOfClusters_OnTrack" +
subdet_tag;
326 completeName =
"Summary_TotalNumberOfClusters_OffTrack" +
subdet_tag;
331 completeName =
"Summary_ClusterStoNCorr_OnTrack" +
subdet_tag;
335 completeName =
"Summary_ClusterCharge_OffTrack" +
subdet_tag;
339 completeName =
"Summary_ClusterStoN_OffTrack" +
subdet_tag;
344 completeName =
"Trend_TotalNumberOfClusters_OnTrack" +
subdet_tag;
346 completeName =
"Trend_TotalNumberOfClusters_OffTrack" +
subdet_tag;
359 return ibooker.
book1D(HistoName,HistoName,
370 return ibooker.
book2D(HistoName,HistoName,
384 return ibooker.
book3D(HistoName,HistoName,
417 ParametersTrend.getParameter<int32_t>(
"Nbins"),
419 ParametersTrend.getParameter<int32_t>(
"Nbins"),
427 me->setAxisTitle(
"Event Time in Seconds",1);
435 const std::vector<TrajectoryMeasurement> & measurements = traj->measurements();
436 std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator;
437 for(std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator= measurements.begin();traj_mes_iterator!=measurements.end();traj_mes_iterator++){
445 if (!ttrh->isValid())
continue;
447 const ProjectedSiStripRecHit2D* phit =
dynamic_cast<const ProjectedSiStripRecHit2D*
>( ttrh->hit() );
448 const SiStripMatchedRecHit2D* matchedhit =
dynamic_cast<const SiStripMatchedRecHit2D*
>( ttrh->hit() );
449 const SiStripRecHit2D* hit2D =
dynamic_cast<const SiStripRecHit2D*
>( ttrh->hit() );
450 const SiStripRecHit1D* hit1D =
dynamic_cast<const SiStripRecHit1D*
>( ttrh->hit() );
456 LogTrace(
"SiStripMonitorTrack")<<
"\nMatched recHit found"<< std::endl;
463 statedirection=monodet->
toLocal(gtrkdirup);
464 SiStripRecHit2D
m = matchedhit->monoHit();
465 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&m,statedirection,trackref,es);
468 statedirection=stereodet->
toLocal(gtrkdirup);
469 SiStripRecHit2D
s = matchedhit->stereoHit();
470 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&s,statedirection,trackref,es);
473 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found"<< std::endl;
478 const SiStripRecHit2D originalhit=phit->originalHit();
482 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found MONO"<< std::endl;
484 statedirection=det->
toLocal(gtrkdirup);
485 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,trackref,es);
488 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found STEREO"<< std::endl;
491 statedirection=det->
toLocal(gtrkdirup);
492 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,trackref,es);
496 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(hit2D,statedirection,trackref,es);
499 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit1D>(hit1D,statedirection,trackref,es);
502 <<
" LocalMomentum: "<<statedirection
503 <<
"\nLocal x-z plane angle: "<<atan2(statedirection.
x(),statedirection.
z());
515 if( TItkAssociatorCollection.
isValid()){
518 edm::LogError(
"SiStripMonitorTrack")<<
"Association not found ... try w/ track collection"<<std::endl;
523 if (!trackCollectionHandle.
isValid()){
536 for (reco::TrackCollection::const_iterator track = trackCollection.begin(); track!=trackCollection.end(); ++track) {
550 <<
"Track number "<< i+1
551 <<
"\n\tmomentum: " << trackref->momentum()
552 <<
"\n\tPT: " << trackref->pt()
553 <<
"\n\tvertex: " << trackref->vertex()
554 <<
"\n\timpact parameter: " << trackref->d0()
555 <<
"\n\tcharge: " << trackref->charge()
556 <<
"\n\tnormalizedChi2: " << trackref->normalizedChi2()
557 <<
"\n\tFrom EXTRA : "
558 <<
"\n\t\touter PT "<< trackref->outerPt()<<std::endl;
570 if(!tkrecHit->isValid()){
571 LogTrace(
"SiStripMonitorTrack") <<
"\t\t Invalid Hit " << std::endl;
575 const uint32_t&
detid = tkrecHit->geographicalId().rawId();
577 LogTrace(
"SiStripMonitorTrack") <<
"Modules Excluded" << std::endl;
582 <<
"\n\t\tRecHit on det "<<tkrecHit->geographicalId().rawId()
583 <<
"\n\t\tRecHit in LP "<<tkrecHit->localPosition()
584 <<
"\n\t\tRecHit in GP "<<
tkgeom->idToDet(tkrecHit->geographicalId())->surface().toGlobal(tkrecHit->localPosition())
585 <<
"\n\t\tRecHit trackLocal vector "<<LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() <<std::endl;
594 if ( tkrecHit !=
NULL ){
604 edm::LogError(
"SiStripMonitorTrack") <<
"NULL hit" << std::endl;
621 if (!siStripClusterHandle.
isValid()){
622 edm::LogError(
"SiStripMonitorTrack")<<
"ClusterCollection is not valid!!" << std::endl;
629 uint32_t
detid=DSViter->id();
632 LogDebug(
"SiStripMonitorTrack") <<
"on detid "<< detid <<
" N Cluster= " << DSViter->size();
634 for(; ClusIter!=DSViter->
end(); ClusIter++) {
650 if (cluster==
NULL)
return false;
663 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(sdet_pair.second);
667 if (flag ==
OnTrack) iSubdet->second.totNClustersOnTrack++;
668 else if (flag ==
OffTrack) iSubdet->second.totNClustersOffTrack++;
675 LogDebug(
"SiStripMonitorTrack")<<
"\n\tLV " << LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() <<
" " << LV.
mag() << std::endl;
677 cosRZ= fabs(LV.
z())/LV.
mag();
678 LogDebug(
"SiStripMonitorTrack")<<
"\n\t cosRZ " << cosRZ << std::endl;
683 fillMEs(cluster,detid,tTopo,cosRZ,flag);
688 uint32_t adet=cluster->
detId();
694 LogDebug(
"SiStripMonitorTrack") <<
"Module " << detid <<
" in Event " <<
eventNb <<
" noise " << noise << std::endl;
698 if(cluster->
charge() > 250){
699 LogDebug(
"SiStripMonitorTrack") <<
"Module firing " << detid <<
" in Event " <<
eventNb << std::endl;
718 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(name);
727 if(noise > 0.0)
fillME(iModME->second.ClusterStoNCorr ,StoN*cos);
728 if(noise == 0.0)
LogDebug(
"SiStripMonitorTrack") <<
"Module " << name <<
" in Event " <<
eventNb <<
" noise " << noise << std::endl;
729 fillME(iModME->second.ClusterCharge,charge);
731 fillME(iModME->second.ClusterChargeCorr,charge*cos);
733 fillME(iModME->second.ClusterWidth ,width);
734 fillME(iModME->second.ClusterPos ,position);
738 int PGVposCounter = cluster->
maxIndex();
740 fillME(iModME->second.ClusterPGV,
i,0.);
741 for (std::vector<uint8_t>::const_iterator it=cluster->
stripCharges().begin();it<cluster->
stripCharges().end();++it) {
742 fillME(iModME->second.ClusterPGV, PGVposCounter++,(*it)/PGVmax);
745 fillME(iModME->second.ClusterPGV,
i,0.);
764 std::map<std::string, LayerMEs>::iterator iLayer =
LayerMEsMap.find(layer_id);
768 if(noise > 0.0)
fillME(iLayer->second.ClusterStoNCorrOnTrack, StoN*cos);
770 fillME(iLayer->second.ClusterChargeCorrOnTrack, charge*cos);
771 fillME(iLayer->second.ClusterChargeOnTrack, charge);
772 fillME(iLayer->second.ClusterNoiseOnTrack, noise);
773 fillME(iLayer->second.ClusterWidthOnTrack, width);
774 fillME(iLayer->second.ClusterPosOnTrack, position);
777 fillME(iLayer->second.ClusterChargeOffTrack, charge);
778 fillME(iLayer->second.ClusterNoiseOffTrack, noise);
779 fillME(iLayer->second.ClusterWidthOffTrack, width);
780 fillME(iLayer->second.ClusterPosOffTrack, position);
783 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(sdet_pair.second);
786 if(noise > 0.0)
fillME(iSubdet->second.ClusterStoNCorrOnTrack,StoN*cos);
788 fillME(iSubdet->second.ClusterChargeOffTrack,charge);
789 if(noise > 0.0)
fillME(iSubdet->second.ClusterStoNOffTrack,StoN);
799 tag = folder_name.substr(folder_name.find(
"MechanicalView")+15);
800 if (tag.find(
"side_") != std::string::npos) {
801 tag.replace(tag.find_last_of(
"/"),1,
"_");
MonitorElement * ClusterStoNCorr
MonitorElement * bookMETrend(DQMStore::IBooker &, const char *, const char *)
uint8_t maxCharge() const
MonitorElement * ClusterNoiseOnTrack
T getParameter(std::string const &) const
EventNumber_t event() const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
TkHistoMap * tkhisto_NumOffTrack
SiStripMonitorTrack(const edm::ParameterSet &)
void setSiStripFolderName(std::string name)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void trackStudy(const edm::Event &ev, const edm::EventSetup &es)
void trackStudyFromTrack(edm::Handle< reco::TrackCollection > trackCollectionHandle, const edm::EventSetup &es)
edm::EDGetTokenT< reco::TrackCollection > trackToken_
void trackStudyFromTrajectory(edm::Handle< TrajTrackAssociationCollection > TItkAssociatorCollection, const edm::EventSetup &es)
const GeomDetUnit * monoDet() const
void fillME(MonitorElement *ME, float value1)
SiStripDCSStatus * dcsStatus_
friend struct const_iterator
MonitorElement * nClustersTrendOnTrack
MonitorElement * bookProfile(Args &&...args)
MonitorElement * ClusterPosOffTrack
bool getByToken(EDGetToken token, Handle< PROD > &result) const
float noiseRescaledByGain() const
void book(DQMStore::IBooker &, const TrackerTopology *tTopo)
MonitorElement * ClusterStoNCorrOnTrack
void AllClusters(const edm::Event &ev, const edm::EventSetup &es)
MonitorElement * ClusterStoNOffTrack
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
std::string topFolderName_
std::vector< Track > TrackCollection
collection of Tracks
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=0)
MonitorElement * bookME1D(DQMStore::IBooker &, const char *, const char *)
void bookLayerMEs(DQMStore::IBooker &, const uint32_t &, std::string &)
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
data_type const * const_iterator
std::string TrackProducer_
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
MonitorElement * ClusterChargeCorr
uint16_t maxIndex() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static int position[TOTALCHAMBERS][3]
MonitorElement * ClusterPGV
MonitorElement * nClustersTrendOffTrack
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
LocalVector localMomentum() const
MonitorElement * ClusterCharge
bool getStatus(edm::Event const &e, edm::EventSetup const &eSetup)
edmNew::DetSet< SiStripCluster >::const_iterator ClusIter
math::XYZTLorentzVectorD LV
float signalOverNoise() const
void fillMEs(SiStripClusterInfo *, uint32_t detid, const TrackerTopology *tTopo, float, enum ClusterFlags)
vector< ParameterSet > Parameters
TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
std::map< std::string, SubDetMEs > SubDetMEsMap
void fillModMEs(SiStripClusterInfo *, std::string, float)
MonitorElement * ClusterChargeOffTrack
MonitorElement * nClustersOnTrack
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void fill(uint32_t &detid, float value)
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
const std::string subdet_tag("SubDet")
Cos< T >::type cos(const T &t)
MonitorElement * ClusterStoNCorrOnTrack
MonitorElement * bookME2D(DQMStore::IBooker &, const char *, const char *)
MonitorElement * book1D(Args &&...args)
void tag(MonitorElement *, unsigned int)
void bookSubDetMEs(DQMStore::IBooker &, std::string &name)
MonitorElement * bookME3D(DQMStore::IBooker &, const char *, const char *)
std::vector< const SiStripCluster * > vPSiStripCluster
edm::ESHandle< TrackerGeometry > tkgeom
SiStripFolderOrganizer folderOrganizer_
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
MonitorElement * ClusterNoiseOffTrack
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void getSubDetTag(std::string &folder_name, std::string &tag)
edm::EDGetTokenT< TrajTrackAssociationCollection > trackTrajToken_
MonitorElement * ClusterWidth
MonitorElement * ClusterChargeOnTrack
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=0)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
MonitorElement * ClusterWidthOffTrack
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
MonitorElement * ClusterPosOnTrack
void bookModMEs(DQMStore::IBooker &, const uint32_t &)
key_type key() const
Accessor for product key.
T const * product() const
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &es)
MonitorElement * ClusterChargeOffTrack
std::map< std::string, ModMEs > ModMEsMap
MonitorElement * ClusterPos
MonitorElement * ClusterChargeCorrOnTrack
std::pair< std::string, std::string > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
TkHistoMap * tkhisto_NumOnTrack
bool clusterInfos(SiStripClusterInfo *cluster, const uint32_t &detid, const TrackerTopology *tTopo, enum ClusterFlags flags, LocalVector LV)
GenericTriggerEventFlag * genTriggerEventFlag_
const std::vector< uint8_t > & stripCharges() const
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
MonitorElement * ClusterWidthOnTrack
MonitorElement * bookMEProfile(DQMStore::IBooker &, const char *, const char *)
TkHistoMap * tkhisto_StoNCorrOnTrack
std::vector< uint32_t > ModulesToBeExcluded_
virtual void endJob(void)
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
MonitorElement * book3D(Args &&...args)
MonitorElement * nClustersOffTrack
void add(uint32_t &detid, float value)
bool applyClusterQuality_
edm::InputTag Cluster_src_
const GeomDetUnit * stereoDet() const
void trajectoryStudy(const edm::Ref< std::vector< Trajectory > > traj, reco::TrackRef trackref, const edm::EventSetup &es)
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
std::map< std::string, LayerMEs > LayerMEsMap
void RecHitInfo(const T *tkrecHit, LocalVector LV, reco::TrackRef track_ref, const edm::EventSetup &)