CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
SiStripMonitorTrack Class Reference

#include <SiStripMonitorTrack.h>

Inheritance diagram for SiStripMonitorTrack:
thread_unsafe::DQMEDAnalyzer edm::EDAnalyzer edm::EDConsumerBase

Classes

struct  LayerMEs
 
struct  ModMEs
 
struct  SubDetMEs
 

Public Types

typedef
TrackingRecHit::ConstRecHitPointer 
ConstRecHitPointer
 
enum  RecHitType { Single =0, Matched =1, Projected =2, Null =3 }
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &run, const edm::EventSetup &es)
 
virtual void endJob (void)
 
 SiStripMonitorTrack (const edm::ParameterSet &)
 
 ~SiStripMonitorTrack ()
 
- Public Member Functions inherited from thread_unsafe::DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
 DQMEDAnalyzer (void)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

enum  ClusterFlags { OffTrack, OnTrack }
 

Private Member Functions

void AllClusters (const edm::Event &ev, const edm::EventSetup &es)
 
void book (DQMStore::IBooker &, const TrackerTopology *tTopo)
 
void bookLayerMEs (DQMStore::IBooker &, const uint32_t &, std::string &)
 
MonitorElementbookME1D (DQMStore::IBooker &, const char *, const char *)
 
MonitorElementbookME2D (DQMStore::IBooker &, const char *, const char *)
 
MonitorElementbookME3D (DQMStore::IBooker &, const char *, const char *)
 
MonitorElementbookMEProfile (DQMStore::IBooker &, const char *, const char *)
 
MonitorElementbookMETrend (DQMStore::IBooker &, const char *, const char *)
 
void bookModMEs (DQMStore::IBooker &, const uint32_t &)
 
void bookSubDetMEs (DQMStore::IBooker &, std::string &name)
 
bool clusterInfos (SiStripClusterInfo *cluster, const uint32_t &detid, const TrackerTopology *tTopo, enum ClusterFlags flags, LocalVector LV)
 
void fillME (MonitorElement *ME, float value1)
 
void fillME (MonitorElement *ME, float value1, float value2)
 
void fillME (MonitorElement *ME, float value1, float value2, float value3)
 
void fillME (MonitorElement *ME, float value1, float value2, float value3, float value4)
 
void fillMEs (SiStripClusterInfo *, uint32_t detid, const TrackerTopology *tTopo, float, enum ClusterFlags)
 
void fillModMEs (SiStripClusterInfo *, std::string, float)
 
void getSubDetTag (std::string &folder_name, std::string &tag)
 
void hitStudy (const edm::EventSetup &es, const ProjectedSiStripRecHit2D *projhit, const SiStripMatchedRecHit2D *matchedhit, const SiStripRecHit2D *hit2D, const SiStripRecHit1D *hit1D, LocalVector localMomentum)
 
template<class T >
void RecHitInfo (const T *tkrecHit, LocalVector LV, const edm::EventSetup &)
 
void trackStudy (const edm::Event &ev, const edm::EventSetup &es)
 
void trackStudyFromTrack (edm::Handle< reco::TrackCollection > trackCollectionHandle, const edm::EventSetup &es)
 
void trackStudyFromTrajectory (edm::Handle< TrajTrackAssociationCollection > TItkAssociatorCollection, const edm::EventSetup &es)
 
void trajectoryStudy (const edm::Ref< std::vector< Trajectory > > traj, const edm::EventSetup &es)
 

Private Attributes

bool applyClusterQuality_
 
edm::InputTag Cluster_src_
 
edm::EDGetTokenT
< edmNew::DetSetVector
< SiStripCluster > > 
clusterToken_
 
edm::ParameterSet conf_
 
DQMStoredbe
 
SiStripDCSStatusdcsStatus_
 
edm::EventNumber_t eventNb
 
int firstEvent
 
bool flag_ring
 
SiStripFolderOrganizer folderOrganizer_
 
GenericTriggerEventFlaggenTriggerEventFlag_
 
std::string histname
 
bool HistoFlag_On_
 
float iOrbitSec
 
std::map< std::string, LayerMEsLayerMEsMap
 
LocalVector LV
 
bool Mod_On_
 
std::map< std::string, ModMEsModMEsMap
 
bool OffHisto_On_
 
edm::ParameterSet Parameters
 
bool ring_flag
 
edm::ESHandle< SiStripDetCablingSiStripDetCabling_
 
double sToNLowerLimit_
 
double sToNUpperLimit_
 
std::map< std::string, SubDetMEsSubDetMEsMap
 
edm::ESHandle< TrackerGeometrytkgeom_
 
TkHistoMaptkhisto_NumOffTrack
 
TkHistoMaptkhisto_NumOnTrack
 
TkHistoMaptkhisto_StoNCorrOnTrack
 
bool TkHistoMap_On_
 
std::string topFolderName_
 
bool trackAssociatorCollection_in_EventTree
 
std::string TrackLabel_
 
std::string TrackProducer_
 
bool tracksCollection_in_EventTree
 
edm::EDGetTokenT
< reco::TrackCollection
trackToken_
 
edm::EDGetTokenT
< TrajTrackAssociationCollection
trackTrajToken_
 
bool Trend_On_
 
std::unordered_set< const
SiStripCluster * > 
vPSiStripCluster
 
double widthLowerLimit_
 
double widthUpperLimit_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 61 of file SiStripMonitorTrack.h.

Member Typedef Documentation

Definition at line 63 of file SiStripMonitorTrack.h.

Member Enumeration Documentation

Enumerator
OffTrack 
OnTrack 

Definition at line 73 of file SiStripMonitorTrack.h.

Constructor & Destructor Documentation

SiStripMonitorTrack::SiStripMonitorTrack ( const edm::ParameterSet conf)
explicit

Definition at line 24 of file SiStripMonitorTrack.cc.

References applyClusterQuality_, Cluster_src_, clusterToken_, conf_, edm::EDConsumerBase::consumesCollector(), dcsStatus_, flag_ring, edm::ParameterSet::getParameter(), Mod_On_, sToNLowerLimit_, sToNUpperLimit_, AlCaHLTBitMon_QueryRunRegistry::string, TkHistoMap_On_, topFolderName_, TrackLabel_, TrackProducer_, trackToken_, trackTrajToken_, Trend_On_, widthLowerLimit_, and widthUpperLimit_.

