26 tracksCollection_in_EventTree(
true),
76 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::beginRun] There are "<<
tkgeom->detUnits().size() <<
" detectors instantiated in the geometry" << std::endl;
104 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::analyse] " <<
"Run " << e.
id().
run() <<
" Event " << e.
id().
event() << std::endl;
112 for (std::map<std::string, SubDetMEs>::iterator iSubDet =
SubDetMEsMap.begin();
114 iSubDet->second.totNClustersOnTrack = 0;
115 iSubDet->second.totNClustersOffTrack = 0;
126 std::map<std::string, MonitorElement*>::iterator iME;
127 std::map<std::string, LayerMEs>::iterator iLayerME;
129 for (std::map<std::string, SubDetMEs>::iterator iSubDet =
SubDetMEsMap.begin();
157 std::vector<uint32_t> vdetId_;
160 for (std::vector<uint32_t>::const_iterator detid_iter=vdetId_.begin();detid_iter!=vdetId_.end();detid_iter++){
161 uint32_t
detid = *detid_iter;
164 edm::LogError(
"SiStripMonitorTrack")<<
"[" <<__PRETTY_FUNCTION__ <<
"] invalid detid " << detid<< std::endl;
176 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_id);
201 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(hid);
256 hname = hidmanager.
createHistoLayer(
"Summary_ClusterStoNCorr",name,layer_id,
"OnTrack");
260 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeCorr",name,layer_id,
"OnTrack");
264 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge",name,layer_id,
"OnTrack");
267 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge",name,layer_id,
"OffTrack");
271 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise",name,layer_id,
"OnTrack");
274 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise",name,layer_id,
"OffTrack");
278 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth",name,layer_id,
"OnTrack");
281 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth",name,layer_id,
"OffTrack");
286 if (layer_id.find(
"TEC") != std::string::npos && !
flag_ring) total_nr_strips = 3 * 2 * 128;
288 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition",name,layer_id,
"OnTrack");
291 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition",name,layer_id,
"OffTrack");
303 subdet_tag =
"__" +
name;
318 completeName =
"Summary_TotalNumberOfClusters_OnTrack" +
subdet_tag;
323 completeName =
"Summary_TotalNumberOfClusters_OffTrack" +
subdet_tag;
328 completeName =
"Summary_ClusterStoNCorr_OnTrack" +
subdet_tag;
332 completeName =
"Summary_ClusterCharge_OffTrack" +
subdet_tag;
336 completeName =
"Summary_ClusterStoN_OffTrack" +
subdet_tag;
341 completeName =
"Trend_TotalNumberOfClusters_OnTrack" +
subdet_tag;
343 completeName =
"Trend_TotalNumberOfClusters_OffTrack" +
subdet_tag;
414 ParametersTrend.getParameter<int32_t>(
"Nbins"),
416 ParametersTrend.getParameter<int32_t>(
"Nbins"),
424 me->setAxisTitle(
"Event Time in Seconds",1);
432 const std::vector<TrajectoryMeasurement> & measurements = traj->measurements();
433 std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator;
434 for(std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator= measurements.begin();traj_mes_iterator!=measurements.end();traj_mes_iterator++){
442 if (!ttrh->isValid())
continue;
445 const SiStripMatchedRecHit2D* matchedhit =
dynamic_cast<const SiStripMatchedRecHit2D*
>( ttrh->hit() );
446 const SiStripRecHit2D* hit2D =
dynamic_cast<const SiStripRecHit2D*
>( ttrh->hit() );
447 const SiStripRecHit1D* hit1D =
dynamic_cast<const SiStripRecHit1D*
>( ttrh->hit() );
453 LogTrace(
"SiStripMonitorTrack")<<
"\nMatched recHit found"<< std::endl;
460 statedirection=monodet->
toLocal(gtrkdirup);
461 SiStripRecHit2D
m = matchedhit->monoHit();
462 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&m,statedirection,trackref,es);
465 statedirection=stereodet->
toLocal(gtrkdirup);
466 SiStripRecHit2D
s = matchedhit->stereoHit();
467 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&s,statedirection,trackref,es);
470 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found"<< std::endl;
475 const SiStripRecHit2D& originalhit=phit->
originalHit();
479 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found MONO"<< std::endl;
481 statedirection=det->
toLocal(gtrkdirup);
482 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&(phit->
originalHit()),statedirection,trackref,es);
485 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found STEREO"<< std::endl;
488 statedirection=det->
toLocal(gtrkdirup);
489 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&(phit->
originalHit()),statedirection,trackref,es);
493 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(hit2D,statedirection,trackref,es);
496 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit1D>(hit1D,statedirection,trackref,es);
499 <<
" LocalMomentum: "<<statedirection
500 <<
"\nLocal x-z plane angle: "<<atan2(statedirection.
x(),statedirection.
z());
513 if( TItkAssociatorCollection.
isValid()){
516 edm::LogError(
"SiStripMonitorTrack")<<
"Association not found ... try w/ track collection"<<std::endl;
522 if (!trackCollectionHandle.
isValid()){
535 for (reco::TrackCollection::const_iterator track = trackCollection.begin(); track!=trackCollection.end(); ++track) {
549 <<
"Track number "<< i+1
550 <<
"\n\tmomentum: " << trackref->momentum()
551 <<
"\n\tPT: " << trackref->pt()
552 <<
"\n\tvertex: " << trackref->vertex()
553 <<
"\n\timpact parameter: " << trackref->d0()
554 <<
"\n\tcharge: " << trackref->charge()
555 <<
"\n\tnormalizedChi2: " << trackref->normalizedChi2()
556 <<
"\n\tFrom EXTRA : "
557 <<
"\n\t\touter PT "<< trackref->outerPt()<<std::endl;
569 if(!tkrecHit->isValid()){
570 LogTrace(
"SiStripMonitorTrack") <<
"\t\t Invalid Hit " << std::endl;
574 const uint32_t&
detid = tkrecHit->geographicalId().rawId();
576 LogTrace(
"SiStripMonitorTrack") <<
"Modules Excluded" << std::endl;
581 <<
"\n\t\tRecHit on det "<<tkrecHit->geographicalId().rawId()
582 <<
"\n\t\tRecHit in LP "<<tkrecHit->localPosition()
583 <<
"\n\t\tRecHit in GP "<<
tkgeom->idToDet(tkrecHit->geographicalId())->surface().toGlobal(tkrecHit->localPosition())
584 <<
"\n\t\tRecHit trackLocal vector "<<LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() <<std::endl;
593 if ( tkrecHit !=
NULL ){
603 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
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)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
SiStripDCSStatus * dcsStatus_
friend struct const_iterator
MonitorElement * nClustersTrendOnTrack
MonitorElement * ClusterPosOffTrack
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
float noiseRescaledByGain() const
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_
void bookLayerMEs(const uint32_t &, std::string &)
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)
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)
void bookSubDetMEs(std::string &name)
static int position[TOTALCHAMBERS][3]
MonitorElement * ClusterPGV
MonitorElement * nClustersTrendOffTrack
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
void tag(MonitorElement *me, unsigned int myTag)
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
std::map< std::string, SubDetMEs > SubDetMEsMap
void fillModMEs(SiStripClusterInfo *, std::string, float)
MonitorElement * ClusterChargeOffTrack
MonitorElement * nClustersOnTrack
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
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
std::vector< const SiStripCluster * > vPSiStripCluster
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
edm::ESHandle< TrackerGeometry > tkgeom
SiStripFolderOrganizer folderOrganizer_
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
MonitorElement * ClusterNoiseOffTrack
MonitorElement * bookMETrend(const char *, const char *)
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 book(const TrackerTopology *tTopo)
MonitorElement * ClusterWidthOffTrack
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
MonitorElement * ClusterPosOnTrack
key_type key() const
Accessor for product key.
T const * product() const
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
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
MonitorElement * bookME2D(const char *, const char *)
MonitorElement * ClusterWidthOnTrack
MonitorElement * bookMEProfile(const char *, const char *)
MonitorElement * bookME3D(const char *, const char *)
TkHistoMap * tkhisto_StoNCorrOnTrack
DetId geographicalId() const
std::vector< uint32_t > ModulesToBeExcluded_
virtual void endJob(void)
void showDirStructure(void) const
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
void bookModMEs(const uint32_t &)
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
MonitorElement * bookME1D(const char *, const char *)
MonitorElement * nClustersOffTrack
void add(uint32_t &detid, float value)
const SiStripRecHit2D & originalHit() const
bool applyClusterQuality_
edm::InputTag Cluster_src_
void setCurrentFolder(const std::string &fullpath)
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 &)