27 tracksCollection_in_EventTree(
true),
72 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::beginRun] There are "<<
tkgeom_->detUnits().size() <<
" detectors instantiated in the geometry" << std::endl;
86 book(ibooker , tTopo);
108 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::analyse] " <<
"Run " << e.
id().
run() <<
" Event " << e.
id().
event() << std::endl;
116 for (std::map<std::string, SubDetMEs>::iterator iSubDet =
SubDetMEsMap.begin();
118 iSubDet->second.totNClustersOnTrack = 0;
119 iSubDet->second.totNClustersOffTrack = 0;
130 std::map<std::string, MonitorElement*>::iterator iME;
131 std::map<std::string, LayerMEs>::iterator iLayerME;
133 for (std::map<std::string, SubDetMEs>::iterator iSubDet =
SubDetMEsMap.begin();
161 std::vector<uint32_t> vdetId_;
164 for (std::vector<uint32_t>::const_iterator detid_iter=vdetId_.begin();detid_iter!=vdetId_.end();detid_iter++){
165 uint32_t
detid = *detid_iter;
168 edm::LogError(
"SiStripMonitorTrack")<<
"[" <<__PRETTY_FUNCTION__ <<
"] invalid detid " << detid<< std::endl;
180 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_id);
205 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(hid);
229 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);
260 hname = hidmanager.
createHistoLayer(
"Summary_ClusterStoNCorr",name,layer_id,
"OnTrack");
264 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeCorr",name,layer_id,
"OnTrack");
268 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge",name,layer_id,
"OnTrack");
271 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge",name,layer_id,
"OffTrack");
275 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise",name,layer_id,
"OnTrack");
278 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise",name,layer_id,
"OffTrack");
282 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth",name,layer_id,
"OnTrack");
285 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth",name,layer_id,
"OffTrack");
290 if (layer_id.find(
"TEC") != std::string::npos && !
flag_ring) total_nr_strips = 3 * 2 * 128;
292 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition",name,layer_id,
"OnTrack");
295 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition",name,layer_id,
"OffTrack");
307 subdet_tag =
"__" +
name;
323 completeName =
"Summary_TotalNumberOfClusters_OnTrack" +
subdet_tag;
328 completeName =
"Summary_TotalNumberOfClusters_OffTrack" +
subdet_tag;
333 completeName =
"Summary_ClusterStoNCorr_OnTrack" +
subdet_tag;
337 completeName =
"Summary_ClusterCharge_OnTrack" +
subdet_tag;
341 completeName =
"Summary_ClusterCharge_OffTrack" +
subdet_tag;
345 completeName =
"Summary_ClusterStoN_OffTrack" +
subdet_tag;
350 completeName =
"Trend_TotalNumberOfClusters_OnTrack" +
subdet_tag;
352 completeName =
"Trend_TotalNumberOfClusters_OffTrack" +
subdet_tag;
365 return ibooker.
book1D(HistoName,HistoName,
376 return ibooker.
book2D(HistoName,HistoName,
390 return ibooker.
book3D(HistoName,HistoName,
423 ParametersTrend.getParameter<int32_t>(
"Nbins"),
425 ParametersTrend.getParameter<int32_t>(
"Nbins"),
433 me->setAxisTitle(
"Event Time in Seconds",1);
442 const std::vector<TrajectoryMeasurement> & measurements = traj->measurements();
443 std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator;
444 for(std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator= measurements.begin(), traj_mes_end=measurements.end();
445 traj_mes_iterator!=traj_mes_end;traj_mes_iterator++){
452 if (!ttrh->isValid())
continue;
463 LogTrace(
"SiStripMonitorTrack")<<
"\nMatched recHit found"<< std::endl;
470 statedirection=monodet->
toLocal(gtrkdirup);
473 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&m,statedirection,es);
476 statedirection=stereodet->
toLocal(gtrkdirup);
479 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&s,statedirection,es);
482 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found"<< std::endl;
491 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found MONO"<< std::endl;
493 statedirection=det->
toLocal(gtrkdirup);
494 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es);
497 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found STEREO"<< std::endl;
500 statedirection=det->
toLocal(gtrkdirup);
501 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es);
505 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(hit2D,statedirection,es);
508 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit1D>(hit1D,statedirection,es);
511 <<
" LocalMomentum: "<<statedirection
512 <<
"\nLocal x-z plane angle: "<<atan2(statedirection.
x(),statedirection.
z());
528 LogTrace(
"SiStripMonitorTrack")<<
"\nMatched recHit found"<< std::endl;
536 statedirection=monodet->
toLocal(gtrkdirup);
538 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&m,statedirection,es);
542 statedirection=stereodet->
toLocal(gtrkdirup);
544 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&s,statedirection,es);
547 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found"<< std::endl;
557 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found MONO"<< std::endl;
559 statedirection=det->
toLocal(gtrkdirup);
560 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es);
563 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found STEREO"<< std::endl;
566 statedirection=det->
toLocal(gtrkdirup);
567 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es);
570 statedirection=localMomentum;
571 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(hit2D,statedirection,es);
573 statedirection=localMomentum;
574 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit1D>(hit1D,statedirection,es);
577 <<
" LocalMomentum: "<<statedirection
578 <<
"\nLocal x-z plane angle: "<<atan2(statedirection.
x(),statedirection.
z());
587 using namespace reco;
592 if( TItkAssociatorCollection.isValid()){
595 edm::LogError(
"SiStripMonitorTrack")<<
"Association not found ... try w/ track collection"<<std::endl;
605 if (!trackCollectionHandle.
isValid()){
622 for (reco::TrackCollection::const_iterator track = trackCollection.begin(), etrack = trackCollection.end();
623 track!=etrack; ++track) {
630 if (!(*hit)->isValid())
continue;
631 DetId detID = (*hit)->geographicalId();
644 hitStudy(es,projhit,matchedhit,hit2D,hit1D,localMomentum);
694 <<
"Track number "<< i+1 << std::endl;
715 if(!tkrecHit->isValid()){
716 LogTrace(
"SiStripMonitorTrack") <<
"\t\t Invalid Hit " << std::endl;
720 const uint32_t&
detid = tkrecHit->geographicalId().rawId();
723 <<
"\n\t\tRecHit on det "<<tkrecHit->geographicalId().rawId()
724 <<
"\n\t\tRecHit in LP "<<tkrecHit->localPosition()
725 <<
"\n\t\tRecHit in GP "<<
tkgeom_->idToDet(tkrecHit->geographicalId())->surface().toGlobal(tkrecHit->localPosition())
726 <<
"\n\t\tRecHit trackLocal vector "<<LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() <<std::endl;
735 if ( tkrecHit !=
NULL ){
748 edm::LogError(
"SiStripMonitorTrack") <<
"NULL hit" << std::endl;
765 if (!siStripClusterHandle.
isValid()){
766 edm::LogError(
"SiStripMonitorTrack")<<
"ClusterCollection is not valid!!" << std::endl;
775 DSViter!=siStripClusterHandle->end();
778 uint32_t
detid=DSViter->id();
780 LogDebug(
"SiStripMonitorTrack") <<
"on detid "<< detid <<
" N Cluster= " << DSViter->size();
803 if (cluster==
NULL)
return false;
816 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(sdet_pair.second);
820 if (flag ==
OnTrack) iSubdet->second.totNClustersOnTrack++;
821 else if (flag ==
OffTrack) iSubdet->second.totNClustersOffTrack++;
828 LogDebug(
"SiStripMonitorTrack")<<
"\n\tLV " << LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() <<
" " << LV.
mag() << std::endl;
830 cosRZ= fabs(LV.
z())/LV.
mag();
831 LogDebug(
"SiStripMonitorTrack")<<
"\n\t cosRZ " << cosRZ << std::endl;
836 fillMEs(cluster,detid,tTopo,cosRZ,flag);
841 uint32_t adet=cluster->
detId();
847 LogDebug(
"SiStripMonitorTrack") <<
"Module " << detid <<
" in Event " <<
eventNb <<
" noise " << noise << std::endl;
851 if(cluster->
charge() > 250){
852 LogDebug(
"SiStripMonitorTrack") <<
"Module firing " << detid <<
" in Event " <<
eventNb << std::endl;
871 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(name);
875 uint16_t charge = cluster->
charge();
880 if(noise > 0.0)
fillME(iModME->second.ClusterStoNCorr ,StoN*cos);
881 if(noise == 0.0)
LogDebug(
"SiStripMonitorTrack") <<
"Module " << name <<
" in Event " <<
eventNb <<
" noise " << noise << std::endl;
882 fillME(iModME->second.ClusterCharge,charge);
884 fillME(iModME->second.ClusterChargeCorr,charge*cos);
886 fillME(iModME->second.ClusterWidth ,width);
887 fillME(iModME->second.ClusterPos ,position);
891 int PGVposCounter = cluster->
maxIndex();
893 fillME(iModME->second.ClusterPGV,
i,0.);
895 fillME(iModME->second.ClusterPGV, PGVposCounter++,(*it)/PGVmax);
898 fillME(iModME->second.ClusterPGV,
i,0.);
913 uint16_t charge = cluster->
charge();
917 std::map<std::string, LayerMEs>::iterator iLayer =
LayerMEsMap.find(layer_id);
921 if(noise > 0.0)
fillME(iLayer->second.ClusterStoNCorrOnTrack, StoN*cos);
923 fillME(iLayer->second.ClusterChargeCorrOnTrack, charge*cos);
924 fillME(iLayer->second.ClusterChargeOnTrack, charge);
925 fillME(iLayer->second.ClusterNoiseOnTrack, noise);
926 fillME(iLayer->second.ClusterWidthOnTrack, width);
927 fillME(iLayer->second.ClusterPosOnTrack, position);
930 fillME(iLayer->second.ClusterChargeOffTrack, charge);
931 fillME(iLayer->second.ClusterNoiseOffTrack, noise);
932 fillME(iLayer->second.ClusterWidthOffTrack, width);
933 fillME(iLayer->second.ClusterPosOffTrack, position);
936 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(sdet_pair.second);
939 fillME(iSubdet->second.ClusterChargeOnTrack,charge);
940 if(noise > 0.0)
fillME(iSubdet->second.ClusterStoNCorrOnTrack,StoN*cos);
942 fillME(iSubdet->second.ClusterChargeOffTrack,charge);
943 if(noise > 0.0)
fillME(iSubdet->second.ClusterStoNOffTrack,StoN);
953 tag = folder_name.substr(folder_name.find(
"MechanicalView")+15);
954 if (tag.find(
"side_") != std::string::npos) {
955 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
void hitStudy(const edm::EventSetup &es, const ProjectedSiStripRecHit2D *projhit, const SiStripMatchedRecHit2D *matchedhit, const SiStripRecHit2D *hit2D, const SiStripRecHit1D *hit1D, LocalVector localMomentum)
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_
key_type key() const
Accessor for product key.
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
MonitorElement * ClusterChargeCorr
uint16_t maxIndex() const
void trajectoryStudy(const edm::Ref< std::vector< Trajectory > > traj, const edm::EventSetup &es)
static bool pixelBarrelHitFilter(uint16_t pattern)
auto stripCharges() const -> decltype(cluster() ->amplitudes())
MonitorElement * ClusterPGV
MonitorElement * nClustersTrendOffTrack
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
static bool validHitFilter(uint16_t pattern)
uint32_t rawId() const
get the raw id
LocalVector localMomentum() const
edm::ESHandle< TrackerGeometry > tkgeom_
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
edm::EventNumber_t eventNb
uint16_t hitPattern[ARRAY_LENGTH]
TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
std::unordered_set< const SiStripCluster * > vPSiStripCluster
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 *)
SiStripFolderOrganizer folderOrganizer_
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
MonitorElement * ClusterChargeOnTrack
MonitorElement * ClusterNoiseOffTrack
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
SiStripRecHit2D originalHit() const
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)
SiStripRecHit2D stereoHit() const
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 &)
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
SiStripRecHit2D monoHit() const
bool clusterInfos(SiStripClusterInfo *cluster, const uint32_t &detid, const TrackerTopology *tTopo, enum ClusterFlags flags, LocalVector LV)
GenericTriggerEventFlag * genTriggerEventFlag_
void RecHitInfo(const T *tkrecHit, LocalVector LV, const edm::EventSetup &)
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)
static int position[264][3]
MonitorElement * ClusterWidthOnTrack
MonitorElement * bookMEProfile(DQMStore::IBooker &, const char *, const char *)
TkHistoMap * tkhisto_StoNCorrOnTrack
DetId geographicalId() const
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)
uint16_t getHitPattern(HitCategory category, int position) const
Detector det() const
get the detector field from this detid
MonitorElement * book3D(Args &&...args)
MonitorElement * nClustersOffTrack
void add(uint32_t &detid, float value)
bool applyClusterQuality_
edm::InputTag Cluster_src_
const GeomDetUnit * stereoDet() const
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
int numberOfHits(HitCategory category) const
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
std::map< std::string, LayerMEs > LayerMEsMap