24  :
26  conf_(conf),
28  firstEvent(-1),
30 {
31  Cluster_src_ = conf.getParameter<edm::InputTag>("Cluster_src");
32  Mod_On_ = conf.getParameter<bool>("Mod_On");
33  Trend_On_ = conf.getParameter<bool>("Trend_On");
34  flag_ring = conf.getParameter<bool>("RingFlag_On");
35  TkHistoMap_On_ = conf.getParameter<bool>("TkHistoMap_On");
36 
37  TrackProducer_ = conf_.getParameter<std::string>("TrackProducer");
38  TrackLabel_ = conf_.getParameter<std::string>("TrackLabel");
39 
40  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
41 
42  clusterToken_ = consumes<edmNew::DetSetVector<SiStripCluster> >(Cluster_src_);
43  trackToken_ = consumes<reco::TrackCollection>(edm::InputTag(TrackProducer_,TrackLabel_) );
44  trackTrajToken_ = consumes<TrajTrackAssociationCollection>(edm::InputTag(TrackProducer_,TrackLabel_) );
45 
46  // cluster quality conditions
47  edm::ParameterSet cluster_condition = conf_.getParameter<edm::ParameterSet>("ClusterConditions");
48  applyClusterQuality_ = cluster_condition.getParameter<bool>("On");
49  sToNLowerLimit_ = cluster_condition.getParameter<double>("minStoN");
50  sToNUpperLimit_ = cluster_condition.getParameter<double>("maxStoN");
51  widthLowerLimit_ = cluster_condition.getParameter<double>("minWidth");
52  widthUpperLimit_ = cluster_condition.getParameter<double>("maxWidth");
53 
54 
55  // Create DCS Status
56  bool checkDCS = conf_.getParameter<bool>("UseDCSFiltering");
57  if (checkDCS) dcsStatus_ = new SiStripDCSStatus(consumesCollector());
58  else dcsStatus_ = 0;
59 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > trackToken_
SiStripDCSStatus * dcsStatus_
edm::ParameterSet conf_
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< TrajTrackAssociationCollection > trackTrajToken_
GenericTriggerEventFlag * genTriggerEventFlag_
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
SiStripMonitorTrack::~SiStripMonitorTrack ( )

Definition at line 62 of file SiStripMonitorTrack.cc.

References dcsStatus_, and genTriggerEventFlag_.

62  {
63  if (dcsStatus_) delete dcsStatus_;
65 }
SiStripDCSStatus * dcsStatus_
GenericTriggerEventFlag * genTriggerEventFlag_

Member Function Documentation

void SiStripMonitorTrack::AllClusters ( const edm::Event ev,
const edm::EventSetup es 
)
private

Definition at line 754 of file SiStripMonitorTrack.cc.

References clusterInfos(), clusterToken_, cond::rpcobgas::detid, edm::EventSetup::get(), edm::Event::getByToken(), edm::HandleBase::isValid(), LogDebug, OffTrack, edm::ESHandle< class >::product(), and vPSiStripCluster.

Referenced by analyze().

755 {
756 
757  // std::cout << "[SiStripMonitorTrack::AllClusters] starting .. " << std::endl;
758  //Retrieve tracker topology from geometry
759  edm::ESHandle<TrackerTopology> tTopoHandle;
760  es.get<IdealGeometryRecord>().get(tTopoHandle);
761  const TrackerTopology* const tTopo = tTopoHandle.product();
762 
764  ev.getByToken( clusterToken_, siStripClusterHandle);
765  if (!siStripClusterHandle.isValid()){
766  edm::LogError("SiStripMonitorTrack")<< "ClusterCollection is not valid!!" << std::endl;
767  return;
768  }
769  else
770  {
771  // std::cout << "[SiStripMonitorTrack::AllClusters] OK cluster collection: " << siStripClusterHandle->size() << std::endl;
772 
773  //Loop on Dets
774  for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter=siStripClusterHandle->begin();
775  DSViter!=siStripClusterHandle->end();
776  DSViter++)
777  {
778  uint32_t detid=DSViter->id();
779 
780  LogDebug("SiStripMonitorTrack") << "on detid "<< detid << " N Cluster= " << DSViter->size();
781 
782  //Loop on Clusters
784  ClusIter!=DSViter->end();
785  ClusIter++)
786  {
787  if (vPSiStripCluster.find(&*ClusIter) == vPSiStripCluster.end())
788  {
789  SiStripClusterInfo SiStripClusterInfo_(*ClusIter,es,detid);
790  clusterInfos(&SiStripClusterInfo_,detid,tTopo,OffTrack,LV);
791  }
792  }
793  }
794  }
795 }
#define LogDebug(id)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
data_type const * const_iterator
Definition: DetSetNew.h:30
edmNew::DetSet< SiStripCluster >::const_iterator ClusIter
math::XYZTLorentzVectorD LV
std::unordered_set< const SiStripCluster * > vPSiStripCluster
bool isValid() const
Definition: HandleBase.h:76
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
bool clusterInfos(SiStripClusterInfo *cluster, const uint32_t &detid, const TrackerTopology *tTopo, enum ClusterFlags flags, LocalVector LV)
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
void SiStripMonitorTrack::analyze ( const edm::Event e,
const edm::EventSetup es 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 99 of file SiStripMonitorTrack.cc.

References GenericTriggerEventFlag::accept(), AllClusters(), dcsStatus_, edm::EventID::event(), eventNb, fillME(), genTriggerEventFlag_, SiStripDCSStatus::getStatus(), edm::EventBase::id(), iOrbitSec, LogDebug, SiStripMonitorTrack::SubDetMEs::nClustersOffTrack, SiStripMonitorTrack::SubDetMEs::nClustersOnTrack, SiStripMonitorTrack::SubDetMEs::nClustersTrendOffTrack, SiStripMonitorTrack::SubDetMEs::nClustersTrendOnTrack, GenericTriggerEventFlag::on(), edm::EventBase::orbitNumber(), edm::EventID::run(), SubDetMEsMap, SiStripMonitorTrack::SubDetMEs::totNClustersOffTrack, SiStripMonitorTrack::SubDetMEs::totNClustersOnTrack, trackStudy(), Trend_On_, and vPSiStripCluster.

100 {
101  // Filter out events if DCS checking is requested
102  if (dcsStatus_ && !dcsStatus_->getStatus(e,es)) return;
103 
104  // Filter out events if Trigger Filtering is requested
105  if (genTriggerEventFlag_->on()&& ! genTriggerEventFlag_->accept( e, es) ) return;
106 
107  //initialization of global quantities
108  LogDebug("SiStripMonitorTrack") << "[SiStripMonitorTrack::analyse] " << "Run " << e.id().run() << " Event " << e.id().event() << std::endl;
109  eventNb = e.id().event();
110 // vPSiStripCluster.clear();
111  vPSiStripCluster.clear();
112 
113  iOrbitSec = e.orbitNumber()/11223.0;
114 
115  // initialise # of clusters
116  for (std::map<std::string, SubDetMEs>::iterator iSubDet = SubDetMEsMap.begin();
117  iSubDet != SubDetMEsMap.end(); iSubDet++) {
118  iSubDet->second.totNClustersOnTrack = 0;
119  iSubDet->second.totNClustersOffTrack = 0;
120  }
121 
122  //Perform track study
123  trackStudy(e, es);
124 
125  //Perform Cluster Study (irrespectively to tracks)
126 
127  AllClusters(e, es); //analyzes the off Track Clusters
128 
129  //Summary Counts of clusters
130  std::map<std::string, MonitorElement*>::iterator iME;
131  std::map<std::string, LayerMEs>::iterator iLayerME;
132 
133  for (std::map<std::string, SubDetMEs>::iterator iSubDet = SubDetMEsMap.begin();
134  iSubDet != SubDetMEsMap.end(); iSubDet++) {
135  SubDetMEs subdet_mes = iSubDet->second;
136  if (subdet_mes.totNClustersOnTrack > 0) {
137  fillME(subdet_mes.nClustersOnTrack, subdet_mes.totNClustersOnTrack);
138  }
139  fillME(subdet_mes.nClustersOffTrack, subdet_mes.totNClustersOffTrack);
140  if (Trend_On_) {
141  fillME(subdet_mes.nClustersTrendOnTrack,iOrbitSec,subdet_mes.totNClustersOnTrack);
142  fillME(subdet_mes.nClustersTrendOffTrack,iOrbitSec,subdet_mes.totNClustersOffTrack);
143  }
144  }
145 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
void trackStudy(const edm::Event &ev, const edm::EventSetup &es)
void fillME(MonitorElement *ME, float value1)
SiStripDCSStatus * dcsStatus_
void AllClusters(const edm::Event &ev, const edm::EventSetup &es)
bool getStatus(edm::Event const &e, edm::EventSetup const &eSetup)
edm::EventNumber_t eventNb
std::unordered_set< const SiStripCluster * > vPSiStripCluster
std::map< std::string, SubDetMEs > SubDetMEsMap
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
int orbitNumber() const
Definition: EventBase.h:63
GenericTriggerEventFlag * genTriggerEventFlag_
edm::EventID id() const
Definition: EventBase.h:56
void SiStripMonitorTrack::book ( DQMStore::IBooker ibooker,
const TrackerTopology tTopo 
)
private

Definition at line 148 of file SiStripMonitorTrack.cc.

References bookLayerMEs(), bookModMEs(), bookSubDetMEs(), cond::rpcobgas::detid, flag_ring, SiStripFolderOrganizer::GetSubDetAndLayer(), SiStripFolderOrganizer::getSubDetFolderAndTag(), SiStripHistoId::getSubdetid(), LayerMEsMap, Mod_On_, mergeVDriftHistosByStation::name, DQMStore::IBooker::setCurrentFolder(), SiStripFolderOrganizer::setDetectorFolder(), SiStripFolderOrganizer::setLayerFolder(), SiStripFolderOrganizer::setSiStripFolderName(), SiStripDetCabling_, AlCaHLTBitMon_QueryRunRegistry::string, SubDetMEsMap, tkhisto_NumOffTrack, tkhisto_NumOnTrack, tkhisto_StoNCorrOnTrack, TkHistoMap_On_, and topFolderName_.

Referenced by bookHistograms().

149 {
150 
151  SiStripFolderOrganizer folder_organizer;
152  folder_organizer.setSiStripFolderName(topFolderName_);
153  //******** TkHistoMaps
154  if (TkHistoMap_On_) {
155  tkhisto_StoNCorrOnTrack = new TkHistoMap(ibooker , topFolderName_ ,"TkHMap_StoNCorrOnTrack", 0.0,true);
156  tkhisto_NumOnTrack = new TkHistoMap(ibooker , topFolderName_, "TkHMap_NumberOfOnTrackCluster", 0.0,true);
157  tkhisto_NumOffTrack = new TkHistoMap(ibooker , topFolderName_, "TkHMap_NumberOfOfffTrackCluster",0.0,true);
158  }
159  //******** TkHistoMaps
160 
161  std::vector<uint32_t> vdetId_;
162  SiStripDetCabling_->addActiveDetectorsRawIds(vdetId_);
163  //Histos for each detector, layer and module
164  for (std::vector<uint32_t>::const_iterator detid_iter=vdetId_.begin();detid_iter!=vdetId_.end();detid_iter++){ //loop on all the active detid
165  uint32_t detid = *detid_iter;
166 
167  if (detid < 1){
168  edm::LogError("SiStripMonitorTrack")<< "[" <<__PRETTY_FUNCTION__ << "] invalid detid " << detid<< std::endl;
169  continue;
170  }
171 
172 
174 
175  // book Layer and RING plots
176  std::pair<std::string,int32_t> det_layer_pair = folder_organizer.GetSubDetAndLayer(detid,tTopo,flag_ring);
177 
178  SiStripHistoId hidmanager;
179  std::string layer_id = hidmanager.getSubdetid(detid, tTopo, flag_ring);
180  std::map<std::string, LayerMEs>::iterator iLayerME = LayerMEsMap.find(layer_id);
181  if(iLayerME==LayerMEsMap.end()){
182  folder_organizer.setLayerFolder(detid, tTopo, det_layer_pair.second, flag_ring);
183  bookLayerMEs(ibooker , detid, layer_id);
184  }
185  // book sub-detector plots
186  std::pair<std::string,std::string> sdet_pair = folder_organizer.getSubDetFolderAndTag(detid, tTopo);
187  if (SubDetMEsMap.find(sdet_pair.second) == SubDetMEsMap.end()){
188  ibooker.setCurrentFolder(sdet_pair.first);
189  bookSubDetMEs(ibooker , sdet_pair.second);
190  }
191  // book module plots
192  if(Mod_On_) {
193  folder_organizer.setDetectorFolder(detid,tTopo);
194  bookModMEs(ibooker , *detid_iter);
195  }
196  }//end loop on detectors detid
197 }
TkHistoMap * tkhisto_NumOffTrack
void setSiStripFolderName(std::string name)
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=0)
void bookLayerMEs(DQMStore::IBooker &, const uint32_t &, std::string &)
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
std::map< std::string, SubDetMEs > SubDetMEsMap
void bookSubDetMEs(DQMStore::IBooker &, std::string &name)
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=0)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
void bookModMEs(DQMStore::IBooker &, const uint32_t &)
std::pair< std::string, std::string > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
TkHistoMap * tkhisto_NumOnTrack
TkHistoMap * tkhisto_StoNCorrOnTrack
std::map< std::string, LayerMEs > LayerMEsMap
void SiStripMonitorTrack::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  es 
)
overridevirtual

Implements thread_unsafe::DQMEDAnalyzer.

Definition at line 80 of file SiStripMonitorTrack.cc.

References book(), edm::EventSetup::get(), and edm::ESHandle< class >::product().

81 {
82  //Retrieve tracker topology from geometry
84  es.get<IdealGeometryRecord>().get(tTopoHandle);
85  const TrackerTopology* const tTopo = tTopoHandle.product();
86  book(ibooker , tTopo);
87 }
void book(DQMStore::IBooker &, const TrackerTopology *tTopo)
T const * product() const
Definition: ESHandle.h:86
void SiStripMonitorTrack::bookLayerMEs ( DQMStore::IBooker ibooker,
const uint32_t &  mod_id,
std::string &  layer_id 
)
private

Definition at line 241 of file SiStripMonitorTrack.cc.

