30 tracksCollection_in_EventTree(
true),
41 layerontrack = ParametersClustersOn.getParameter<
bool>(
"layerswitchon");
44 layerofftrack = ParametersClustersOff.getParameter<
bool>(
"layerswitchon");
47 layercharge = ParametersClusterCharge.getParameter<
bool>(
"layerswitchon");
50 layerston = ParametersClusterStoN.getParameter<
bool>(
"layerswitchon");
53 layerchargecorr = ParametersClusterChargeCorr.getParameter<
bool>(
"layerswitchon");
59 layernoise = ParametersClusterNoise.getParameter<
bool>(
"layerswitchon");
62 layerwidth = ParametersClusterWidth.getParameter<
bool>(
"layerswitchon");
93 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::beginRun] There are "<<
tkgeom->detUnits().size() <<
" detectors instantiated in the geometry" << std::endl;
121 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::analyse] " <<
"Run " << e.
id().
run() <<
" Event " << e.
id().
event() << std::endl;
129 for (std::map<std::string, SubDetMEs>::iterator iSubDet =
SubDetMEsMap.begin();
131 iSubDet->second.totNClustersOnTrack = 0;
132 iSubDet->second.totNClustersOffTrack = 0;
143 std::map<std::string, MonitorElement*>::iterator iME;
144 std::map<std::string, LayerMEs>::iterator iLayerME;
146 for (std::map<std::string, SubDetMEs>::iterator iSubDet =
SubDetMEsMap.begin();
171 std::vector<uint32_t> vdetId_;
174 for (std::vector<uint32_t>::const_iterator detid_iter=vdetId_.begin();detid_iter!=vdetId_.end();detid_iter++){
175 uint32_t
detid = *detid_iter;
178 edm::LogError(
"SiStripMonitorTrack")<<
"[" <<__PRETTY_FUNCTION__ <<
"] invalid detid " << detid<< std::endl;
190 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_id);
212 std::string
name =
"det";
215 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(hid);
253 std::string
name =
"layer";
271 hname = hidmanager.
createHistoLayer(
"Summary_ClusterStoNCorr",name,layer_id,
"OnTrack");
276 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeCorr",name,layer_id,
"OnTrack");
281 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge",name,layer_id,
"OnTrack");
284 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge",name,layer_id,
"OffTrack");
289 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise",name,layer_id,
"OnTrack");
292 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise",name,layer_id,
"OffTrack");
297 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth",name,layer_id,
"OnTrack");
300 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth",name,layer_id,
"OffTrack");
305 if (layer_id.find(
"TEC") != std::string::npos && !
flag_ring) total_nr_strips = 3 * 2 * 128;
307 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition",name,layer_id,
"OnTrack");
310 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition",name,layer_id,
"OffTrack");
322 subdet_tag =
"__" +
name;
323 std::string completeName;
337 completeName =
"Summary_TotalNumberOfClusters_OnTrack" +
subdet_tag;
342 completeName =
"Summary_TotalNumberOfClusters_OffTrack" +
subdet_tag;
347 completeName =
"Summary_ClusterStoNCorr_OnTrack" +
subdet_tag;
351 completeName =
"Summary_ClusterCharge_OffTrack" +
subdet_tag;
355 completeName =
"Summary_ClusterStoN_OffTrack" +
subdet_tag;
360 completeName =
"Trend_TotalNumberOfClusters_OnTrack" +
subdet_tag;
362 completeName =
"Trend_TotalNumberOfClusters_OffTrack" +
subdet_tag;
431 ParametersTrend.getParameter<int32_t>(
"Nbins"),
433 ParametersTrend.getParameter<int32_t>(
"Nbins"),
441 me->setAxisTitle(
"Event Time in Seconds",1);
452 if (!trackCollectionHandle.
isValid()){
460 if( !TItkAssociatorCollection.
isValid()){
461 edm::LogError(
"SiStripMonitorTrack")<<
"Association not found "<<std::endl;
472 <<
"Track number "<< i+1
473 <<
"\n\tmomentum: " << trackref->momentum()
474 <<
"\n\tPT: " << trackref->pt()
475 <<
"\n\tvertex: " << trackref->vertex()
476 <<
"\n\timpact parameter: " << trackref->d0()
477 <<
"\n\tcharge: " << trackref->charge()
478 <<
"\n\tnormalizedChi2: " << trackref->normalizedChi2()
479 <<
"\n\tFrom EXTRA : "
480 <<
"\n\t\touter PT "<< trackref->outerPt()<<std::endl;
483 const std::vector<TrajectoryMeasurement> & measurements = traj_iterator->measurements();
484 std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator;
486 for(std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator= measurements.begin();traj_mes_iterator!=measurements.end();traj_mes_iterator++){
493 if (!ttrh->isValid()) {
continue;}
498 const SiStripMatchedRecHit2D* matchedhit =
dynamic_cast<const SiStripMatchedRecHit2D*
>( ttrh->hit() );
499 const SiStripRecHit2D* hit2D =
dynamic_cast<const SiStripRecHit2D*
>( ttrh->hit() );
500 const SiStripRecHit1D* hit1D =
dynamic_cast<const SiStripRecHit1D*
>( ttrh->hit() );
505 LogTrace(
"SiStripMonitorTrack")<<
"\nMatched recHit found"<< std::endl;
512 statedirection=monodet->
toLocal(gtrkdirup);
513 SiStripRecHit2D
m = matchedhit->monoHit();
514 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&m,statedirection,trackref,es);
517 statedirection=stereodet->
toLocal(gtrkdirup);
518 SiStripRecHit2D
s = matchedhit->stereoHit();
519 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&s,statedirection,trackref,es);
522 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found"<< std::endl;
527 const SiStripRecHit2D& originalhit=phit->
originalHit();
531 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found MONO"<< std::endl;
533 statedirection=det->
toLocal(gtrkdirup);
534 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&(phit->
originalHit()),statedirection,trackref,es);
537 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found STEREO"<< std::endl;
540 statedirection=det->
toLocal(gtrkdirup);
541 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&(phit->
originalHit()),statedirection,trackref,es);
545 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(hit2D,statedirection,trackref,es);
548 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit1D>(hit1D,statedirection,trackref,es);
551 <<
" LocalMomentum: "<<statedirection
552 <<
"\nLocal x-z plane angle: "<<atan2(statedirection.
x(),statedirection.
z());
560 if(!tkrecHit->isValid()){
561 LogTrace(
"SiStripMonitorTrack") <<
"\t\t Invalid Hit " << std::endl;
565 const uint32_t&
detid = tkrecHit->geographicalId().rawId();
567 LogTrace(
"SiStripMonitorTrack") <<
"Modules Excluded" << std::endl;
572 <<
"\n\t\tRecHit on det "<<tkrecHit->geographicalId().rawId()
573 <<
"\n\t\tRecHit in LP "<<tkrecHit->localPosition()
574 <<
"\n\t\tRecHit in GP "<<
tkgeom->idToDet(tkrecHit->geographicalId())->surface().toGlobal(tkrecHit->localPosition())
575 <<
"\n\t\tRecHit trackLocal vector "<<LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() <<std::endl;
578 if ( tkrecHit !=
NULL ){
586 edm::LogError(
"SiStripMonitorTrack") <<
"NULL hit" << std::endl;
596 if (!siStripClusterHandle.
isValid()){
597 edm::LogError(
"SiStripMonitorTrack")<<
"ClusterCollection is not valid!!" << std::endl;
602 uint32_t
detid=DSViter->id();
605 LogDebug(
"SiStripMonitorTrack") <<
"on detid "<< detid <<
" N Cluster= " << DSViter->size();
607 for(; ClusIter!=DSViter->
end(); ClusIter++) {
619 if (cluster==0)
return false;
629 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(sdet_pair.second);
631 if (flag ==
OnTrack) iSubdet->second.totNClustersOnTrack++;
632 else if (flag ==
OffTrack) iSubdet->second.totNClustersOffTrack++;
636 LogDebug(
"SiStripMonitorTrack")<<
"\n\tLV " << LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() <<
" " << LV.
mag() << std::endl;
638 cosRZ= fabs(LV.
z())/LV.
mag();
639 LogDebug(
"SiStripMonitorTrack")<<
"\n\t cosRZ " << cosRZ << std::endl;
644 fillMEs(cluster,detid,cosRZ,flag);
649 uint32_t adet=cluster->
detId();
655 LogDebug(
"SiStripMonitorTrack") <<
"Module " << detid <<
" in Event " <<
eventNb <<
" noise " << noise << std::endl;
659 if(cluster->
charge() > 250){
660 LogDebug(
"SiStripMonitorTrack") <<
"Module firing " << detid <<
" in Event " <<
eventNb << std::endl;
679 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(name);
688 if(noise > 0.0)
fillME(iModME->second.ClusterStoNCorr ,StoN*cos);
689 if(noise == 0.0)
LogDebug(
"SiStripMonitorTrack") <<
"Module " << name <<
" in Event " <<
eventNb <<
" noise " << noise << std::endl;
690 fillME(iModME->second.ClusterCharge,charge);
692 fillME(iModME->second.ClusterChargeCorr,charge*cos);
694 fillME(iModME->second.ClusterWidth ,width);
695 fillME(iModME->second.ClusterPos ,position);
699 int PGVposCounter = cluster->
maxIndex();
701 fillME(iModME->second.ClusterPGV,
i,0.);
702 for (std::vector<uint8_t>::const_iterator it=cluster->
stripCharges().begin();it<cluster->
stripCharges().end();++it) {
703 fillME(iModME->second.ClusterPGV, PGVposCounter++,(*it)/PGVmax);
706 fillME(iModME->second.ClusterPGV,
i,0.);
725 std::map<std::string, LayerMEs>::iterator iLayer =
LayerMEsMap.find(layer_id);
734 fillME(iLayer->second.ClusterPosOnTrack, position);
739 fillME(iLayer->second.ClusterPosOffTrack, position);
742 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(sdet_pair.second);
745 if(noise > 0.0)
fillME(iSubdet->second.ClusterStoNCorrOnTrack,StoN*cos);
747 fillME(iSubdet->second.ClusterChargeOffTrack,charge);
748 if(noise > 0.0)
fillME(iSubdet->second.ClusterStoNOffTrack,StoN);
757 tag = folder_name.substr(folder_name.find(
"MechanicalView")+15);
758 if (tag.find(
"side_") != std::string::npos) {
759 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
bool clusterInfos(SiStripClusterInfo *cluster, const uint32_t &detid, enum ClusterFlags flags, LocalVector LV)
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")
bool layerstoncorrontrack
void bookLayerMEs(const uint32_t &, std::string &)
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
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_
void fillMEs(SiStripClusterInfo *, uint32_t detid, float, enum ClusterFlags)
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 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
std::string getSubdetid(uint32_t id, bool flag_ring)
vector< ParameterSet > Parameters
std::pair< std::string, std::string > getSubDetFolderAndTag(const uint32_t &detid)
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
void setDetectorFolder(uint32_t rawdetid=0)
SiStripFolderOrganizer folderOrganizer_
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
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.
MonitorElement * ClusterChargeOffTrack
std::map< std::string, ModMEs > ModMEsMap
MonitorElement * ClusterPos
MonitorElement * ClusterChargeCorrOnTrack
TkHistoMap * tkhisto_NumOnTrack
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 *)
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, bool ring_flag=0)
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 *)
void setLayerFolder(uint32_t rawdetid=0, int32_t layer=0, bool ring_flag=0)
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 &)