26 tracksCollection_in_EventTree(
true),
70 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::beginRun] There are "<<
tkgeom->detUnits().size() <<
" detectors instantiated in the geometry" << std::endl;
98 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::analyse] " <<
"Run " << e.
id().
run() <<
" Event " << e.
id().
event() << std::endl;
106 for (std::map<std::string, SubDetMEs>::iterator iSubDet =
SubDetMEsMap.begin();
108 iSubDet->second.totNClustersOnTrack = 0;
109 iSubDet->second.totNClustersOffTrack = 0;
120 std::map<std::string, MonitorElement*>::iterator iME;
121 std::map<std::string, LayerMEs>::iterator iLayerME;
123 for (std::map<std::string, SubDetMEs>::iterator iSubDet =
SubDetMEsMap.begin();
150 std::vector<uint32_t> vdetId_;
153 for (std::vector<uint32_t>::const_iterator detid_iter=vdetId_.begin();detid_iter!=vdetId_.end();detid_iter++){
154 uint32_t
detid = *detid_iter;
157 edm::LogError(
"SiStripMonitorTrack")<<
"[" <<__PRETTY_FUNCTION__ <<
"] invalid detid " << detid<< std::endl;
169 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_id);
194 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(hid);
249 hname = hidmanager.
createHistoLayer(
"Summary_ClusterStoNCorr",name,layer_id,
"OnTrack");
253 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeCorr",name,layer_id,
"OnTrack");
257 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge",name,layer_id,
"OnTrack");
260 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge",name,layer_id,
"OffTrack");
264 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise",name,layer_id,
"OnTrack");
267 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise",name,layer_id,
"OffTrack");
271 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth",name,layer_id,
"OnTrack");
274 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth",name,layer_id,
"OffTrack");
279 if (layer_id.find(
"TEC") != std::string::npos && !
flag_ring) total_nr_strips = 3 * 2 * 128;
281 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition",name,layer_id,
"OnTrack");
284 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition",name,layer_id,
"OffTrack");
296 subdet_tag =
"__" +
name;
311 completeName =
"Summary_TotalNumberOfClusters_OnTrack" +
subdet_tag;
316 completeName =
"Summary_TotalNumberOfClusters_OffTrack" +
subdet_tag;
321 completeName =
"Summary_ClusterStoNCorr_OnTrack" +
subdet_tag;
325 completeName =
"Summary_ClusterCharge_OffTrack" +
subdet_tag;
329 completeName =
"Summary_ClusterStoN_OffTrack" +
subdet_tag;
334 completeName =
"Trend_TotalNumberOfClusters_OnTrack" +
subdet_tag;
336 completeName =
"Trend_TotalNumberOfClusters_OffTrack" +
subdet_tag;
405 ParametersTrend.getParameter<int32_t>(
"Nbins"),
407 ParametersTrend.getParameter<int32_t>(
"Nbins"),
415 me->setAxisTitle(
"Event Time in Seconds",1);
426 if (!trackCollectionHandle.
isValid()){
434 if( !TItkAssociatorCollection.
isValid()){
435 edm::LogError(
"SiStripMonitorTrack")<<
"Association not found "<<std::endl;
446 <<
"Track number "<< i+1
447 <<
"\n\tmomentum: " << trackref->momentum()
448 <<
"\n\tPT: " << trackref->pt()
449 <<
"\n\tvertex: " << trackref->vertex()
450 <<
"\n\timpact parameter: " << trackref->d0()
451 <<
"\n\tcharge: " << trackref->charge()
452 <<
"\n\tnormalizedChi2: " << trackref->normalizedChi2()
453 <<
"\n\tFrom EXTRA : "
454 <<
"\n\t\touter PT "<< trackref->outerPt()<<std::endl;
457 const std::vector<TrajectoryMeasurement> & measurements = traj_iterator->measurements();
458 std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator;
460 for(std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator= measurements.begin();traj_mes_iterator!=measurements.end();traj_mes_iterator++){
467 if (!ttrh->isValid()) {
continue;}
472 const SiStripMatchedRecHit2D* matchedhit =
dynamic_cast<const SiStripMatchedRecHit2D*
>( ttrh->hit() );
473 const SiStripRecHit2D* hit2D =
dynamic_cast<const SiStripRecHit2D*
>( ttrh->hit() );
474 const SiStripRecHit1D* hit1D =
dynamic_cast<const SiStripRecHit1D*
>( ttrh->hit() );
479 LogTrace(
"SiStripMonitorTrack")<<
"\nMatched recHit found"<< std::endl;
486 statedirection=monodet->
toLocal(gtrkdirup);
487 SiStripRecHit2D
m = matchedhit->monoHit();
488 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&m,statedirection,trackref,es);
491 statedirection=stereodet->
toLocal(gtrkdirup);
492 SiStripRecHit2D
s = matchedhit->stereoHit();
493 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&s,statedirection,trackref,es);
496 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found"<< std::endl;
501 const SiStripRecHit2D& originalhit=phit->
originalHit();
505 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found MONO"<< std::endl;
507 statedirection=det->
toLocal(gtrkdirup);
508 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&(phit->
originalHit()),statedirection,trackref,es);
511 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found STEREO"<< std::endl;
514 statedirection=det->
toLocal(gtrkdirup);
515 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&(phit->
originalHit()),statedirection,trackref,es);
519 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(hit2D,statedirection,trackref,es);
522 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit1D>(hit1D,statedirection,trackref,es);
525 <<
" LocalMomentum: "<<statedirection
526 <<
"\nLocal x-z plane angle: "<<atan2(statedirection.
x(),statedirection.
z());
534 if(!tkrecHit->isValid()){
535 LogTrace(
"SiStripMonitorTrack") <<
"\t\t Invalid Hit " << std::endl;
539 const uint32_t&
detid = tkrecHit->geographicalId().rawId();
541 LogTrace(
"SiStripMonitorTrack") <<
"Modules Excluded" << std::endl;
546 <<
"\n\t\tRecHit on det "<<tkrecHit->geographicalId().rawId()
547 <<
"\n\t\tRecHit in LP "<<tkrecHit->localPosition()
548 <<
"\n\t\tRecHit in GP "<<
tkgeom->idToDet(tkrecHit->geographicalId())->surface().toGlobal(tkrecHit->localPosition())
549 <<
"\n\t\tRecHit trackLocal vector "<<LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() <<std::endl;
558 if ( tkrecHit !=
NULL ){
566 edm::LogError(
"SiStripMonitorTrack") <<
"NULL hit" << std::endl;
582 if (!siStripClusterHandle.
isValid()){
583 edm::LogError(
"SiStripMonitorTrack")<<
"ClusterCollection is not valid!!" << std::endl;
588 uint32_t
detid=DSViter->id();
591 LogDebug(
"SiStripMonitorTrack") <<
"on detid "<< detid <<
" N Cluster= " << DSViter->size();
593 for(; ClusIter!=DSViter->
end(); ClusIter++) {
605 if (cluster==0)
return false;
615 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(sdet_pair.second);
617 if (flag ==
OnTrack) iSubdet->second.totNClustersOnTrack++;
618 else if (flag ==
OffTrack) iSubdet->second.totNClustersOffTrack++;
622 LogDebug(
"SiStripMonitorTrack")<<
"\n\tLV " << LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() <<
" " << LV.
mag() << std::endl;
624 cosRZ= fabs(LV.
z())/LV.
mag();
625 LogDebug(
"SiStripMonitorTrack")<<
"\n\t cosRZ " << cosRZ << std::endl;
630 fillMEs(cluster,detid,tTopo,cosRZ,flag);
635 uint32_t adet=cluster->
detId();
641 LogDebug(
"SiStripMonitorTrack") <<
"Module " << detid <<
" in Event " <<
eventNb <<
" noise " << noise << std::endl;
645 if(cluster->
charge() > 250){
646 LogDebug(
"SiStripMonitorTrack") <<
"Module firing " << detid <<
" in Event " <<
eventNb << std::endl;
665 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(name);
674 if(noise > 0.0)
fillME(iModME->second.ClusterStoNCorr ,StoN*cos);
675 if(noise == 0.0)
LogDebug(
"SiStripMonitorTrack") <<
"Module " << name <<
" in Event " <<
eventNb <<
" noise " << noise << std::endl;
676 fillME(iModME->second.ClusterCharge,charge);
678 fillME(iModME->second.ClusterChargeCorr,charge*cos);
680 fillME(iModME->second.ClusterWidth ,width);
681 fillME(iModME->second.ClusterPos ,position);
685 int PGVposCounter = cluster->
maxIndex();
687 fillME(iModME->second.ClusterPGV,
i,0.);
688 for (std::vector<uint8_t>::const_iterator it=cluster->
stripCharges().begin();it<cluster->
stripCharges().end();++it) {
689 fillME(iModME->second.ClusterPGV, PGVposCounter++,(*it)/PGVmax);
692 fillME(iModME->second.ClusterPGV,
i,0.);
711 std::map<std::string, LayerMEs>::iterator iLayer =
LayerMEsMap.find(layer_id);
714 if(noise > 0.0)
fillME(iLayer->second.ClusterStoNCorrOnTrack, StoN*cos);
716 fillME(iLayer->second.ClusterChargeCorrOnTrack, charge*cos);
717 fillME(iLayer->second.ClusterChargeOnTrack, charge);
718 fillME(iLayer->second.ClusterNoiseOnTrack, noise);
719 fillME(iLayer->second.ClusterWidthOnTrack, width);
720 fillME(iLayer->second.ClusterPosOnTrack, position);
722 fillME(iLayer->second.ClusterChargeOffTrack, charge);
723 fillME(iLayer->second.ClusterNoiseOffTrack, noise);
724 fillME(iLayer->second.ClusterWidthOffTrack, width);
725 fillME(iLayer->second.ClusterPosOffTrack, position);
728 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(sdet_pair.second);
731 if(noise > 0.0)
fillME(iSubdet->second.ClusterStoNCorrOnTrack,StoN*cos);
733 fillME(iSubdet->second.ClusterChargeOffTrack,charge);
734 if(noise > 0.0)
fillME(iSubdet->second.ClusterStoNOffTrack,StoN);
743 tag = folder_name.substr(folder_name.find(
"MechanicalView")+15);
744 if (tag.find(
"side_") != std::string::npos) {
745 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 &)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void trackStudy(const edm::Event &ev, 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_
MonitorElement * nClustersTrendOnTrack
MonitorElement * ClusterPosOffTrack
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.
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
void bookLayerMEs(const uint32_t &, std::string &)
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
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * bookMETrend(const char *, const char *)
void getSubDetTag(std::string &folder_name, std::string &tag)
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
std::map< std::string, LayerMEs > LayerMEsMap
void RecHitInfo(const T *tkrecHit, LocalVector LV, reco::TrackRef track_ref, const edm::EventSetup &)