References DQMStore::IBooker::book1D(), bookME1D(), SiStripMonitorTrack::LayerMEs::ClusterChargeCorrOnTrack, SiStripMonitorTrack::LayerMEs::ClusterChargeOffTrack, SiStripMonitorTrack::LayerMEs::ClusterChargeOnTrack, SiStripMonitorTrack::LayerMEs::ClusterNoiseOffTrack, SiStripMonitorTrack::LayerMEs::ClusterNoiseOnTrack, SiStripMonitorTrack::LayerMEs::ClusterPosOffTrack, SiStripMonitorTrack::LayerMEs::ClusterPosOnTrack, SiStripMonitorTrack::LayerMEs::ClusterStoNCorrOnTrack, SiStripMonitorTrack::LayerMEs::ClusterWidthOffTrack, SiStripMonitorTrack::LayerMEs::ClusterWidthOnTrack, SiStripHistoId::createHistoLayer(), flag_ring, LayerMEsMap, mergeVDriftHistosByStation::name, SiStripDetCabling_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by book().

242 {
243  std::string name = "layer";
244  std::string hname;
245  SiStripHistoId hidmanager;
246 
247  LayerMEs theLayerMEs;
248  theLayerMEs.ClusterStoNCorrOnTrack = 0;
249  theLayerMEs.ClusterChargeCorrOnTrack = 0;
250  theLayerMEs.ClusterChargeOnTrack = 0;
251  theLayerMEs.ClusterChargeOffTrack = 0;
252  theLayerMEs.ClusterNoiseOnTrack = 0;
253  theLayerMEs.ClusterNoiseOffTrack = 0;
254  theLayerMEs.ClusterWidthOnTrack = 0;
255  theLayerMEs.ClusterWidthOffTrack = 0;
256  theLayerMEs.ClusterPosOnTrack = 0;
257  theLayerMEs.ClusterPosOffTrack = 0;
258 
259  // Cluster StoN Corrected
260  hname = hidmanager.createHistoLayer("Summary_ClusterStoNCorr",name,layer_id,"OnTrack");
261  theLayerMEs.ClusterStoNCorrOnTrack = bookME1D(ibooker , "TH1ClusterStoNCorr", hname.c_str());
262 
263  // Cluster Charge Corrected
264  hname = hidmanager.createHistoLayer("Summary_ClusterChargeCorr",name,layer_id,"OnTrack");
265  theLayerMEs.ClusterChargeCorrOnTrack = bookME1D(ibooker , "TH1ClusterChargeCorr", hname.c_str());
266 
267  // Cluster Charge (On and Off Track)
268  hname = hidmanager.createHistoLayer("Summary_ClusterCharge",name,layer_id,"OnTrack");
269  theLayerMEs.ClusterChargeOnTrack = bookME1D(ibooker , "TH1ClusterCharge", hname.c_str());
270 
271  hname = hidmanager.createHistoLayer("Summary_ClusterCharge",name,layer_id,"OffTrack");
272  theLayerMEs.ClusterChargeOffTrack = bookME1D(ibooker , "TH1ClusterCharge", hname.c_str());
273 
274  // Cluster Noise (On and Off Track)
275  hname = hidmanager.createHistoLayer("Summary_ClusterNoise",name,layer_id,"OnTrack");
276  theLayerMEs.ClusterNoiseOnTrack = bookME1D(ibooker , "TH1ClusterNoise", hname.c_str());
277 
278  hname = hidmanager.createHistoLayer("Summary_ClusterNoise",name,layer_id,"OffTrack");
279  theLayerMEs.ClusterNoiseOffTrack = bookME1D(ibooker , "TH1ClusterNoise", hname.c_str());
280 
281  // Cluster Width (On and Off Track)
282  hname = hidmanager.createHistoLayer("Summary_ClusterWidth",name,layer_id,"OnTrack");
283  theLayerMEs.ClusterWidthOnTrack = bookME1D(ibooker , "TH1ClusterWidth", hname.c_str());
284 
285  hname = hidmanager.createHistoLayer("Summary_ClusterWidth",name,layer_id,"OffTrack");
286  theLayerMEs.ClusterWidthOffTrack = bookME1D(ibooker , "TH1ClusterWidth", hname.c_str());
287 
288  //Cluster Position
289  short total_nr_strips = SiStripDetCabling_->nApvPairs(mod_id) * 2 * 128;
290  if (layer_id.find("TEC") != std::string::npos && !flag_ring) total_nr_strips = 3 * 2 * 128;
291 
292  hname = hidmanager.createHistoLayer("Summary_ClusterPosition",name,layer_id,"OnTrack");
293  theLayerMEs.ClusterPosOnTrack = ibooker.book1D(hname, hname, total_nr_strips, 0.5,total_nr_strips+0.5);
294 
295  hname = hidmanager.createHistoLayer("Summary_ClusterPosition",name,layer_id,"OffTrack");
296  theLayerMEs.ClusterPosOffTrack = ibooker.book1D(hname, hname, total_nr_strips, 0.5,total_nr_strips+0.5);
297 
298  //bookeeping
299  LayerMEsMap[layer_id]=theLayerMEs;
300 }
MonitorElement * bookME1D(DQMStore::IBooker &, const char *, const char *)
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
std::map< std::string, LayerMEs > LayerMEsMap
MonitorElement * SiStripMonitorTrack::bookME1D ( DQMStore::IBooker ibooker,
const char *  ParameterSetLabel,
const char *  HistoName 
)
private

Definition at line 360 of file SiStripMonitorTrack.cc.

References DQMStore::IBooker::book1D(), conf_, and edm::ParameterSet::getParameter().

Referenced by bookLayerMEs(), bookModMEs(), and bookSubDetMEs().

361 {
362  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
363  // std::cout << "[SiStripMonitorTrack::bookME1D] pwd: " << dbe->pwd() << std::endl;
364  // std::cout << "[SiStripMonitorTrack::bookME1D] HistoName: " << HistoName << std::endl;
365  return ibooker.book1D(HistoName,HistoName,
366  Parameters.getParameter<int32_t>("Nbinx"),
367  Parameters.getParameter<double>("xmin"),
368  Parameters.getParameter<double>("xmax")
369  );
370 }
T getParameter(std::string const &) const
edm::ParameterSet conf_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::string HistoName
edm::ParameterSet Parameters
MonitorElement * SiStripMonitorTrack::bookME2D ( DQMStore::IBooker ibooker,
const char *  ParameterSetLabel,
const char *  HistoName 
)
private

Definition at line 373 of file SiStripMonitorTrack.cc.

References DQMStore::IBooker::book2D(), conf_, and edm::ParameterSet::getParameter().

374 {
375  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
376  return ibooker.book2D(HistoName,HistoName,
377  Parameters.getParameter<int32_t>("Nbinx"),
378  Parameters.getParameter<double>("xmin"),
379  Parameters.getParameter<double>("xmax"),
380  Parameters.getParameter<int32_t>("Nbiny"),
381  Parameters.getParameter<double>("ymin"),
382  Parameters.getParameter<double>("ymax")
383  );
384 }
T getParameter(std::string const &) const
edm::ParameterSet conf_
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::string HistoName
edm::ParameterSet Parameters
MonitorElement * SiStripMonitorTrack::bookME3D ( DQMStore::IBooker ibooker,
const char *  ParameterSetLabel,
const char *  HistoName 
)
private

Definition at line 387 of file SiStripMonitorTrack.cc.

References DQMStore::IBooker::book3D(), conf_, and edm::ParameterSet::getParameter().

388 {
389  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
390  return ibooker.book3D(HistoName,HistoName,
391  Parameters.getParameter<int32_t>("Nbinx"),
392  Parameters.getParameter<double>("xmin"),
393  Parameters.getParameter<double>("xmax"),
394  Parameters.getParameter<int32_t>("Nbiny"),
395  Parameters.getParameter<double>("ymin"),
396  Parameters.getParameter<double>("ymax"),
397  Parameters.getParameter<int32_t>("Nbinz"),
398  Parameters.getParameter<double>("zmin"),
399  Parameters.getParameter<double>("zmax")
400  );
401 }
T getParameter(std::string const &) const
edm::ParameterSet conf_
std::string HistoName
edm::ParameterSet Parameters
MonitorElement * book3D(Args &&...args)
Definition: DQMStore.h:151
MonitorElement * SiStripMonitorTrack::bookMEProfile ( DQMStore::IBooker ibooker,
const char *  ParameterSetLabel,
const char *  HistoName 
)
private

Definition at line 404 of file SiStripMonitorTrack.cc.

References DQMStore::IBooker::bookProfile(), conf_, and edm::ParameterSet::getParameter().

Referenced by bookModMEs().

405 {
406  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
407  return ibooker.bookProfile(HistoName,HistoName,
408  Parameters.getParameter<int32_t>("Nbinx"),
409  Parameters.getParameter<double>("xmin"),
410  Parameters.getParameter<double>("xmax"),
411  Parameters.getParameter<int32_t>("Nbiny"),
412  Parameters.getParameter<double>("ymin"),
413  Parameters.getParameter<double>("ymax"),
414  "" );
415 }
T getParameter(std::string const &) const
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
edm::ParameterSet conf_
std::string HistoName
edm::ParameterSet Parameters
MonitorElement * SiStripMonitorTrack::bookMETrend ( DQMStore::IBooker ibooker,
const char *  ParameterSetLabel,
const char *  HistoName 
)
private

Definition at line 418 of file SiStripMonitorTrack.cc.

References DQMStore::IBooker::bookProfile(), conf_, MonitorElement::DQM_KIND_TPROFILE, edm::ParameterSet::getParameter(), and MonitorElement::getTH1().

Referenced by bookSubDetMEs().

419 {
420  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
421  edm::ParameterSet ParametersTrend = conf_.getParameter<edm::ParameterSet>("Trending");
423  ParametersTrend.getParameter<int32_t>("Nbins"),
424  0,
425  ParametersTrend.getParameter<int32_t>("Nbins"),
426  100, //that parameter should not be there !?
427  Parameters.getParameter<double>("xmin"),
428  Parameters.getParameter<double>("xmax"),
429  "" );
430  if (me->kind() == MonitorElement::DQM_KIND_TPROFILE) me->getTH1()->SetBit(TH1::kCanRebin);
431 
432  if(!me) return me;
433  me->setAxisTitle("Event Time in Seconds",1);
434  return me;
435 }
T getParameter(std::string const &) const
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
edm::ParameterSet conf_
TH1 * getTH1(void) const
std::string HistoName
edm::ParameterSet Parameters
void SiStripMonitorTrack::bookModMEs ( DQMStore::IBooker ibooker,
const uint32_t &  id 
)
private

