30 tracksCollection_in_EventTree(
true),
69 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::beginRun] There are "<<
tkgeom->detUnits().size() <<
" detectors instantiated in the geometry" << std::endl;
97 LogDebug(
"SiStripMonitorTrack") <<
"[SiStripMonitorTrack::analyse] " <<
"Run " << e.
id().
run() <<
" Event " << e.
id().
event() << std::endl;
105 for (std::map<std::string, SubDetMEs>::iterator iSubDet =
SubDetMEsMap.begin();
107 iSubDet->second.totNClustersOnTrack = 0;
108 iSubDet->second.totNClustersOffTrack = 0;
119 std::map<std::string, MonitorElement*>::iterator iME;
120 std::map<std::string, LayerMEs>::iterator iLayerME;
122 for (std::map<std::string, SubDetMEs>::iterator iSubDet =
SubDetMEsMap.begin();
149 std::vector<uint32_t> vdetId_;
152 for (std::vector<uint32_t>::const_iterator detid_iter=vdetId_.begin();detid_iter!=vdetId_.end();detid_iter++){
153 uint32_t
detid = *detid_iter;
156 edm::LogError(
"SiStripMonitorTrack")<<
"[" <<__PRETTY_FUNCTION__ <<
"] invalid detid " << detid<< std::endl;
168 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_id);
190 std::string
name =
"det";
193 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(hid);
231 std::string
name =
"layer";
248 hname = hidmanager.
createHistoLayer(
"Summary_ClusterStoNCorr",name,layer_id,
"OnTrack");
252 hname = hidmanager.
createHistoLayer(
"Summary_ClusterChargeCorr",name,layer_id,
"OnTrack");
256 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge",name,layer_id,
"OnTrack");
259 hname = hidmanager.
createHistoLayer(
"Summary_ClusterCharge",name,layer_id,
"OffTrack");
263 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise",name,layer_id,
"OnTrack");
266 hname = hidmanager.
createHistoLayer(
"Summary_ClusterNoise",name,layer_id,
"OffTrack");
270 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth",name,layer_id,
"OnTrack");
273 hname = hidmanager.
createHistoLayer(
"Summary_ClusterWidth",name,layer_id,
"OffTrack");
278 if (layer_id.find(
"TEC") != std::string::npos && !
flag_ring) total_nr_strips = 3 * 2 * 128;
280 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition",name,layer_id,
"OnTrack");
283 hname = hidmanager.
createHistoLayer(
"Summary_ClusterPosition",name,layer_id,
"OffTrack");
295 subdet_tag =
"__" +
name;
296 std::string completeName;
310 completeName =
"Summary_TotalNumberOfClusters_OnTrack" +
subdet_tag;
315 completeName =
"Summary_TotalNumberOfClusters_OffTrack" +
subdet_tag;
320 completeName =
"Summary_ClusterStoNCorr_OnTrack" +
subdet_tag;
324 completeName =
"Summary_ClusterCharge_OffTrack" +
subdet_tag;
328 completeName =
"Summary_ClusterStoN_OffTrack" +
subdet_tag;
333 completeName =
"Trend_TotalNumberOfClusters_OnTrack" +
subdet_tag;
335 completeName =
"Trend_TotalNumberOfClusters_OffTrack" +
subdet_tag;
404 ParametersTrend.getParameter<int32_t>(
"Nbins"),
406 ParametersTrend.getParameter<int32_t>(
"Nbins"),
414 me->setAxisTitle(
"Event Time in Seconds",1);
425 if (!trackCollectionHandle.
isValid()){
433 if( !TItkAssociatorCollection.
isValid()){
434 edm::LogError(
"SiStripMonitorTrack")<<
"Association not found "<<std::endl;
445 <<
"Track number "<< i+1
446 <<
"\n\tmomentum: " << trackref->momentum()
447 <<
"\n\tPT: " << trackref->pt()
448 <<
"\n\tvertex: " << trackref->vertex()
449 <<
"\n\timpact parameter: " << trackref->d0()
450 <<
"\n\tcharge: " << trackref->charge()
451 <<
"\n\tnormalizedChi2: " << trackref->normalizedChi2()
452 <<
"\n\tFrom EXTRA : "
453 <<
"\n\t\touter PT "<< trackref->outerPt()<<std::endl;
456 const std::vector<TrajectoryMeasurement> & measurements = traj_iterator->measurements();
457 std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator;
459 for(std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator= measurements.begin();traj_mes_iterator!=measurements.end();traj_mes_iterator++){
466 if (!ttrh->isValid()) {
continue;}
478 LogTrace(
"SiStripMonitorTrack")<<
"\nMatched recHit found"<< std::endl;
485 statedirection=monodet->
toLocal(gtrkdirup);
486 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(matchedhit->
monoHit(),statedirection,trackref,es);
489 statedirection=stereodet->
toLocal(gtrkdirup);
490 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(matchedhit->
stereoHit(),statedirection,trackref,es);
493 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found"<< std::endl;
502 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found MONO"<< std::endl;
504 statedirection=det->
toLocal(gtrkdirup);
505 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&(phit->
originalHit()),statedirection,trackref,es);
508 LogTrace(
"SiStripMonitorTrack")<<
"\nProjected recHit found STEREO"<< std::endl;
511 statedirection=det->
toLocal(gtrkdirup);
512 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(&(phit->
originalHit()),statedirection,trackref,es);
516 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit2D>(hit2D,statedirection,trackref,es);
519 if(statedirection.
mag() != 0) RecHitInfo<SiStripRecHit1D>(hit1D,statedirection,trackref,es);
522 <<
" LocalMomentum: "<<statedirection
523 <<
"\nLocal x-z plane angle: "<<atan2(statedirection.
x(),statedirection.
z());
531 if(!tkrecHit->isValid()){
532 LogTrace(
"SiStripMonitorTrack") <<
"\t\t Invalid Hit " << std::endl;
536 const uint32_t&
detid = tkrecHit->geographicalId().rawId();
538 LogTrace(
"SiStripMonitorTrack") <<
"Modules Excluded" << std::endl;
543 <<
"\n\t\tRecHit on det "<<tkrecHit->geographicalId().rawId()
544 <<
"\n\t\tRecHit in LP "<<tkrecHit->localPosition()
545 <<
"\n\t\tRecHit in GP "<<
tkgeom->idToDet(tkrecHit->geographicalId())->surface().toGlobal(tkrecHit->localPosition())
546 <<
"\n\t\tRecHit trackLocal vector "<<LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() <<std::endl;
549 if ( tkrecHit !=
NULL ){
553 if (
clusterInfos(&SiStripClusterInfo_,detid,
"OnTrack", LV ) ) {
557 edm::LogError(
"SiStripMonitorTrack") <<
"NULL hit" << std::endl;
567 if (!siStripClusterHandle.
isValid()){
568 edm::LogError(
"SiStripMonitorTrack")<<
"ClusterCollection is not valid!!" << std::endl;
573 uint32_t
detid=DSViter->id();
576 LogDebug(
"SiStripMonitorTrack") <<
"on detid "<< detid <<
" N Cluster= " << DSViter->size();
578 for(; ClusIter!=DSViter->
end(); ClusIter++) {
591 if (cluster==0)
return false;
601 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(sdet_pair.second);
603 if (flag==
"OnTrack") iSubdet->second.totNClustersOnTrack++;
604 else if (flag==
"OffTrack") iSubdet->second.totNClustersOffTrack++;
608 LogDebug(
"SiStripMonitorTrack")<<
"\n\tLV " << LV.
x() <<
" " << LV.
y() <<
" " << LV.
z() <<
" " << LV.
mag() << std::endl;
610 cosRZ= fabs(LV.
z())/LV.
mag();
611 LogDebug(
"SiStripMonitorTrack")<<
"\n\t cosRZ " << cosRZ << std::endl;
616 fillMEs(cluster,detid,cosRZ,flag);
621 uint32_t adet=cluster->
detId();
626 else if(flag==
"OffTrack"){
628 if(cluster->
charge() > 250){
629 LogDebug(
"SiStripMonitorTrack") <<
"Module firing " << detid <<
" in Event " <<
eventNb << std::endl;
648 std::map<std::string, ModMEs>::iterator iModME =
ModMEsMap.find(name);
656 fillME(iModME->second.ClusterStoNCorr ,StoN*cos);
657 fillME(iModME->second.ClusterCharge,charge);
659 fillME(iModME->second.ClusterChargeCorr,charge*cos);
661 fillME(iModME->second.ClusterWidth ,width);
662 fillME(iModME->second.ClusterPos ,position);
666 int PGVposCounter = cluster->
maxIndex();
668 fillME(iModME->second.ClusterPGV,
i,0.);
669 for (std::vector<uint8_t>::const_iterator it=cluster->
stripCharges().begin();it<cluster->
stripCharges().end();++it) {
670 fillME(iModME->second.ClusterPGV, PGVposCounter++,(*it)/PGVmax);
673 fillME(iModME->second.ClusterPGV,
i,0.);
693 std::map<std::string, LayerMEs>::iterator iLayer =
LayerMEsMap.find(layer_id);
696 fillME(iLayer->second.ClusterStoNCorrOnTrack, StoN*cos);
697 fillME(iLayer->second.ClusterChargeCorrOnTrack, charge*cos);
698 fillME(iLayer->second.ClusterChargeOnTrack, charge);
699 fillME(iLayer->second.ClusterNoiseOnTrack, noise);
700 fillME(iLayer->second.ClusterWidthOnTrack, width);
701 fillME(iLayer->second.ClusterPosOnTrack, position);
703 fillME(iLayer->second.ClusterChargeOffTrack, charge);
704 fillME(iLayer->second.ClusterNoiseOffTrack, noise);
705 fillME(iLayer->second.ClusterWidthOffTrack, width);
706 fillME(iLayer->second.ClusterPosOffTrack, position);
709 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(sdet_pair.second);
712 fillME(iSubdet->second.ClusterStoNCorrOnTrack,StoN*cos);
714 fillME(iSubdet->second.ClusterChargeOffTrack,charge);
715 fillME(iSubdet->second.ClusterStoNOffTrack,StoN);
724 tag = folder_name.substr(folder_name.find(
"MechanicalView")+15);
725 if (tag.find(
"side_") != std::string::npos) {
726 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)
const SiStripRecHit2D * stereoHit() const
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 clusterInfos(SiStripClusterInfo *cluster, const uint32_t &detid, std::string flag, LocalVector LV)
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_
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 fillMEs(SiStripClusterInfo *, uint32_t detid, float, std::string)
void bookSubDetMEs(std::string &name)
static int position[TOTALCHAMBERS][3]
math::XYZTLorentzVectorD LV
MonitorElement * ClusterPGV
MonitorElement * nClustersTrendOffTrack
void tag(MonitorElement *me, unsigned int myTag)
uint32_t rawId() const
get the raw id
LocalVector localMomentum() const
MonitorElement * ClusterCharge
bool getStatus(edm::Event const &e, edm::EventSetup const &eSetup)
float signalOverNoise() const
std::string getSubdetid(uint32_t id, bool flag_ring)
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)
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 beginedm::Run() 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.
const SiStripRecHit2D * monoHit() const
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::vector< edm::ParameterSet > Parameters
std::map< std::string, LayerMEs > LayerMEsMap
void RecHitInfo(const T *tkrecHit, LocalVector LV, reco::TrackRef track_ref, const edm::EventSetup &)