Definition at line 200 of file SiStripMonitorTrack.cc.

References DQMStore::IBooker::book1D(), bookME1D(), bookMEProfile(), SiStripMonitorTrack::ModMEs::ClusterCharge, SiStripMonitorTrack::ModMEs::ClusterChargeCorr, SiStripMonitorTrack::ModMEs::ClusterPGV, SiStripMonitorTrack::ModMEs::ClusterPos, SiStripMonitorTrack::ModMEs::ClusterStoNCorr, SiStripMonitorTrack::ModMEs::ClusterWidth, SiStripHistoId::createHistoId(), ModMEsMap, mergeVDriftHistosByStation::name, SiStripDetCabling_, AlCaHLTBitMon_QueryRunRegistry::string, and DQMStore::IBooker::tag().

Referenced by book().

201 {
202  std::string name = "det";
203  SiStripHistoId hidmanager;
204  std::string hid = hidmanager.createHistoId("",name,id);
205  std::map<std::string, ModMEs>::iterator iModME = ModMEsMap.find(hid);
206  if(iModME==ModMEsMap.end()){
207  ModMEs theModMEs;
208  theModMEs.ClusterStoNCorr = 0;
209  theModMEs.ClusterCharge = 0;
210  theModMEs.ClusterChargeCorr = 0;
211  theModMEs.ClusterWidth = 0;
212  theModMEs.ClusterPos = 0;
213  theModMEs.ClusterPGV = 0;
214 
215  // Cluster Width
216  theModMEs.ClusterWidth=bookME1D(ibooker , "TH1ClusterWidth", hidmanager.createHistoId("ClusterWidth_OnTrack",name,id).c_str());
217  ibooker.tag(theModMEs.ClusterWidth,id);
218  // Cluster Charge
219  theModMEs.ClusterCharge=bookME1D(ibooker , "TH1ClusterCharge", hidmanager.createHistoId("ClusterCharge_OnTrack",name,id).c_str());
220  ibooker.tag(theModMEs.ClusterCharge,id);
221  // Cluster Charge Corrected
222  theModMEs.ClusterChargeCorr=bookME1D(ibooker , "TH1ClusterChargeCorr", hidmanager.createHistoId("ClusterChargeCorr_OnTrack",name,id).c_str());
223  ibooker.tag(theModMEs.ClusterChargeCorr,id);
224  // Cluster StoN Corrected
225  theModMEs.ClusterStoNCorr=bookME1D(ibooker , "TH1ClusterStoNCorrMod", hidmanager.createHistoId("ClusterStoNCorr_OnTrack",name,id).c_str());
226  ibooker.tag(theModMEs.ClusterStoNCorr,id);
227  // Cluster Position
228  short total_nr_strips = SiStripDetCabling_->nApvPairs(id) * 2 * 128;
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);
230  ibooker.tag(theModMEs.ClusterPos,id);
231  // Cluster PGV
232  theModMEs.ClusterPGV=bookMEProfile(ibooker , "TProfileClusterPGV", hidmanager.createHistoId("PGV_OnTrack",name,id).c_str());
233  ibooker.tag(theModMEs.ClusterPGV,id);
234 
235  ModMEsMap[hid]=theModMEs;
236  }
237 }
MonitorElement * bookME1D(DQMStore::IBooker &, const char *, const char *)
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void tag(MonitorElement *, unsigned int)
Definition: DQMStore.cc:286
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
std::map< std::string, ModMEs > ModMEsMap
MonitorElement * bookMEProfile(DQMStore::IBooker &, const char *, const char *)
void SiStripMonitorTrack::bookSubDetMEs ( DQMStore::IBooker ibooker,
std::string &  name 
)
private

Definition at line 304 of file SiStripMonitorTrack.cc.

References bookME1D(), bookMETrend(), SiStripMonitorTrack::SubDetMEs::ClusterChargeOffTrack, SiStripMonitorTrack::SubDetMEs::ClusterChargeOnTrack, SiStripMonitorTrack::SubDetMEs::ClusterStoNCorrOnTrack, SiStripMonitorTrack::SubDetMEs::ClusterStoNOffTrack, MonitorElement::getTH1(), mergeVDriftHistosByStation::name, SiStripMonitorTrack::SubDetMEs::nClustersOffTrack, SiStripMonitorTrack::SubDetMEs::nClustersOnTrack, SiStripMonitorTrack::SubDetMEs::nClustersTrendOffTrack, SiStripMonitorTrack::SubDetMEs::nClustersTrendOnTrack, AlCaHLTBitMon_QueryRunRegistry::string, xuti::subdet_tag(), SubDetMEsMap, SiStripMonitorTrack::SubDetMEs::totNClustersOffTrack, SiStripMonitorTrack::SubDetMEs::totNClustersOnTrack, and Trend_On_.

Referenced by book().

304  {
305 
307  subdet_tag = "__" + name;
308  std::string completeName;
309 
310  SubDetMEs theSubDetMEs;
311  theSubDetMEs.totNClustersOnTrack = 0;
312  theSubDetMEs.totNClustersOffTrack = 0;
313  theSubDetMEs.nClustersOnTrack = 0;
314  theSubDetMEs.nClustersTrendOnTrack = 0;
315  theSubDetMEs.nClustersOffTrack = 0;
316  theSubDetMEs.nClustersTrendOffTrack = 0;
317  theSubDetMEs.ClusterStoNCorrOnTrack = 0;
318  theSubDetMEs.ClusterChargeOnTrack = 0;
319  theSubDetMEs.ClusterChargeOffTrack = 0;
320  theSubDetMEs.ClusterStoNOffTrack = 0;
321 
322  // TotalNumber of Cluster OnTrack
323  completeName = "Summary_TotalNumberOfClusters_OnTrack" + subdet_tag;
324  theSubDetMEs.nClustersOnTrack = bookME1D(ibooker , "TH1nClustersOn", completeName.c_str());
325  theSubDetMEs.nClustersOnTrack->getTH1()->StatOverflows(kTRUE);
326 
327  // TotalNumber of Cluster OffTrack
328  completeName = "Summary_TotalNumberOfClusters_OffTrack" + subdet_tag;
329  theSubDetMEs.nClustersOffTrack = bookME1D(ibooker , "TH1nClustersOff", completeName.c_str());
330  theSubDetMEs.nClustersOffTrack->getTH1()->StatOverflows(kTRUE);
331 
332  // Cluster StoN On Track
333  completeName = "Summary_ClusterStoNCorr_OnTrack" + subdet_tag;
334  theSubDetMEs.ClusterStoNCorrOnTrack = bookME1D(ibooker , "TH1ClusterStoNCorr", completeName.c_str());
335 
336  // Cluster Charge On Track
337  completeName = "Summary_ClusterCharge_OnTrack" + subdet_tag;
338  theSubDetMEs.ClusterChargeOnTrack=bookME1D(ibooker , "TH1ClusterCharge", completeName.c_str());
339 
340  // Cluster Charge Off Track
341  completeName = "Summary_ClusterCharge_OffTrack" + subdet_tag;
342  theSubDetMEs.ClusterChargeOffTrack=bookME1D(ibooker , "TH1ClusterCharge", completeName.c_str());
343 
344  // Cluster Charge StoN Off Track
345  completeName = "Summary_ClusterStoN_OffTrack" + subdet_tag;
346  theSubDetMEs.ClusterStoNOffTrack = bookME1D(ibooker , "TH1ClusterStoN", completeName.c_str());
347 
348  if(Trend_On_){
349  // TotalNumber of Cluster
350  completeName = "Trend_TotalNumberOfClusters_OnTrack" + subdet_tag;
351  theSubDetMEs.nClustersTrendOnTrack = bookMETrend(ibooker , "TH1nClustersOn", completeName.c_str());
352  completeName = "Trend_TotalNumberOfClusters_OffTrack" + subdet_tag;
353  theSubDetMEs.nClustersTrendOffTrack = bookMETrend(ibooker , "TH1nClustersOff", completeName.c_str());
354  }
355  //bookeeping
356  SubDetMEsMap[name]=theSubDetMEs;
357 }
MonitorElement * bookMETrend(DQMStore::IBooker &, const char *, const char *)
MonitorElement * bookME1D(DQMStore::IBooker &, const char *, const char *)
std::map< std::string, SubDetMEs > SubDetMEsMap
const std::string subdet_tag("SubDet")
TH1 * getTH1(void) const
bool SiStripMonitorTrack::clusterInfos ( SiStripClusterInfo cluster,
const uint32_t &  detid,
const TrackerTopology tTopo,
enum ClusterFlags  flags,
LocalVector  LV 
)
private

Definition at line 798 of file SiStripMonitorTrack.cc.

References TkHistoMap::add(), applyClusterQuality_, SiStripClusterInfo::charge(), SiStripHistoId::createHistoId(), SiStripClusterInfo::detId(), eventNb, TkHistoMap::fill(), fillMEs(), fillModMEs(), folderOrganizer_, SiStripFolderOrganizer::getSubDetFolderAndTag(), LogDebug, PV3DBase< T, PVType, FrameType >::mag(), Mod_On_, mergeVDriftHistosByStation::name, SiStripClusterInfo::noiseRescaledByGain(), NULL, OffTrack, OnTrack, SiStripClusterInfo::signalOverNoise(), sToNLowerLimit_, sToNUpperLimit_, AlCaHLTBitMon_QueryRunRegistry::string, SubDetMEsMap, tkhisto_NumOffTrack, tkhisto_NumOnTrack, tkhisto_StoNCorrOnTrack, TkHistoMap_On_, SiStripClusterInfo::width(), widthLowerLimit_, widthUpperLimit_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by AllClusters(), and RecHitInfo().

799 {
800 
801  // std::cout << "[SiStripMonitorTrack::clusterInfos] input collection: " << Cluster_src_ << std::endl;
802  // std::cout << "[SiStripMonitorTrack::clusterInfos] starting flag " << flag << std::endl;
803  if (cluster==NULL) return false;
804  // if one imposes a cut on the clusters, apply it
805  if( (applyClusterQuality_) &&
806  (cluster->signalOverNoise() < sToNLowerLimit_ ||
807  cluster->signalOverNoise() > sToNUpperLimit_ ||
808  cluster->width() < widthLowerLimit_ ||
809  cluster->width() > widthUpperLimit_) ) return false;
810  // std::cout << "[SiStripMonitorTrack::clusterInfos] pass clusterQuality detID: " << detid;
811  // start of the analysis
812 
813  std::pair<std::string,std::string> sdet_pair = folderOrganizer_.getSubDetFolderAndTag(detid,tTopo);
814  // std::cout << " --> " << sdet_pair.second << " " << sdet_pair.first << std::endl;
815  // std::cout << "[SiStripMonitorTrack::clusterInfos] SubDetMEsMap: " << SubDetMEsMap.size() << std::endl;
816  std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.find(sdet_pair.second);
817  // std::cout << "[SiStripMonitorTrack::clusterInfos] iSubdet: " << iSubdet->first << std::endl;
818  if(iSubdet != SubDetMEsMap.end()){
819  // std::cout << "[SiStripMonitorTrack::clusterInfos] adding cluster" << std::endl;
820  if (flag == OnTrack) iSubdet->second.totNClustersOnTrack++;
821  else if (flag == OffTrack) iSubdet->second.totNClustersOffTrack++;
822  }
823 
824  // std::cout << "[SiStripMonitorTrack::clusterInfos] iSubdet->second.totNClustersOnTrack: " << iSubdet->second.totNClustersOnTrack << std::endl;
825  // std::cout << "[SiStripMonitorTrack::clusterInfos] iSubdet->second.totNClustersOffTrack: " << iSubdet->second.totNClustersOffTrack << std::endl;
826 
827  float cosRZ = -2;
828  LogDebug("SiStripMonitorTrack")<< "\n\tLV " << LV.x() << " " << LV.y() << " " << LV.z() << " " << LV.mag() << std::endl;
829  if (LV.mag()!=0){
830  cosRZ= fabs(LV.z())/LV.mag();
831  LogDebug("SiStripMonitorTrack")<< "\n\t cosRZ " << cosRZ << std::endl;
832  }
834 
835  // Filling SubDet/Layer Plots (on Track + off Track)
836  fillMEs(cluster,detid,tTopo,cosRZ,flag);
837 
838 
839  //******** TkHistoMaps
840  if (TkHistoMap_On_) {
841  uint32_t adet=cluster->detId();
842  float noise = cluster->noiseRescaledByGain();
843  if(flag==OnTrack){
844  tkhisto_NumOnTrack->add(adet,1.);
845  if(noise > 0.0) tkhisto_StoNCorrOnTrack->fill(adet,cluster->signalOverNoise()*cosRZ);
846  if(noise == 0.0)
847  LogDebug("SiStripMonitorTrack") << "Module " << detid << " in Event " << eventNb << " noise " << noise << std::endl;
848  }
849  else if(flag==OffTrack){
850  tkhisto_NumOffTrack->add(adet,1.);
851  if(cluster->charge() > 250){
852  LogDebug("SiStripMonitorTrack") << "Module firing " << detid << " in Event " << eventNb << std::endl;
853  }
854  }
855  }
856 
857  // Module plots filled only for onTrack Clusters
858  if(Mod_On_){
859  if(flag==OnTrack){
860  SiStripHistoId hidmanager2;
861  name =hidmanager2.createHistoId("","det",detid);
862  fillModMEs(cluster,name,cosRZ);
863  }
864  }
865  return true;
866 }
#define LogDebug(id)
TkHistoMap * tkhisto_NumOffTrack
float noiseRescaledByGain() const
T y() const
Definition: PV3DBase.h:63
#define NULL
Definition: scimark2.h:8
float signalOverNoise() const
void fillMEs(SiStripClusterInfo *, uint32_t detid, const TrackerTopology *tTopo, float, enum ClusterFlags)
T mag() const
Definition: PV3DBase.h:67
edm::EventNumber_t eventNb
uint16_t charge() const
std::map< std::string, SubDetMEs > SubDetMEsMap
void fillModMEs(SiStripClusterInfo *, std::string, float)
void fill(uint32_t &detid, float value)
Definition: TkHistoMap.cc:180
T z() const
Definition: PV3DBase.h:64
uint16_t width() const
SiStripFolderOrganizer folderOrganizer_
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
std::pair< std::string, std::string > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
TkHistoMap * tkhisto_NumOnTrack
uint32_t detId() const
TkHistoMap * tkhisto_StoNCorrOnTrack
T x() const
Definition: PV3DBase.h:62
void add(uint32_t &detid, float value)
Definition: TkHistoMap.cc:213
void SiStripMonitorTrack::dqmBeginRun ( const edm::Run run,
const edm::EventSetup es 
)
virtual

Reimplemented from thread_unsafe::DQMEDAnalyzer.

Definition at line 68 of file SiStripMonitorTrack.cc.

References genTriggerEventFlag_, edm::EventSetup::get(), GenericTriggerEventFlag::initRun(), LogDebug, GenericTriggerEventFlag::on(), SiStripDetCabling_, and tkgeom_.

69 {
70  //get geom
72  LogDebug("SiStripMonitorTrack") << "[SiStripMonitorTrack::beginRun] There are "<<tkgeom_->detUnits().size() <<" detectors instantiated in the geometry" << std::endl;
74 
75 
76  // Initialize the GenericTriggerEventFlag
78 }
#define LogDebug(id)
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
edm::ESHandle< TrackerGeometry > tkgeom_
const T & get() const
Definition: EventSetup.h:55
GenericTriggerEventFlag * genTriggerEventFlag_
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
void SiStripMonitorTrack::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 90 of file SiStripMonitorTrack.cc.

References conf_, dbe, edm::ParameterSet::getParameter(), DQMStore::save(), and AlCaHLTBitMon_QueryRunRegistry::string.

91 {
92  if(conf_.getParameter<bool>("OutputMEsInRootFile")){
93  //dbe->showDirStructure();
94  dbe->save(conf_.getParameter<std::string>("OutputFileName"));
95  }
96 }
T getParameter(std::string const &) const
edm::ParameterSet conf_
void SiStripMonitorTrack::fillME ( MonitorElement ME,
float  value1 
)
inlineprivate

Definition at line 107 of file SiStripMonitorTrack.h.

References MonitorElement::Fill().

Referenced by analyze(), fillMEs(), and fillModMEs().

107 {if (ME!=0)ME->Fill(value1);}
void Fill(long long x)
void SiStripMonitorTrack::fillME ( MonitorElement ME,
float  value1,
float  value2 
)
inlineprivate

Definition at line 108 of file SiStripMonitorTrack.h.

References MonitorElement::Fill().

108 {if (ME!=0)ME->Fill(value1,value2);}
void Fill(long long x)
void SiStripMonitorTrack::fillME ( MonitorElement ME,
float  value1,
float  value2,
float  value3 
)
inlineprivate

Definition at line 109 of file SiStripMonitorTrack.h.

References MonitorElement::Fill().

109 {if (ME!=0)ME->Fill(value1,value2,value3);}
void Fill(long long x)
void SiStripMonitorTrack::fillME ( MonitorElement ME,
float  value1,
float  value2,
float  value3,
float  value4 
)
inlineprivate

Definition at line 110 of file SiStripMonitorTrack.h.

References MonitorElement::Fill().

110 {if (ME!=0)ME->Fill(value1,value2,value3,value4);}
void Fill(long long x)
void SiStripMonitorTrack::fillMEs ( SiStripClusterInfo cluster,
uint32_t  detid,
const TrackerTopology tTopo,
float  cos,
enum ClusterFlags  flag 
)
private

Definition at line 904 of file SiStripMonitorTrack.cc.

References SiStripClusterInfo::baryStrip(), SiStripClusterInfo::charge(), eventNb, fillME(), flag_ring, folderOrganizer_, SiStripFolderOrganizer::GetSubDetAndLayer(), SiStripFolderOrganizer::getSubDetFolderAndTag(), SiStripHistoId::getSubdetid(), LayerMEsMap, LogDebug, SiStripClusterInfo::noiseRescaledByGain(), OnTrack, position, SiStripClusterInfo::signalOverNoise(), AlCaHLTBitMon_QueryRunRegistry::string, SubDetMEsMap, SiStripClusterInfo::width(), and create_public_lumi_plots::width.

Referenced by clusterInfos().

905 {
906  std::pair<std::string,int32_t> SubDetAndLayer = folderOrganizer_.GetSubDetAndLayer(detid,tTopo,flag_ring);
907  SiStripHistoId hidmanager1;
908  std::string layer_id = hidmanager1.getSubdetid(detid,tTopo,flag_ring);
909 
910  std::pair<std::string,std::string> sdet_pair = folderOrganizer_.getSubDetFolderAndTag(detid,tTopo);
911  float StoN = cluster->signalOverNoise();
912  float noise = cluster->noiseRescaledByGain();
913  uint16_t charge = cluster->charge();
914  uint16_t width = cluster->width();
915  float position = cluster->baryStrip();
916 
917  std::map<std::string, LayerMEs>::iterator iLayer = LayerMEsMap.find(layer_id);
918  if (iLayer != LayerMEsMap.end()) {
919  if(flag==OnTrack){
920  // std::cout << "[SiStripMonitorTrack::fillMEs] filling OnTrack" << std::endl;
921  if(noise > 0.0) fillME(iLayer->second.ClusterStoNCorrOnTrack, StoN*cos);
922  if(noise == 0.0) LogDebug("SiStripMonitorTrack") << "Module " << detid << " in Event " << eventNb << " noise " << cluster->noiseRescaledByGain() << std::endl;
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);
928  } else {
929  // std::cout << "[SiStripMonitorTrack::fillMEs] filling OffTrack" << std::endl;
930  fillME(iLayer->second.ClusterChargeOffTrack, charge);
931  fillME(iLayer->second.ClusterNoiseOffTrack, noise);
932  fillME(iLayer->second.ClusterWidthOffTrack, width);
933  fillME(iLayer->second.ClusterPosOffTrack, position);
934  }
935  }
936  std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.find(sdet_pair.second);
937  if(iSubdet != SubDetMEsMap.end() ){
938  if(flag==OnTrack){
939  fillME(iSubdet->second.ClusterChargeOnTrack,charge);
940  if(noise > 0.0) fillME(iSubdet->second.ClusterStoNCorrOnTrack,StoN*cos);
941  } else {
942  fillME(iSubdet->second.ClusterChargeOffTrack,charge);
943  if(noise > 0.0) fillME(iSubdet->second.ClusterStoNOffTrack,StoN);
944  }
945  }
946 }
#define LogDebug(id)
void fillME(MonitorElement *ME, float value1)
float noiseRescaledByGain() const
float baryStrip() const
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=0)
float signalOverNoise() const
edm::EventNumber_t eventNb
uint16_t charge() const
std::map< std::string, SubDetMEs > SubDetMEsMap
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
uint16_t width() const
SiStripFolderOrganizer folderOrganizer_
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
std::pair< std::string, std::string > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
static int position[264][3]
Definition: ReadPGInfo.cc:509
std::map< std::string, LayerMEs > LayerMEsMap
void SiStripMonitorTrack::fillModMEs ( SiStripClusterInfo cluster,
std::string  name,
float  cos 
)
private

Definition at line 869 of file SiStripMonitorTrack.cc.

References SiStripClusterInfo::baryStrip(), SiStripClusterInfo::charge(), conf_, eventNb, fillME(), edm::ParameterSet::getParameter(), i, LogDebug, SiStripClusterInfo::maxCharge(), SiStripClusterInfo::maxIndex(), ModMEsMap, SiStripClusterInfo::noiseRescaledByGain(), position, SiStripClusterInfo::signalOverNoise(), SiStripClusterInfo::stripCharges(), SiStripClusterInfo::width(), and create_public_lumi_plots::width.

Referenced by clusterInfos().

870 {
871  std::map<std::string, ModMEs>::iterator iModME = ModMEsMap.find(name);
872  if(iModME!=ModMEsMap.end()){
873 
874  float StoN = cluster->signalOverNoise();
875  uint16_t charge = cluster->charge();
876  uint16_t width = cluster->width();
877  float position = cluster->baryStrip();
878 
879  float noise = cluster->noiseRescaledByGain();
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);
883 
884  fillME(iModME->second.ClusterChargeCorr,charge*cos);
885 
886  fillME(iModME->second.ClusterWidth ,width);
887  fillME(iModME->second.ClusterPos ,position);
888 
889  //fill the PGV histo
890  float PGVmax = cluster->maxCharge();
891  int PGVposCounter = cluster->maxIndex();
892  for (int i= int(conf_.getParameter<edm::ParameterSet>("TProfileClusterPGV").getParameter<double>("xmin"));i<PGVposCounter;++i)
893  fillME(iModME->second.ClusterPGV, i,0.);
894  for (auto it=cluster->stripCharges().begin();it<cluster->stripCharges().end();++it) {
895  fillME(iModME->second.ClusterPGV, PGVposCounter++,(*it)/PGVmax);
896  }
897  for (int i= PGVposCounter;i<int(conf_.getParameter<edm::ParameterSet>("TProfileClusterPGV").getParameter<double>("xmax"));++i)
898  fillME(iModME->second.ClusterPGV, i,0.);
899  //end fill the PGV histo
900  }
901 }
#define LogDebug(id)
uint8_t maxCharge() const
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
void fillME(MonitorElement *ME, float value1)
float noiseRescaledByGain() const
float baryStrip() const
edm::ParameterSet conf_
uint16_t maxIndex() const
auto stripCharges() const -> decltype(cluster() ->amplitudes())
float signalOverNoise() const
edm::EventNumber_t eventNb
uint16_t charge() const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
uint16_t width() const
std::map< std::string, ModMEs > ModMEsMap
static int position[264][3]
Definition: ReadPGInfo.cc:509
void SiStripMonitorTrack::getSubDetTag ( std::string &  folder_name,
std::string &  tag 
)
private

Definition at line 951 of file SiStripMonitorTrack.cc.

951  {
952 
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,"_");
956  }
957 }
void SiStripMonitorTrack::hitStudy ( const edm::EventSetup es,
const ProjectedSiStripRecHit2D projhit,
const SiStripMatchedRecHit2D matchedhit,
const SiStripRecHit2D hit2D,
const SiStripRecHit1D hit1D,
LocalVector  localMomentum 
)
private

Definition at line 519 of file SiStripMonitorTrack.cc.

References TrackingRecHit::geographicalId(), LogDebug, LogTrace, m, PV3DBase< T, PVType, FrameType >::mag(), GluedGeomDet::monoDet(), SiStripMatchedRecHit2D::monoHit(), ProjectedSiStripRecHit2D::originalHit(), DetId::rawId(), alignCSCRings::s, GluedGeomDet::stereoDet(), SiStripMatchedRecHit2D::stereoHit(), tkgeom_, GeomDet::toGlobal(), GeomDet::toLocal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by trackStudyFromTrack().

525  {
526  LocalVector statedirection;
527  if(matchedhit){ // type=Matched;
528  LogTrace("SiStripMonitorTrack")<<"\nMatched recHit found"<< std::endl;
529 
530  GluedGeomDet * gdet=(GluedGeomDet *)tkgeom_->idToDet(matchedhit->geographicalId());
531 
532  GlobalVector gtrkdirup=gdet->toGlobal(localMomentum);
533 
534  //mono side
535  const GeomDetUnit * monodet=gdet->monoDet();
536  statedirection=monodet->toLocal(gtrkdirup);
537  SiStripRecHit2D m = matchedhit->monoHit();
538  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&m,statedirection,es);
539 
540  //stereo side
541  const GeomDetUnit * stereodet=gdet->stereoDet();
542  statedirection=stereodet->toLocal(gtrkdirup);
543  SiStripRecHit2D s = matchedhit->stereoHit();
544  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&s,statedirection,es);
545  }
546  else if(projhit){ // type=Projected;
547  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found"<< std::endl;
548 
549  GluedGeomDet * gdet=(GluedGeomDet *)tkgeom_->idToDet(projhit->geographicalId());
550 
551  GlobalVector gtrkdirup=gdet->toGlobal(localMomentum);
552  const SiStripRecHit2D originalhit=projhit->originalHit();
553 
554  const GeomDetUnit * det;
555  if(!StripSubdetector(originalhit.geographicalId().rawId()).stereo()){
556  //mono side
557  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found MONO"<< std::endl;
558  det=gdet->monoDet();
559  statedirection=det->toLocal(gtrkdirup);
560  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es);
561  }
562  else{
563  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found STEREO"<< std::endl;
564  //stereo side
565  det=gdet->stereoDet();
566  statedirection=det->toLocal(gtrkdirup);
567  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es);
568  }
569  } else if (hit2D){ // type=2D
570  statedirection=localMomentum;
571  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(hit2D,statedirection,es);
572  } else if (hit1D) { // type=1D
573  statedirection=localMomentum;
574  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit1D>(hit1D,statedirection,es);
575  } else {
576  LogDebug ("SiStripMonitorTrack")
577  << " LocalMomentum: "<<statedirection
578  << "\nLocal x-z plane angle: "<<atan2(statedirection.x(),statedirection.z());
579  }
580 
581 }
#define LogDebug(id)
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:20
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:52
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:67
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
edm::ESHandle< TrackerGeometry > tkgeom_
T mag() const
Definition: PV3DBase.h:67
T z() const
Definition: PV3DBase.h:64
#define LogTrace(id)
SiStripRecHit2D originalHit() const
SiStripRecHit2D stereoHit() const
SiStripRecHit2D monoHit() const
DetId geographicalId() const
T x() const
Definition: PV3DBase.h:62
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21
template<class T >
void SiStripMonitorTrack::RecHitInfo ( const T tkrecHit,
LocalVector  LV,
const edm::EventSetup es 
)
private

Definition at line 711 of file SiStripMonitorTrack.cc.

References clusterInfos(), cond::rpcobgas::detid, edm::EventSetup::get(), LogTrace, NULL, OnTrack, edm::ESHandle< class >::product(), tkgeom_, vPSiStripCluster, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

711  {
712 
713  // std::cout << "[SiStripMonitorTrack::RecHitInfo] starting" << std::endl;
714 
715  if(!tkrecHit->isValid()){
716  LogTrace("SiStripMonitorTrack") <<"\t\t Invalid Hit " << std::endl;
717  return;
718  }
719 
720  const uint32_t& detid = tkrecHit->geographicalId().rawId();
721 
722  LogTrace("SiStripMonitorTrack")
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;
727 
728 
729  //Retrieve tracker topology from geometry
730  edm::ESHandle<TrackerTopology> tTopoHandle;
731  es.get<IdealGeometryRecord>().get(tTopoHandle);
732  const TrackerTopology* const tTopo = tTopoHandle.product();
733 
734  //Get SiStripCluster from SiStripRecHit
735  if ( tkrecHit != NULL ){
736  const SiStripCluster* SiStripCluster_ = &*(tkrecHit->cluster());
737  SiStripClusterInfo SiStripClusterInfo_(*SiStripCluster_,es,detid);
738 
739  // std::cout << "[SiStripMonitorTrack::RecHitInfo] SiStripClusterInfo DONE" << std::endl;
740 
741  if ( clusterInfos(&SiStripClusterInfo_,detid, tTopo, OnTrack, LV ) )
742  {
743  vPSiStripCluster.insert(SiStripCluster_);
744  }
745  }
746  else
747  {
748  edm::LogError("SiStripMonitorTrack") << "NULL hit" << std::endl;
749  }
750  }
T y() const
Definition: PV3DBase.h:63
#define NULL
Definition: scimark2.h:8
edm::ESHandle< TrackerGeometry > tkgeom_
std::unordered_set< const SiStripCluster * > vPSiStripCluster
T z() const
Definition: PV3DBase.h:64
#define LogTrace(id)
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
bool clusterInfos(SiStripClusterInfo *cluster, const uint32_t &detid, const TrackerTopology *tTopo, enum ClusterFlags flags, LocalVector LV)
T x() const
Definition: PV3DBase.h:62
void SiStripMonitorTrack::trackStudy ( const edm::Event ev,
const edm::EventSetup es 
)
private

Definition at line 583 of file SiStripMonitorTrack.cc.

References edm::Event::getByToken(), edm::HandleBase::isValid(), dt_dqm_sourceclient_common_cff::reco, TrackLabel_, trackStudyFromTrack(), trackStudyFromTrajectory(), trackToken_, and trackTrajToken_.

Referenced by analyze().

583  {
584 
585 using namespace std;
586 using namespace edm;
587 using namespace reco;
588 
589  // trajectory input
590  edm::Handle<TrajTrackAssociationCollection> TItkAssociatorCollection;
591  ev.getByToken(trackTrajToken_, TItkAssociatorCollection);
592  if( TItkAssociatorCollection.isValid()){
593  trackStudyFromTrajectory(TItkAssociatorCollection,es);
594  } else {
595  edm::LogError("SiStripMonitorTrack")<<"Association not found ... try w/ track collection"<<std::endl;
596 
597  // edm::Handle<std::vector<Trajectory> > trajectories;
598  // ev.getByToken(trajectoryToken_, trajectories);
599  // std::cout << "trajectories isValid ? " << ( trajectories->isValid() ? "YES" : "NOPE" )<< std::endl;
600  // std::cout << "trajectories: " << trajectories->size() << std::endl;
601 
602  // track input
603  edm::Handle<reco::TrackCollection > trackCollectionHandle;
604  ev.getByToken(trackToken_, trackCollectionHandle);//takes the track collection
605  if (!trackCollectionHandle.isValid()){
606  edm::LogError("SiStripMonitorTrack")<<"also Track Collection is not valid !! " << TrackLabel_<<std::endl;
607  return;
608  } else {
609  trackStudyFromTrack(trackCollectionHandle,es);
610  }
611  }
612 
613 }
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)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
bool isValid() const
Definition: HandleBase.h:76
edm::EDGetTokenT< TrajTrackAssociationCollection > trackTrajToken_
void SiStripMonitorTrack::trackStudyFromTrack ( edm::Handle< reco::TrackCollection trackCollectionHandle,
const edm::EventSetup es 
)
private

Definition at line 615 of file SiStripMonitorTrack.cc.

References DetId::det(), reco::HitPattern::getHitPattern(), reco::HitPattern::hitPattern, hitStudy(), i, reco::HitPattern::numberOfHits(), reco::HitPattern::pixelBarrelHitFilter(), reco::HitPattern::TRACK_HITS, DetId::Tracker, and reco::HitPattern::validHitFilter().

Referenced by trackStudy().

615  {
616 
617  // edm::ESHandle<TransientTrackBuilder> builder;
618  // es.get<TransientTrackRecord>().get("TransientTrackBuilder",builder);
619  // const TransientTrackBuilder* transientTrackBuilder = builder.product();
620 
621  reco::TrackCollection trackCollection = *trackCollectionHandle;
622  for (reco::TrackCollection::const_iterator track = trackCollection.begin(), etrack = trackCollection.end();
623  track!=etrack; ++track) {
624 
625  // const reco::TransientTrack transientTrack = transientTrackBuilder->build(track);
626 
627 
628  for (trackingRecHit_iterator hit = track->recHitsBegin(), ehit = track->recHitsEnd();
629  hit!=ehit; ++hit) {
630  if (!(*hit)->isValid()) continue;
631  DetId detID = (*hit)->geographicalId();
632  if (detID.det() != DetId::Tracker) continue;
633  const TrackingRecHit* theHit = (*hit);
634  const ProjectedSiStripRecHit2D* projhit = dynamic_cast<const ProjectedSiStripRecHit2D*>( (theHit) );
635  const SiStripMatchedRecHit2D* matchedhit = dynamic_cast<const SiStripMatchedRecHit2D*> ( (theHit) );
636  const SiStripRecHit2D* hit2D = dynamic_cast<const SiStripRecHit2D*> ( (theHit) );
637  const SiStripRecHit1D* hit1D = dynamic_cast<const SiStripRecHit1D*> ( (theHit) );
638 
639  // GlobalPoint globalPoint = hit->globalPosition();
640  // std::cout << "globalPosition: " << globalPosition << std::endl;
641  // reco::TrajectoryStateOnSurface stateOnSurface = transientTrack->stateOnSurface(globalPoint);
642 
643  LocalVector localMomentum;
644  hitStudy(es,projhit,matchedhit,hit2D,hit1D,localMomentum);
645  }
646 
647 
648 
649  // hit pattern of the track
650  const reco::HitPattern & hitsPattern = track->hitPattern();
651  // loop over the hits of the track
652  // for (int i=0; i<hitsPattern.numberOfHits(); i++) {
653  for (int i=0; i<hitsPattern.numberOfHits(reco::HitPattern::TRACK_HITS); i++) {
654  uint32_t hit = hitsPattern.getHitPattern(reco::HitPattern::TRACK_HITS,i);
655 
656  // if the hit is valid and in pixel barrel, print out the layer
657  if (hitsPattern.validHitFilter(hit) && hitsPattern.pixelBarrelHitFilter(hit))
658  // std::cout << "valid hit found in pixel barrel layer "
659  // << hitsPattern.getLayer(hit) << std::endl;
660 
661  if (!hitsPattern.validHitFilter(hit)) continue;
662 // if (hitsPattern.pixelHitFilter(hit)) std::cout << "pixel" << std::endl; // pixel
663 // if (hitsPattern.pixelBarrelHitFilter(hit)) std::cout << "pixel barrel" << std::endl; // pixel barrel
664 // if (hitsPattern.pixelEndcapHitFilter(hit)) std::cout << "pixel endcap" << std::endl; // pixel endcap
665 // if (hitsPattern.stripHitFilter(hit)) std::cout << "strip" << std::endl; // strip
666 // if (hitsPattern.stripTIBHitFilter(hit)) std::cout << "TIB" << std::endl; // strip TIB
667 // if (hitsPattern.stripTIDHitFilter(hit)) std::cout << "TID" << std::endl; // strip TID
668 // if (hitsPattern.stripTOBHitFilter(hit)) std::cout << "TOB" << std::endl; // strip TOB
669 // if (hitsPattern.stripTECHitFilter(hit)) std::cout << "TEC" << std::endl; // strip TEC
670 // if (hitsPattern.muonDTHitFilter(hit)) std::cout << "DT" << std::endl; // muon DT
671 // if (hitsPattern.muonCSCHitFilter(hit)) std::cout << "CSC" << std::endl; // muon CSC
672 // if (hitsPattern.muonRPCHitFilter(hit)) std::cout << "RPC" << std::endl; // muon RPC
673 //
674 // // expert level: printout the hit in 10-bit binary format
675 // std::cout << "hit in 10-bit binary format = ";
676 // for (int j=9; j>=0; j--) {
677 // int bit = (hit >> j) & 0x1;
678 // std::cout << bit;
679 // }
680 // std::cout << std::endl;
681  }
682  }
683 }
int i
Definition: DBlmapReader.cc:9
void hitStudy(const edm::EventSetup &es, const ProjectedSiStripRecHit2D *projhit, const SiStripMatchedRecHit2D *matchedhit, const SiStripRecHit2D *hit2D, const SiStripRecHit1D *hit1D, LocalVector localMomentum)
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:516
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:418
Definition: DetId.h:18
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:456
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:718
void SiStripMonitorTrack::trackStudyFromTrajectory ( edm::Handle< TrajTrackAssociationCollection TItkAssociatorCollection,
const edm::EventSetup es 
)
private

Definition at line 685 of file SiStripMonitorTrack.cc.

References edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, i, edm::Ref< C, T, F >::key(), LogDebug, and trajectoryStudy().

Referenced by trackStudy().

685  {
686  //Perform track study
687  int i=0;
688  for(TrajTrackAssociationCollection::const_iterator it = TItkAssociatorCollection->begin();it != TItkAssociatorCollection->end(); ++it){
689  const edm::Ref<std::vector<Trajectory> > traj_iterator = it->key;
690 
691  // Trajectory Map, extract Trajectory for this track
692  reco::TrackRef trackref = it->val;
693  LogDebug("SiStripMonitorTrack")
694  << "Track number "<< i+1 << std::endl;
695  // << "\n\tmomentum: " << trackref->momentum()
696  // << "\n\tPT: " << trackref->pt()
697  // << "\n\tvertex: " << trackref->vertex()
698  // << "\n\timpact parameter: " << trackref->d0()
699  // << "\n\tcharge: " << trackref->charge()
700  // << "\n\tnormalizedChi2: " << trackref->normalizedChi2()
701  // <<"\n\tFrom EXTRA : "
702  // <<"\n\t\touter PT "<< trackref->outerPt()<<std::endl;
703  i++;
704 
705  // trajectoryStudy(traj_iterator,trackref,es);
706  trajectoryStudy(traj_iterator,es);
707 
708  }
709 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
key_type key() const
Accessor for product key.
Definition: Ref.h:266
void trajectoryStudy(const edm::Ref< std::vector< Trajectory > > traj, const edm::EventSetup &es)
void SiStripMonitorTrack::trajectoryStudy ( const edm::Ref< std::vector< Trajectory > >  traj,
const edm::EventSetup es 
)
private

Definition at line 439 of file SiStripMonitorTrack.cc.

References TrackingRecHit::geographicalId(), TrajectoryStateOnSurface::localMomentum(), LogDebug, LogTrace, m, PV3DBase< T, PVType, FrameType >::mag(), GluedGeomDet::monoDet(), SiStripMatchedRecHit2D::monoHit(), ProjectedSiStripRecHit2D::originalHit(), DetId::rawId(), alignCSCRings::s, GluedGeomDet::stereoDet(), SiStripMatchedRecHit2D::stereoHit(), tkgeom_, GeomDet::toGlobal(), GeomDet::toLocal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by trackStudyFromTrajectory().

439  {
440 
441 
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++){//loop on measurements
446  //trajectory local direction and position on detector
447  LocalVector statedirection;
448 
449  TrajectoryStateOnSurface updatedtsos=traj_mes_iterator->updatedState();
450  ConstRecHitPointer ttrh=traj_mes_iterator->recHit();
451 
452  if (!ttrh->isValid()) continue;
453 
454  const ProjectedSiStripRecHit2D* projhit = dynamic_cast<const ProjectedSiStripRecHit2D*>( ttrh->hit() );
455  const SiStripMatchedRecHit2D* matchedhit = dynamic_cast<const SiStripMatchedRecHit2D*>( ttrh->hit() );
456  const SiStripRecHit2D* hit2D = dynamic_cast<const SiStripRecHit2D*>( ttrh->hit() );
457  const SiStripRecHit1D* hit1D = dynamic_cast<const SiStripRecHit1D*>( ttrh->hit() );
458  // std::cout << "[SiStripMonitorTrack::trajectoryStudy] RecHit DONE" << std::endl;
459 
460  // RecHitType type=Single;
461 
462  if(matchedhit){
463  LogTrace("SiStripMonitorTrack")<<"\nMatched recHit found"<< std::endl;
464  // type=Matched;
465 
466  GluedGeomDet * gdet=(GluedGeomDet *)tkgeom_->idToDet(matchedhit->geographicalId());
467  GlobalVector gtrkdirup=gdet->toGlobal(updatedtsos.localMomentum());
468  //mono side
469  const GeomDetUnit * monodet=gdet->monoDet();
470  statedirection=monodet->toLocal(gtrkdirup);
471  SiStripRecHit2D m = matchedhit->monoHit();
472  // if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&m,statedirection,trackref,es);
473  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&m,statedirection,es);
474  //stereo side
475  const GeomDetUnit * stereodet=gdet->stereoDet();
476  statedirection=stereodet->toLocal(gtrkdirup);
477  SiStripRecHit2D s = matchedhit->stereoHit();
478  // if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&s,statedirection,trackref,es);
479  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&s,statedirection,es);
480  }
481  else if(projhit){
482  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found"<< std::endl;
483  // type=Projected;
484  GluedGeomDet * gdet=(GluedGeomDet *)tkgeom_->idToDet(projhit->geographicalId());
485 
486  GlobalVector gtrkdirup=gdet->toGlobal(updatedtsos.localMomentum());
487  const SiStripRecHit2D originalhit=projhit->originalHit();
488  const GeomDetUnit * det;
489  if(!StripSubdetector(originalhit.geographicalId().rawId()).stereo()){
490  //mono side
491  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found MONO"<< std::endl;
492  det=gdet->monoDet();
493  statedirection=det->toLocal(gtrkdirup);
494  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es);
495  }
496  else{
497  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found STEREO"<< std::endl;
498  //stereo side
499  det=gdet->stereoDet();
500  statedirection=det->toLocal(gtrkdirup);
501  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es);
502  }
503  }else if (hit2D){
504  statedirection=updatedtsos.localMomentum();
505  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(hit2D,statedirection,es);
506  } else if (hit1D) {
507  statedirection=updatedtsos.localMomentum();
508  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit1D>(hit1D,statedirection,es);
509  } else {
510  LogDebug ("SiStripMonitorTrack")
511  << " LocalMomentum: "<<statedirection
512  << "\nLocal x-z plane angle: "<<atan2(statedirection.x(),statedirection.z());
513  }
514 
515  }
516 
517 }
#define LogDebug(id)
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:20
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:52
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:67
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
LocalVector localMomentum() const
edm::ESHandle< TrackerGeometry > tkgeom_
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
T mag() const
Definition: PV3DBase.h:67
T z() const
Definition: PV3DBase.h:64
#define LogTrace(id)
SiStripRecHit2D originalHit() const
SiStripRecHit2D stereoHit() const
SiStripRecHit2D monoHit() const
DetId geographicalId() const
T x() const
Definition: PV3DBase.h:62
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21

Member Data Documentation

bool SiStripMonitorTrack::applyClusterQuality_
private

Definition at line 194 of file SiStripMonitorTrack.h.

Referenced by clusterInfos(), and SiStripMonitorTrack().

edm::InputTag SiStripMonitorTrack::Cluster_src_
private

Definition at line 170 of file SiStripMonitorTrack.h.

Referenced by SiStripMonitorTrack().

edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > SiStripMonitorTrack::clusterToken_
private

Definition at line 172 of file SiStripMonitorTrack.h.

Referenced by AllClusters(), and SiStripMonitorTrack().

edm::ParameterSet SiStripMonitorTrack::conf_
private
DQMStore* SiStripMonitorTrack::dbe
private

Definition at line 116 of file SiStripMonitorTrack.h.

Referenced by endJob().

SiStripDCSStatus* SiStripMonitorTrack::dcsStatus_
private

Definition at line 200 of file SiStripMonitorTrack.h.

Referenced by analyze(), SiStripMonitorTrack(), and ~SiStripMonitorTrack().

edm::EventNumber_t SiStripMonitorTrack::eventNb
private

Definition at line 191 of file SiStripMonitorTrack.h.

Referenced by analyze(), clusterInfos(), fillMEs(), and fillModMEs().

int SiStripMonitorTrack::firstEvent
private

Definition at line 192 of file SiStripMonitorTrack.h.

Referenced by looper.Looper::loop(), and Printer.Printer::process().

bool SiStripMonitorTrack::flag_ring
private

Definition at line 190 of file SiStripMonitorTrack.h.

Referenced by book(), bookLayerMEs(), fillMEs(), and SiStripMonitorTrack().

SiStripFolderOrganizer SiStripMonitorTrack::folderOrganizer_
private

Definition at line 202 of file SiStripMonitorTrack.h.

Referenced by clusterInfos(), and fillMEs().

GenericTriggerEventFlag* SiStripMonitorTrack::genTriggerEventFlag_
private

Definition at line 201 of file SiStripMonitorTrack.h.

Referenced by analyze(), dqmBeginRun(), and ~SiStripMonitorTrack().

std::string SiStripMonitorTrack::histname
private

Definition at line 118 of file SiStripMonitorTrack.h.

bool SiStripMonitorTrack::HistoFlag_On_
private

Definition at line 180 of file SiStripMonitorTrack.h.

float SiStripMonitorTrack::iOrbitSec
private

Definition at line 120 of file SiStripMonitorTrack.h.

Referenced by analyze().

std::map<std::string, LayerMEs> SiStripMonitorTrack::LayerMEsMap
private

Definition at line 163 of file SiStripMonitorTrack.h.

Referenced by book(), bookLayerMEs(), and fillMEs().

LocalVector SiStripMonitorTrack::LV
private

Definition at line 119 of file SiStripMonitorTrack.h.

bool SiStripMonitorTrack::Mod_On_
private

Definition at line 177 of file SiStripMonitorTrack.h.

Referenced by book(), clusterInfos(), and SiStripMonitorTrack().

std::map<std::string, ModMEs> SiStripMonitorTrack::ModMEsMap
private

Definition at line 162 of file SiStripMonitorTrack.h.

Referenced by bookModMEs(), and fillModMEs().

bool SiStripMonitorTrack::OffHisto_On_
private

Definition at line 179 of file SiStripMonitorTrack.h.

edm::ParameterSet SiStripMonitorTrack::Parameters
private

Definition at line 169 of file SiStripMonitorTrack.h.

bool SiStripMonitorTrack::ring_flag
private

Definition at line 181 of file SiStripMonitorTrack.h.

edm::ESHandle<SiStripDetCabling> SiStripMonitorTrack::SiStripDetCabling_
private

Definition at line 167 of file SiStripMonitorTrack.h.

Referenced by book(), bookLayerMEs(), bookModMEs(), and dqmBeginRun().

double SiStripMonitorTrack::sToNLowerLimit_
private

Definition at line 195 of file SiStripMonitorTrack.h.

Referenced by clusterInfos(), and SiStripMonitorTrack().

double SiStripMonitorTrack::sToNUpperLimit_
private

Definition at line 196 of file SiStripMonitorTrack.h.

Referenced by clusterInfos(), and SiStripMonitorTrack().

std::map<std::string, SubDetMEs> SiStripMonitorTrack::SubDetMEsMap
private

Definition at line 164 of file SiStripMonitorTrack.h.

Referenced by analyze(), book(), bookSubDetMEs(), clusterInfos(), and fillMEs().

edm::ESHandle<TrackerGeometry> SiStripMonitorTrack::tkgeom_
private

Definition at line 166 of file SiStripMonitorTrack.h.

Referenced by dqmBeginRun(), hitStudy(), RecHitInfo(), and trajectoryStudy().

TkHistoMap * SiStripMonitorTrack::tkhisto_NumOffTrack
private

Definition at line 125 of file SiStripMonitorTrack.h.

Referenced by book(), and clusterInfos().

TkHistoMap * SiStripMonitorTrack::tkhisto_NumOnTrack
private

Definition at line 125 of file SiStripMonitorTrack.h.

Referenced by book(), and clusterInfos().

TkHistoMap* SiStripMonitorTrack::tkhisto_StoNCorrOnTrack
private

Definition at line 125 of file SiStripMonitorTrack.h.

Referenced by book(), and clusterInfos().

bool SiStripMonitorTrack::TkHistoMap_On_
private

Definition at line 182 of file SiStripMonitorTrack.h.

Referenced by book(), clusterInfos(), and SiStripMonitorTrack().

std::string SiStripMonitorTrack::topFolderName_
private

Definition at line 122 of file SiStripMonitorTrack.h.

Referenced by book(), and SiStripMonitorTrack().

bool SiStripMonitorTrack::trackAssociatorCollection_in_EventTree
private

Definition at line 189 of file SiStripMonitorTrack.h.

std::string SiStripMonitorTrack::TrackLabel_
private

Definition at line 185 of file SiStripMonitorTrack.h.

Referenced by SiStripMonitorTrack(), and trackStudy().

std::string SiStripMonitorTrack::TrackProducer_
private

Definition at line 184 of file SiStripMonitorTrack.h.

Referenced by SiStripMonitorTrack().

bool SiStripMonitorTrack::tracksCollection_in_EventTree
private

Definition at line 188 of file SiStripMonitorTrack.h.

edm::EDGetTokenT<reco::TrackCollection> SiStripMonitorTrack::trackToken_
private

Definition at line 173 of file SiStripMonitorTrack.h.

Referenced by SiStripMonitorTrack(), and trackStudy().

edm::EDGetTokenT<TrajTrackAssociationCollection> SiStripMonitorTrack::trackTrajToken_
private

Definition at line 175 of file SiStripMonitorTrack.h.

Referenced by SiStripMonitorTrack(), and trackStudy().

bool SiStripMonitorTrack::Trend_On_
private

Definition at line 178 of file SiStripMonitorTrack.h.

Referenced by analyze(), bookSubDetMEs(), and SiStripMonitorTrack().

std::unordered_set<const SiStripCluster*> SiStripMonitorTrack::vPSiStripCluster
private

Definition at line 187 of file SiStripMonitorTrack.h.

Referenced by AllClusters(), analyze(), and RecHitInfo().

double SiStripMonitorTrack::widthLowerLimit_
private

Definition at line 197 of file SiStripMonitorTrack.h.

Referenced by clusterInfos(), and SiStripMonitorTrack().

double SiStripMonitorTrack::widthUpperLimit_
private

Definition at line 198 of file SiStripMonitorTrack.h.

Referenced by clusterInfos(), and SiStripMonitorTrack().