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:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Classes

struct  Det2MEs
 
struct  LayerMEs
 
struct  ModMEs
 
struct  RingMEs
 
struct  SubDetMEs
 

Public Types

typedef
TrackingRecHit::ConstRecHitPointer 
ConstRecHitPointer
 
enum  RecHitType { Single =0, Matched =1, Projected =2, Null =3 }
 
- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

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)
 
 SiStripMonitorTrack (const edm::ParameterSet &)
 
 ~SiStripMonitorTrack ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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 *)
 
void bookModMEs (DQMStore::IBooker &, const uint32_t)
 
void bookRing (DQMStore::IBooker &, const uint32_t, std::string &)
 
void bookRingMEs (DQMStore::IBooker &, const uint32_t, std::string &)
 
void bookSubDetMEs (DQMStore::IBooker &, std::string &name)
 
bool clusterInfos (SiStripClusterInfo *cluster, const uint32_t detid, enum ClusterFlags flags, LocalVector LV, const Det2MEs &MEs)
 
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 *, const uint32_t detid, float, enum ClusterFlags, const LocalVector LV, const Det2MEs &MEs)
 
void fillModMEs (SiStripClusterInfo *cluster, std::string name, float cos, const uint32_t detid, const LocalVector LV)
 
Det2MEs findMEs (const TrackerTopology *tTopo, const uint32_t detid)
 
MonitorElementhandleBookMEs (DQMStore::IBooker &, std::string &, std::string &, std::string &, std::string &)
 
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_
 
SiStripDCSStatusdcsStatus_
 
edm::EventNumber_t eventNb
 
int firstEvent
 
SiStripFolderOrganizer folderOrganizer_
 
GenericTriggerEventFlaggenTriggerEventFlag_
 
std::string histname
 
bool HistoFlag_On_
 
float iLumisection
 
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
 
std::map< std::string, RingMEsRingMEsMap
 
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 DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 72 of file SiStripMonitorTrack.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file SiStripMonitorTrack.cc.

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

25  :
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  TkHistoMap_On_ = conf.getParameter<bool>("TkHistoMap_On");
35 
36  TrackProducer_ = conf_.getParameter<std::string>("TrackProducer");
37  TrackLabel_ = conf_.getParameter<std::string>("TrackLabel");
38 
39  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
40 
41  clusterToken_ = consumes<edmNew::DetSetVector<SiStripCluster> >(Cluster_src_);
42  trackToken_ = consumes<reco::TrackCollection>(edm::InputTag(TrackProducer_,TrackLabel_) );
43  trackTrajToken_ = consumes<TrajTrackAssociationCollection>(edm::InputTag(TrackProducer_,TrackLabel_) );
44 
45  // cluster quality conditions
46  edm::ParameterSet cluster_condition = conf_.getParameter<edm::ParameterSet>("ClusterConditions");
47  applyClusterQuality_ = cluster_condition.getParameter<bool>("On");
48  sToNLowerLimit_ = cluster_condition.getParameter<double>("minStoN");
49  sToNUpperLimit_ = cluster_condition.getParameter<double>("maxStoN");
50  widthLowerLimit_ = cluster_condition.getParameter<double>("minWidth");
51  widthUpperLimit_ = cluster_condition.getParameter<double>("maxWidth");
52 
53 
54  // Create DCS Status
55  bool checkDCS = conf_.getParameter<bool>("UseDCSFiltering");
56  if (checkDCS) dcsStatus_ = new SiStripDCSStatus(consumesCollector());
57  else dcsStatus_ = 0;
58 }
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 61 of file SiStripMonitorTrack.cc.

References dcsStatus_, and genTriggerEventFlag_.

61  {
62  if (dcsStatus_) delete dcsStatus_;
64 }
SiStripDCSStatus * dcsStatus_
GenericTriggerEventFlag * genTriggerEventFlag_

Member Function Documentation

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

Definition at line 892 of file SiStripMonitorTrack.cc.

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

Referenced by analyze().

893 {
894 
895  //Retrieve tracker topology from geometry
896  edm::ESHandle<TrackerTopology> tTopoHandle;
897  es.get<TrackerTopologyRcd>().get(tTopoHandle);
898  const TrackerTopology* const tTopo = tTopoHandle.product();
899 
901  ev.getByToken( clusterToken_, siStripClusterHandle);
902  if (!siStripClusterHandle.isValid()){
903  edm::LogError("SiStripMonitorTrack")<< "ClusterCollection is not valid!!" << std::endl;
904  return;
905  }
906  else
907  {
908  //Loop on Dets
909  for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter=siStripClusterHandle->begin();
910  DSViter!=siStripClusterHandle->end();
911  DSViter++)
912  {
913  uint32_t detid=DSViter->id();
914  const Det2MEs MEs = findMEs(tTopo, detid);
915 
916  LogDebug("SiStripMonitorTrack") << "on detid "<< detid << " N Cluster= " << DSViter->size();
917 
918  //Loop on Clusters
920  ClusIter!=DSViter->end();
921  ClusIter++)
922  {
923  if (vPSiStripCluster.find(&*ClusIter) == vPSiStripCluster.end())
924  {
925  SiStripClusterInfo SiStripClusterInfo_(*ClusIter,es,detid);
926  clusterInfos(&SiStripClusterInfo_,detid,OffTrack,LV,MEs);
927  }
928  }
929  }
930  }
931 }
#define LogDebug(id)
Det2MEs findMEs(const TrackerTopology *tTopo, const uint32_t detid)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
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:75
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
bool clusterInfos(SiStripClusterInfo *cluster, const uint32_t detid, enum ClusterFlags flags, LocalVector LV, const Det2MEs &MEs)
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
void SiStripMonitorTrack::analyze ( const edm::Event e,
const edm::EventSetup es 
)
virtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 90 of file SiStripMonitorTrack.cc.

References GenericTriggerEventFlag::accept(), AllClusters(), dcsStatus_, edm::EventID::event(), eventNb, fillME(), genTriggerEventFlag_, SiStripDCSStatus::getStatus(), edm::EventBase::id(), iLumisection, 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.

91 {
92  // Filter out events if DCS checking is requested
93  if (dcsStatus_ && !dcsStatus_->getStatus(e,es)) return;
94 
95  // Filter out events if Trigger Filtering is requested
96  if (genTriggerEventFlag_->on()&& ! genTriggerEventFlag_->accept( e, es) ) return;
97 
98  //initialization of global quantities
99  LogDebug("SiStripMonitorTrack") << "[SiStripMonitorTrack::analyse] " << "Run " << e.id().run() << " Event " << e.id().event() << std::endl;
100  eventNb = e.id().event();
101  vPSiStripCluster.clear();
102 
103  iLumisection = e.orbitNumber()/262144.0;
104 
105  // initialise # of clusters
106  for (std::map<std::string, SubDetMEs>::iterator iSubDet = SubDetMEsMap.begin();
107  iSubDet != SubDetMEsMap.end(); iSubDet++) {
108  iSubDet->second.totNClustersOnTrack = 0;
109  iSubDet->second.totNClustersOffTrack = 0;
110  }
111 
112  //Perform track study
113  trackStudy(e, es);
114 
115  //Perform Cluster Study (irrespectively to tracks)
116 
117  AllClusters(e, es); //analyzes the off Track Clusters
118 
119  //Summary Counts of clusters
120  std::map<std::string, MonitorElement*>::iterator iME;
121  std::map<std::string, LayerMEs>::iterator iLayerME;
122 
123  for (std::map<std::string, SubDetMEs>::iterator iSubDet = SubDetMEsMap.begin();
124  iSubDet != SubDetMEsMap.end(); iSubDet++) {
125  SubDetMEs subdet_mes = iSubDet->second;
126  if (subdet_mes.totNClustersOnTrack > 0) {
127  fillME(subdet_mes.nClustersOnTrack, subdet_mes.totNClustersOnTrack);
128  }
129  fillME(subdet_mes.nClustersOffTrack, subdet_mes.totNClustersOffTrack);
130  if (Trend_On_) {
131  fillME(subdet_mes.nClustersTrendOnTrack,iLumisection,subdet_mes.totNClustersOnTrack);
132  fillME(subdet_mes.nClustersTrendOffTrack,iLumisection,subdet_mes.totNClustersOffTrack);
133  }
134  }
135 }
#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:67
GenericTriggerEventFlag * genTriggerEventFlag_
edm::EventID id() const
Definition: EventBase.h:60
void SiStripMonitorTrack::book ( DQMStore::IBooker ibooker,
const TrackerTopology tTopo 
)
private

Definition at line 138 of file SiStripMonitorTrack.cc.

References bookLayerMEs(), bookModMEs(), bookRingMEs(), bookSubDetMEs(), cond::rpcobgas::detid, SiStripFolderOrganizer::GetSubDetAndLayer(), SiStripFolderOrganizer::getSubDetFolderAndTag(), SiStripHistoId::getSubdetid(), LayerMEsMap, Mod_On_, mergeVDriftHistosByStation::name, alignCSCRings::ring_id, RingMEsMap, 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().

139 {
140 
141  SiStripFolderOrganizer folder_organizer;
142  folder_organizer.setSiStripFolderName(topFolderName_);
143  //******** TkHistoMaps
144  if (TkHistoMap_On_) {
145  tkhisto_StoNCorrOnTrack = new TkHistoMap(ibooker , topFolderName_ ,"TkHMap_StoNCorrOnTrack", 0.0,true);
146  tkhisto_NumOnTrack = new TkHistoMap(ibooker , topFolderName_, "TkHMap_NumberOfOnTrackCluster", 0.0,true);
147  tkhisto_NumOffTrack = new TkHistoMap(ibooker , topFolderName_, "TkHMap_NumberOfOfffTrackCluster",0.0,true);
148  }
149  //******** TkHistoMaps
150 
151  std::vector<uint32_t> vdetId_;
152  SiStripDetCabling_->addActiveDetectorsRawIds(vdetId_);
153  //Histos for each detector, layer and module
154  for (std::vector<uint32_t>::const_iterator detid_iter=vdetId_.begin();detid_iter!=vdetId_.end();detid_iter++){ //loop on all the active detid
155  uint32_t detid = *detid_iter;
156 
157  if (detid < 1){
158  edm::LogError("SiStripMonitorTrack")<< "[" <<__PRETTY_FUNCTION__ << "] invalid detid " << detid<< std::endl;
159  continue;
160  }
161 
162 
164 
165  // book Layer and RING plots
166  std::pair<std::string,int32_t> det_layer_pair = folder_organizer.GetSubDetAndLayer(detid,tTopo,false);
167  /*
168  std::string thickness;
169  std::pair<std::string,int32_t> det_layer_pair_test = folder_organizer.GetSubDetAndLayerThickness(detid,tTopo,thickness);
170  std::cout << "[SiStripMonitorTrack::book] det_layer_pair " << det_layer_pair.first << " " << det_layer_pair.second << " " << thickness << std::endl;
171  */
172 
173  SiStripHistoId hidmanager;
174  std::string layer_id = hidmanager.getSubdetid(detid, tTopo, false);
175 
176  std::map<std::string, LayerMEs>::iterator iLayerME = LayerMEsMap.find(layer_id);
177  if(iLayerME==LayerMEsMap.end()){
178  folder_organizer.setLayerFolder(detid, tTopo, det_layer_pair.second, false);
179  bookLayerMEs(ibooker , detid, layer_id);
180  }
181 
182  std::string subdet = det_layer_pair.first;
183  if ( subdet.find("TEC") != std::string::npos || subdet.find("TID") != std::string::npos ) {
184  std::pair<std::string,int32_t> det_ring_pair = folder_organizer.GetSubDetAndLayer(detid,tTopo,true);
185  std::string ring_id = hidmanager.getSubdetid(detid, tTopo, true);
186  std::map<std::string, RingMEs>::iterator iRingME = RingMEsMap.find(ring_id);
187  if(iRingME==RingMEsMap.end()){
188  folder_organizer.setLayerFolder(detid, tTopo, det_ring_pair.second, true);
189  bookRingMEs(ibooker , detid, ring_id);
190  }
191  }
192 
193  // book sub-detector plots
194  std::pair<std::string,std::string> sdet_pair = folder_organizer.getSubDetFolderAndTag(detid, tTopo);
195  if (SubDetMEsMap.find(sdet_pair.second) == SubDetMEsMap.end()){
196  ibooker.setCurrentFolder(sdet_pair.first);
197  bookSubDetMEs(ibooker , sdet_pair.second);
198  }
199  // book module plots
200  if(Mod_On_) {
201  folder_organizer.setDetectorFolder(detid,tTopo);
202  bookModMEs(ibooker , *detid_iter);
203  }
204  }//end loop on detectors detid
205 }
TkHistoMap * tkhisto_NumOffTrack
void setSiStripFolderName(std::string name)
std::pair< const std::string, const char * > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
std::map< std::string, RingMEs > RingMEsMap
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=0)
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
void bookLayerMEs(DQMStore::IBooker &, const uint32_t, std::string &)
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 bookModMEs(DQMStore::IBooker &, const uint32_t)
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
TkHistoMap * tkhisto_NumOnTrack
TkHistoMap * tkhisto_StoNCorrOnTrack
void bookRingMEs(DQMStore::IBooker &, const uint32_t, std::string &)
std::map< std::string, LayerMEs > LayerMEsMap
void SiStripMonitorTrack::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  es 
)
overridevirtual

Implements 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<TrackerTopologyRcd>().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 275 of file SiStripMonitorTrack.cc.

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

Referenced by book().

276 {
277  std::string name = "layer";
278  std::string view = "layerView";
279  std::string hname;
280  std::string hpar;
281  SiStripHistoId hidmanager;
282 
283  LayerMEs theLayerMEs;
284  theLayerMEs.ClusterStoNCorrOnTrack = 0;
285  theLayerMEs.ClusterChargeCorrOnTrack = 0;
286  theLayerMEs.ClusterChargeOnTrack = 0;
287  theLayerMEs.ClusterChargeOffTrack = 0;
288  theLayerMEs.ClusterNoiseOnTrack = 0;
289  theLayerMEs.ClusterNoiseOffTrack = 0;
290  theLayerMEs.ClusterWidthOnTrack = 0;
291  theLayerMEs.ClusterWidthOffTrack = 0;
292  theLayerMEs.ClusterPosOnTrack = 0;
293  theLayerMEs.ClusterPosOffTrack = 0;
294  theLayerMEs.ClusterChargePerCMfromTrack = 0;
295  theLayerMEs.ClusterChargePerCMfromOriginOnTrack = 0;
296  theLayerMEs.ClusterChargePerCMfromOriginOffTrack = 0;
297 
298  // Signal/Noise (w/ cluster charge corrected)
299  hname = hidmanager.createHistoLayer("Summary_ClusterStoNCorr",name,layer_id,"OnTrack");
300  hpar = "TH1ClusterStoNCorr";
301  theLayerMEs.ClusterStoNCorrOnTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
302 
303  // Cluster Charge Corrected
304  hname = hidmanager.createHistoLayer("Summary_ClusterChargeCorr",name,layer_id,"OnTrack");
305  hpar = "TH1ClusterChargeCorr";
306  theLayerMEs.ClusterChargeCorrOnTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
307 
308  // Cluster Charge (On and Off Track)
309  hname = hidmanager.createHistoLayer("Summary_ClusterCharge",name,layer_id,"OnTrack");
310  hpar = "TH1ClusterCharge";
311  theLayerMEs.ClusterChargeOnTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
312 
313  hname = hidmanager.createHistoLayer("Summary_ClusterCharge",name,layer_id,"OffTrack");
314  hpar = "TH1ClusterCharge";
315  theLayerMEs.ClusterChargeOffTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
316 
317  // Cluster Noise (On and Off Track)
318  hname = hidmanager.createHistoLayer("Summary_ClusterNoise",name,layer_id,"OnTrack");
319  hpar = "TH1ClusterNoise";
320  theLayerMEs.ClusterNoiseOnTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
321 
322  hname = hidmanager.createHistoLayer("Summary_ClusterNoise",name,layer_id,"OffTrack");
323  hpar = "TH1ClusterNoise";
324  theLayerMEs.ClusterNoiseOffTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
325 
326  // Cluster Width (On and Off Track)
327  hname = hidmanager.createHistoLayer("Summary_ClusterWidth",name,layer_id,"OnTrack");
328  hpar = "TH1ClusterWidth";
329  theLayerMEs.ClusterWidthOnTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
330 
331  hname = hidmanager.createHistoLayer("Summary_ClusterWidth",name,layer_id,"OffTrack");
332  hpar = "TH1ClusterWidth";
333  theLayerMEs.ClusterWidthOffTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
334 
335  //Cluster Position
336  short total_nr_strips = SiStripDetCabling_->nApvPairs(mod_id) * 2 * 128;
337  if (layer_id.find("TEC") != std::string::npos) total_nr_strips = 3 * 2 * 128;
338 
339  hname = hidmanager.createHistoLayer("Summary_ClusterPosition",name,layer_id,"OnTrack");
340  theLayerMEs.ClusterPosOnTrack = ibooker.book1D(hname, hname, total_nr_strips, 0.5,total_nr_strips+0.5);
341 
342  hname = hidmanager.createHistoLayer("Summary_ClusterPosition",name,layer_id,"OffTrack");
343  theLayerMEs.ClusterPosOffTrack = ibooker.book1D(hname, hname, total_nr_strips, 0.5,total_nr_strips+0.5);
344 
345  // dQ/dx
346  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromTrack",name,layer_id,"");
347  hpar = "TH1ClusterChargePerCM";
348  theLayerMEs.ClusterChargePerCMfromTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
349 
350  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromOrigin",name,layer_id,"OnTrack");
351  hpar = "TH1ClusterChargePerCM";
352  theLayerMEs.ClusterChargePerCMfromOriginOnTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
353 
354  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromOrigin",name,layer_id,"OffTrack");
355  hpar = "TH1ClusterChargePerCM";
356  theLayerMEs.ClusterChargePerCMfromOriginOffTrack = handleBookMEs(ibooker,view,layer_id,hpar,hname);
357 
358  //bookeeping
359  LayerMEsMap[layer_id]=theLayerMEs;
360 
361 }
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * handleBookMEs(DQMStore::IBooker &, std::string &, std::string &, std::string &, std::string &)
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 515 of file SiStripMonitorTrack.cc.

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

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

516 {
517  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
518  return ibooker.book1D(HistoName,HistoName,
519  Parameters.getParameter<int32_t>("Nbinx"),
520  Parameters.getParameter<double>("xmin"),
521  Parameters.getParameter<double>("xmax")
522  );
523 }
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 526 of file SiStripMonitorTrack.cc.

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

527 {
528  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
529  return ibooker.book2D(HistoName,HistoName,
530  Parameters.getParameter<int32_t>("Nbinx"),
531  Parameters.getParameter<double>("xmin"),
532  Parameters.getParameter<double>("xmax"),
533  Parameters.getParameter<int32_t>("Nbiny"),
534  Parameters.getParameter<double>("ymin"),
535  Parameters.getParameter<double>("ymax")
536  );
537 }
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 540 of file SiStripMonitorTrack.cc.

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

541 {
542  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
543  return ibooker.book3D(HistoName,HistoName,
544  Parameters.getParameter<int32_t>("Nbinx"),
545  Parameters.getParameter<double>("xmin"),
546  Parameters.getParameter<double>("xmax"),
547  Parameters.getParameter<int32_t>("Nbiny"),
548  Parameters.getParameter<double>("ymin"),
549  Parameters.getParameter<double>("ymax"),
550  Parameters.getParameter<int32_t>("Nbinz"),
551  Parameters.getParameter<double>("zmin"),
552  Parameters.getParameter<double>("zmax")
553  );
554 }
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 557 of file SiStripMonitorTrack.cc.

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

Referenced by bookModMEs().

558 {
559  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
560  return ibooker.bookProfile(HistoName,HistoName,
561  Parameters.getParameter<int32_t>("Nbinx"),
562  Parameters.getParameter<double>("xmin"),
563  Parameters.getParameter<double>("xmax"),
564  Parameters.getParameter<int32_t>("Nbiny"),
565  Parameters.getParameter<double>("ymin"),
566  Parameters.getParameter<double>("ymax"),
567  "" );
568 }
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 *  HistoName 
)
private

Definition at line 571 of file SiStripMonitorTrack.cc.

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

Referenced by bookSubDetMEs().

572 {
573  edm::ParameterSet ParametersTrend = conf_.getParameter<edm::ParameterSet>("Trending");
575  ParametersTrend.getParameter<int32_t>("Nbins"),
576  ParametersTrend.getParameter<double>("xmin"),
577  ParametersTrend.getParameter<double>("xmax"),
578  0 , 0 , "" );
579  if (me->kind() == MonitorElement::DQM_KIND_TPROFILE) me->getTH1()->SetCanExtend(TH1::kAllAxes);
580 
581  if(!me) return me;
582  me->setAxisTitle("Lumisection",1);
583  return me;
584 }
T getParameter(std::string const &) const
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
edm::ParameterSet conf_
TH1 * getTH1(void) const
std::string HistoName
void SiStripMonitorTrack::bookModMEs ( DQMStore::IBooker ibooker,
const uint32_t  id 
)
private

Definition at line 208 of file SiStripMonitorTrack.cc.

References DQMStore::IBooker::book1D(), bookME1D(), bookMEProfile(), SiStripMonitorTrack::ModMEs::ClusterCharge, SiStripMonitorTrack::ModMEs::ClusterChargeCorr, SiStripMonitorTrack::ModMEs::ClusterChargePerCMfromOrigin, SiStripMonitorTrack::ModMEs::ClusterChargePerCMfromTrack, 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().

209 {
210  std::string name = "det";
211  SiStripHistoId hidmanager;
212  std::string hid = hidmanager.createHistoId("",name,id);
213  std::map<std::string, ModMEs>::iterator iModME = ModMEsMap.find(hid);
214  if(iModME==ModMEsMap.end()){
215  ModMEs theModMEs;
216  theModMEs.ClusterStoNCorr = 0;
217  theModMEs.ClusterCharge = 0;
218  theModMEs.ClusterChargeCorr = 0;
219  theModMEs.ClusterWidth = 0;
220  theModMEs.ClusterPos = 0;
221  theModMEs.ClusterPGV = 0;
222  theModMEs.ClusterChargePerCMfromTrack = 0;
223  theModMEs.ClusterChargePerCMfromOrigin = 0;
224 
225  // Cluster Width
226  theModMEs.ClusterWidth=bookME1D(ibooker , "TH1ClusterWidth", hidmanager.createHistoId("ClusterWidth_OnTrack",name,id).c_str());
227  ibooker.tag(theModMEs.ClusterWidth,id);
228  // Cluster Charge
229  theModMEs.ClusterCharge=bookME1D(ibooker , "TH1ClusterCharge", hidmanager.createHistoId("ClusterCharge_OnTrack",name,id).c_str());
230  ibooker.tag(theModMEs.ClusterCharge,id);
231  // Cluster Charge Corrected
232  theModMEs.ClusterChargeCorr=bookME1D(ibooker , "TH1ClusterChargeCorr", hidmanager.createHistoId("ClusterChargeCorr_OnTrack",name,id).c_str());
233  ibooker.tag(theModMEs.ClusterChargeCorr,id);
234  // Cluster StoN Corrected
235  theModMEs.ClusterStoNCorr=bookME1D(ibooker , "TH1ClusterStoNCorrMod", hidmanager.createHistoId("ClusterStoNCorr_OnTrack",name,id).c_str());
236  ibooker.tag(theModMEs.ClusterStoNCorr,id);
237  // Cluster Position
238  short total_nr_strips = SiStripDetCabling_->nApvPairs(id) * 2 * 128;
239  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);
240  ibooker.tag(theModMEs.ClusterPos,id);
241  // Cluster PGV
242  theModMEs.ClusterPGV=bookMEProfile(ibooker , "TProfileClusterPGV", hidmanager.createHistoId("PGV_OnTrack",name,id).c_str());
243  ibooker.tag(theModMEs.ClusterPGV,id);
244  // Cluster Charge per cm
245  theModMEs.ClusterChargePerCMfromTrack = bookME1D(ibooker , "TH1ClusterChargePerCM", hidmanager.createHistoId("ClusterChargePerCMfromTrack",name,id).c_str());
246  ibooker.tag(theModMEs.ClusterChargePerCMfromTrack,id);
247 
248  theModMEs.ClusterChargePerCMfromOrigin = bookME1D(ibooker , "TH1ClusterChargePerCM", hidmanager.createHistoId("ClusterChargePerCMfromOrigin",name,id).c_str());
249  ibooker.tag(theModMEs.ClusterChargePerCMfromOrigin,id);
250 
251  ModMEsMap[hid]=theModMEs;
252  }
253 }
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::bookRing ( DQMStore::IBooker ,
const uint32_t  ,
std::string &   
)
private
void SiStripMonitorTrack::bookRingMEs ( DQMStore::IBooker ibooker,
const uint32_t  mod_id,
std::string &  ring_id 
)
private

Definition at line 363 of file SiStripMonitorTrack.cc.

References SiStripMonitorTrack::RingMEs::ClusterChargeCorrOnTrack, SiStripMonitorTrack::RingMEs::ClusterChargeOffTrack, SiStripMonitorTrack::RingMEs::ClusterChargeOnTrack, SiStripMonitorTrack::RingMEs::ClusterChargePerCMfromOriginOffTrack, SiStripMonitorTrack::RingMEs::ClusterChargePerCMfromOriginOnTrack, SiStripMonitorTrack::RingMEs::ClusterChargePerCMfromTrack, SiStripMonitorTrack::RingMEs::ClusterNoiseOffTrack, SiStripMonitorTrack::RingMEs::ClusterNoiseOnTrack, SiStripMonitorTrack::RingMEs::ClusterStoNCorrOnTrack, SiStripMonitorTrack::RingMEs::ClusterWidthOffTrack, SiStripMonitorTrack::RingMEs::ClusterWidthOnTrack, SiStripHistoId::createHistoLayer(), handleBookMEs(), mergeVDriftHistosByStation::name, alignCSCRings::ring_id, RingMEsMap, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by book().

364 {
365 
366  std::string name = "ring";
367  std::string view = "ringView";
368  std::string hname;
369  std::string hpar;
370  SiStripHistoId hidmanager;
371 
372  RingMEs theRingMEs;
373  theRingMEs.ClusterStoNCorrOnTrack = 0;
374  theRingMEs.ClusterChargeCorrOnTrack = 0;
375  theRingMEs.ClusterChargeOnTrack = 0;
376  theRingMEs.ClusterChargeOffTrack = 0;
377  theRingMEs.ClusterNoiseOnTrack = 0;
378  theRingMEs.ClusterNoiseOffTrack = 0;
379  theRingMEs.ClusterWidthOnTrack = 0;
380  theRingMEs.ClusterWidthOffTrack = 0;
381  theRingMEs.ClusterChargePerCMfromTrack = 0;
382  theRingMEs.ClusterChargePerCMfromOriginOnTrack = 0;
383  theRingMEs.ClusterChargePerCMfromOriginOffTrack = 0;
384 
385  hname = hidmanager.createHistoLayer("Summary_ClusterStoNCorr",name,ring_id,"OnTrack");
386  hpar = "TH1ClusterStoNCorr";
387  theRingMEs.ClusterStoNCorrOnTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
388 
389  // Cluster Charge Corrected
390  hname = hidmanager.createHistoLayer("Summary_ClusterChargeCorr",name,ring_id,"OnTrack");
391  hpar = "TH1ClusterChargeCorr";
392  theRingMEs.ClusterChargeCorrOnTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
393 
394  // Cluster Charge (On and Off Track)
395  hname = hidmanager.createHistoLayer("Summary_ClusterCharge",name,ring_id,"OnTrack");
396  hpar = "TH1ClusterCharge";
397  theRingMEs.ClusterChargeOnTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
398 
399  hname = hidmanager.createHistoLayer("Summary_ClusterCharge",name,ring_id,"OffTrack");
400  hpar = "TH1ClusterCharge";
401  theRingMEs.ClusterChargeOffTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
402 
403  // Cluster Noise (On and Off Track)
404  hname = hidmanager.createHistoLayer("Summary_ClusterNoise",name,ring_id,"OnTrack");
405  hpar = "TH1ClusterNoise";
406  theRingMEs.ClusterNoiseOnTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
407 
408  hname = hidmanager.createHistoLayer("Summary_ClusterNoise",name,ring_id,"OffTrack");
409  hpar = "TH1ClusterNoise";
410  theRingMEs.ClusterNoiseOffTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
411 
412  // Cluster Width (On and Off Track)
413  hname = hidmanager.createHistoLayer("Summary_ClusterWidth",name,ring_id,"OnTrack");
414  hpar = "TH1ClusterWidth";
415  theRingMEs.ClusterWidthOnTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
416 
417  hname = hidmanager.createHistoLayer("Summary_ClusterWidth",name,ring_id,"OffTrack");
418  hpar = "TH1ClusterWidth";
419  theRingMEs.ClusterWidthOffTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
420 
421  // dQ/dx
422  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromTrack",name,ring_id,"");
423  hpar = "TH1ClusterChargePerCM";
424  theRingMEs.ClusterChargePerCMfromTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
425 
426  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromOrigin",name,ring_id,"OnTrack");
427  hpar = "TH1ClusterChargePerCM";
428  theRingMEs.ClusterChargePerCMfromOriginOnTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
429 
430  hname = hidmanager.createHistoLayer("Summary_ClusterChargePerCMfromOrigin",name,ring_id,"OffTrack");
431  hpar = "TH1ClusterChargePerCM";
432  theRingMEs.ClusterChargePerCMfromOriginOffTrack = handleBookMEs(ibooker,view,ring_id,hpar,hname);
433 
434  //bookeeping
435  RingMEsMap[ring_id]=theRingMEs;
436 
437 }
std::map< std::string, RingMEs > RingMEsMap
MonitorElement * handleBookMEs(DQMStore::IBooker &, std::string &, std::string &, std::string &, std::string &)
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
void SiStripMonitorTrack::bookSubDetMEs ( DQMStore::IBooker ibooker,
std::string &  name 
)
private

Definition at line 442 of file SiStripMonitorTrack.cc.

References bookME1D(), bookMETrend(), SiStripMonitorTrack::SubDetMEs::ClusterChargeOffTrack, SiStripMonitorTrack::SubDetMEs::ClusterChargeOnTrack, SiStripMonitorTrack::SubDetMEs::ClusterChargePerCMfromOriginOffTrack, SiStripMonitorTrack::SubDetMEs::ClusterChargePerCMfromOriginOnTrack, SiStripMonitorTrack::SubDetMEs::ClusterChargePerCMfromTrack, 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().

442  {
443 
445  subdet_tag = "__" + name;
446  std::string completeName;
447 
448  SubDetMEs theSubDetMEs;
449  theSubDetMEs.totNClustersOnTrack = 0;
450  theSubDetMEs.totNClustersOffTrack = 0;
451  theSubDetMEs.nClustersOnTrack = 0;
452  theSubDetMEs.nClustersTrendOnTrack = 0;
453  theSubDetMEs.nClustersOffTrack = 0;
454  theSubDetMEs.nClustersTrendOffTrack = 0;
455  theSubDetMEs.ClusterStoNCorrOnTrack = 0;
456  theSubDetMEs.ClusterChargeOnTrack = 0;
457  theSubDetMEs.ClusterChargeOffTrack = 0;
458  theSubDetMEs.ClusterStoNOffTrack = 0;
459  theSubDetMEs.ClusterChargePerCMfromTrack = 0;
460  theSubDetMEs.ClusterChargePerCMfromOriginOnTrack = 0;
461  theSubDetMEs.ClusterChargePerCMfromOriginOffTrack = 0;
462 
463  // TotalNumber of Cluster OnTrack
464  completeName = "Summary_TotalNumberOfClusters_OnTrack" + subdet_tag;
465  theSubDetMEs.nClustersOnTrack = bookME1D(ibooker , "TH1nClustersOn", completeName.c_str());
466  theSubDetMEs.nClustersOnTrack->getTH1()->StatOverflows(kTRUE);
467 
468  // TotalNumber of Cluster OffTrack
469  completeName = "Summary_TotalNumberOfClusters_OffTrack" + subdet_tag;
470  theSubDetMEs.nClustersOffTrack = bookME1D(ibooker , "TH1nClustersOff", completeName.c_str());
471  theSubDetMEs.nClustersOffTrack->getTH1()->StatOverflows(kTRUE);
472 
473  // Cluster StoN On Track
474  completeName = "Summary_ClusterStoNCorr_OnTrack" + subdet_tag;
475  theSubDetMEs.ClusterStoNCorrOnTrack = bookME1D(ibooker , "TH1ClusterStoNCorr", completeName.c_str());
476 
477  // Cluster Charge On Track
478  completeName = "Summary_ClusterCharge_OnTrack" + subdet_tag;
479  theSubDetMEs.ClusterChargeOnTrack=bookME1D(ibooker , "TH1ClusterCharge", completeName.c_str());
480 
481  // Cluster Charge Off Track
482  completeName = "Summary_ClusterCharge_OffTrack" + subdet_tag;
483  theSubDetMEs.ClusterChargeOffTrack=bookME1D(ibooker , "TH1ClusterCharge", completeName.c_str());
484 
485  // Cluster Charge StoN Off Track
486  completeName = "Summary_ClusterStoN_OffTrack" + subdet_tag;
487  theSubDetMEs.ClusterStoNOffTrack = bookME1D(ibooker , "TH1ClusterStoN", completeName.c_str());
488 
489  // cluster charge per cm on track
490  completeName = "Summary_ClusterChargePerCMfromTrack" + subdet_tag;
491  theSubDetMEs.ClusterChargePerCMfromTrack=bookME1D(ibooker , "TH1ClusterChargePerCM", completeName.c_str());
492 
493  // cluster charge per cm on track
494  completeName = "Summary_ClusterChargePerCMfromOrigin_OnTrack" + subdet_tag;
495  theSubDetMEs.ClusterChargePerCMfromOriginOnTrack=bookME1D(ibooker , "TH1ClusterChargePerCM", completeName.c_str());
496 
497  // cluster charge per cm off track
498  completeName = "Summary_ClusterChargePerCMfromOrigin_OffTrack" + subdet_tag;
499  theSubDetMEs.ClusterChargePerCMfromOriginOffTrack=bookME1D(ibooker , "TH1ClusterChargePerCM", completeName.c_str());
500 
501  if(Trend_On_){
502  // TotalNumber of Cluster
503  completeName = "Trend_TotalNumberOfClusters_OnTrack" + subdet_tag;
504  theSubDetMEs.nClustersTrendOnTrack = bookMETrend(ibooker , completeName.c_str());
505  completeName = "Trend_TotalNumberOfClusters_OffTrack" + subdet_tag;
506  theSubDetMEs.nClustersTrendOffTrack = bookMETrend(ibooker , completeName.c_str());
507  }
508 
509  //bookeeping
510  SubDetMEsMap[name]=theSubDetMEs;
511 
512 }
MonitorElement * bookME1D(DQMStore::IBooker &, const char *, const char *)
std::map< std::string, SubDetMEs > SubDetMEsMap
const std::string subdet_tag("SubDet")
TH1 * getTH1(void) const
MonitorElement * bookMETrend(DQMStore::IBooker &, const char *)
bool SiStripMonitorTrack::clusterInfos ( SiStripClusterInfo cluster,
const uint32_t  detid,
enum ClusterFlags  flags,
LocalVector  LV,
const Det2MEs MEs 
)
private

Definition at line 965 of file SiStripMonitorTrack.cc.

References TkHistoMap::add(), applyClusterQuality_, SiStripClusterInfo::charge(), SiStripHistoId::createHistoId(), SiStripClusterInfo::detId(), eventNb, TkHistoMap::fill(), fillMEs(), fillModMEs(), SiStripMonitorTrack::Det2MEs::iSubdet, LogDebug, PV3DBase< T, PVType, FrameType >::mag(), Mod_On_, mergeVDriftHistosByStation::name, HLT_25ns14e33_v1_cff::noise, SiStripClusterInfo::noiseRescaledByGain(), NULL, OffTrack, OnTrack, SiStripClusterInfo::signalOverNoise(), sToNLowerLimit_, sToNUpperLimit_, AlCaHLTBitMon_QueryRunRegistry::string, tkhisto_NumOffTrack, tkhisto_NumOnTrack, tkhisto_StoNCorrOnTrack, TkHistoMap_On_, SiStripMonitorTrack::SubDetMEs::totNClustersOffTrack, SiStripMonitorTrack::SubDetMEs::totNClustersOnTrack, 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().

966 {
967 
968  if (cluster==NULL) return false;
969  // if one imposes a cut on the clusters, apply it
970  if( (applyClusterQuality_) &&
971  (cluster->signalOverNoise() < sToNLowerLimit_ ||
972  cluster->signalOverNoise() > sToNUpperLimit_ ||
973  cluster->width() < widthLowerLimit_ ||
974  cluster->width() > widthUpperLimit_) ) return false;
975  // start of the analysis
976 
977  if (MEs.iSubdet != nullptr) {
978  if (flag == OnTrack) MEs.iSubdet->totNClustersOnTrack++;
979  else if (flag == OffTrack) MEs.iSubdet->totNClustersOffTrack++;
980  }
981 
982  float cosRZ = -2;
983  LogDebug("SiStripMonitorTrack")<< "\n\tLV " << LV.x() << " " << LV.y() << " " << LV.z() << " " << LV.mag() << std::endl;
984  if (LV.mag()!=0){
985  cosRZ= fabs(LV.z())/LV.mag();
986  LogDebug("SiStripMonitorTrack")<< "\n\t cosRZ " << cosRZ << std::endl;
987  }
989 
990  // Filling SubDet/Layer Plots (on Track + off Track)
991  fillMEs(cluster,detid,cosRZ,flag,LV,MEs);
992 
993  //******** TkHistoMaps
994  if (TkHistoMap_On_) {
995  uint32_t adet=cluster->detId();
996  float noise = cluster->noiseRescaledByGain();
997  if(flag==OnTrack){
998  tkhisto_NumOnTrack->add(adet,1.);
999  if(noise > 0.0) tkhisto_StoNCorrOnTrack->fill(adet,cluster->signalOverNoise()*cosRZ);
1000  if(noise == 0.0)
1001  LogDebug("SiStripMonitorTrack") << "Module " << detid << " in Event " << eventNb << " noise " << noise << std::endl;
1002  }
1003  else if(flag==OffTrack){
1004  tkhisto_NumOffTrack->add(adet,1.);
1005  if(cluster->charge() > 250){
1006  LogDebug("SiStripMonitorTrack") << "Module firing " << detid << " in Event " << eventNb << std::endl;
1007  }
1008  }
1009  }
1010 
1011  // Module plots filled only for onTrack Clusters
1012  if(Mod_On_){
1013  if(flag==OnTrack){
1014  SiStripHistoId hidmanager2;
1015  name =hidmanager2.createHistoId("","det",detid);
1016  fillModMEs(cluster,name,cosRZ,detid,LV);
1017  }
1018  }
1019  return true;
1020 }
#define LogDebug(id)
void fillMEs(SiStripClusterInfo *, const uint32_t detid, float, enum ClusterFlags, const LocalVector LV, const Det2MEs &MEs)
TkHistoMap * tkhisto_NumOffTrack
float noiseRescaledByGain() const
T y() const
Definition: PV3DBase.h:63
#define NULL
Definition: scimark2.h:8
float signalOverNoise() const
T mag() const
Definition: PV3DBase.h:67
edm::EventNumber_t eventNb
uint16_t charge() const
void fill(uint32_t &detid, float value)
Definition: TkHistoMap.cc:180
T z() const
Definition: PV3DBase.h:64
uint16_t width() const
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
TkHistoMap * tkhisto_NumOnTrack
uint32_t detId() const
TkHistoMap * tkhisto_StoNCorrOnTrack
void fillModMEs(SiStripClusterInfo *cluster, std::string name, float cos, const uint32_t detid, const LocalVector LV)
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 DQMEDAnalyzer.

Definition at line 67 of file SiStripMonitorTrack.cc.

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

68 {
69  //get geom
71  LogDebug("SiStripMonitorTrack") << "[SiStripMonitorTrack::beginRun] There are "<<tkgeom_->detUnits().size() <<" detectors instantiated in the geometry" << std::endl;
73 
74 
75  // Initialize the GenericTriggerEventFlag
77 }
#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::fillME ( MonitorElement ME,
float  value1 
)
inlineprivate

Definition at line 112 of file SiStripMonitorTrack.h.

References MonitorElement::Fill().

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

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

Definition at line 113 of file SiStripMonitorTrack.h.

References MonitorElement::Fill().

113 {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 114 of file SiStripMonitorTrack.h.

References MonitorElement::Fill().

114 {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 115 of file SiStripMonitorTrack.h.

References MonitorElement::Fill().

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

Definition at line 1071 of file SiStripMonitorTrack.cc.

References SiStripClusterInfo::baryStrip(), RecoTauCleanerPlugins::charge, SiStripClusterInfo::charge(), siStripClusterTools::chargePerCM(), SiStripMonitorTrack::LayerMEs::ClusterChargeCorrOnTrack, SiStripMonitorTrack::RingMEs::ClusterChargeCorrOnTrack, SiStripMonitorTrack::LayerMEs::ClusterChargeOffTrack, SiStripMonitorTrack::RingMEs::ClusterChargeOffTrack, SiStripMonitorTrack::SubDetMEs::ClusterChargeOffTrack, SiStripMonitorTrack::LayerMEs::ClusterChargeOnTrack, SiStripMonitorTrack::RingMEs::ClusterChargeOnTrack, SiStripMonitorTrack::SubDetMEs::ClusterChargeOnTrack, SiStripMonitorTrack::LayerMEs::ClusterChargePerCMfromOriginOffTrack, SiStripMonitorTrack::RingMEs::ClusterChargePerCMfromOriginOffTrack, SiStripMonitorTrack::SubDetMEs::ClusterChargePerCMfromOriginOffTrack, SiStripMonitorTrack::LayerMEs::ClusterChargePerCMfromOriginOnTrack, SiStripMonitorTrack::RingMEs::ClusterChargePerCMfromOriginOnTrack, SiStripMonitorTrack::SubDetMEs::ClusterChargePerCMfromOriginOnTrack, SiStripMonitorTrack::LayerMEs::ClusterChargePerCMfromTrack, SiStripMonitorTrack::RingMEs::ClusterChargePerCMfromTrack, SiStripMonitorTrack::SubDetMEs::ClusterChargePerCMfromTrack, SiStripMonitorTrack::LayerMEs::ClusterNoiseOffTrack, SiStripMonitorTrack::RingMEs::ClusterNoiseOffTrack, SiStripMonitorTrack::LayerMEs::ClusterNoiseOnTrack, SiStripMonitorTrack::RingMEs::ClusterNoiseOnTrack, SiStripMonitorTrack::LayerMEs::ClusterPosOffTrack, SiStripMonitorTrack::LayerMEs::ClusterPosOnTrack, SiStripMonitorTrack::LayerMEs::ClusterStoNCorrOnTrack, SiStripMonitorTrack::RingMEs::ClusterStoNCorrOnTrack, SiStripMonitorTrack::SubDetMEs::ClusterStoNCorrOnTrack, SiStripMonitorTrack::SubDetMEs::ClusterStoNOffTrack, SiStripMonitorTrack::LayerMEs::ClusterWidthOffTrack, SiStripMonitorTrack::RingMEs::ClusterWidthOffTrack, SiStripMonitorTrack::LayerMEs::ClusterWidthOnTrack, SiStripMonitorTrack::RingMEs::ClusterWidthOnTrack, eventNb, fillME(), SiStripMonitorTrack::Det2MEs::iLayer, SiStripMonitorTrack::Det2MEs::iRing, SiStripMonitorTrack::Det2MEs::iSubdet, LogDebug, HLT_25ns14e33_v1_cff::noise, SiStripClusterInfo::noiseRescaledByGain(), OnTrack, position, SiStripClusterInfo::signalOverNoise(), tkgeom_, GeomDet::toLocal(), SiStripClusterInfo::width(), create_public_lumi_plots::width, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by clusterInfos().

1072 {
1073  float StoN = cluster->signalOverNoise();
1074  float noise = cluster->noiseRescaledByGain();
1075  uint16_t charge = cluster->charge();
1076  uint16_t width = cluster->width();
1077  float position = cluster->baryStrip();
1078 
1079  // new dE/dx (chargePerCM)
1080  // https://indico.cern.ch/event/342236/session/5/contribution/10/material/slides/0.pdf
1081  float dQdx_fromTrack = siStripClusterTools::chargePerCM(detid, *cluster, LV);
1082  // from straigth line origin-sensor centre
1083  const StripGeomDetUnit* DetUnit = (const StripGeomDetUnit*) tkgeom_->idToDetUnit(DetId(detid));
1084  LocalPoint locVtx = DetUnit->toLocal(GlobalPoint(0.0, 0.0, 0.0));
1085  LocalVector locDir(locVtx.x(), locVtx.y(), locVtx.z());
1086  float dQdx_fromOrigin = siStripClusterTools::chargePerCM(detid, *cluster, locDir);
1087 
1088  // layerMEs
1089  if (MEs.iLayer != nullptr) {
1090  if(flag==OnTrack){
1091  if(noise > 0.0) fillME(MEs.iLayer->ClusterStoNCorrOnTrack, StoN*cos);
1092  if(noise == 0.0) LogDebug("SiStripMonitorTrack") << "Module " << detid << " in Event " << eventNb << " noise " << cluster->noiseRescaledByGain() << std::endl;
1093  fillME(MEs.iLayer->ClusterChargeCorrOnTrack, charge*cos);
1094  fillME(MEs.iLayer->ClusterChargeOnTrack, charge);
1095  fillME(MEs.iLayer->ClusterNoiseOnTrack, noise);
1096  fillME(MEs.iLayer->ClusterWidthOnTrack, width);
1097  fillME(MEs.iLayer->ClusterPosOnTrack, position);
1098  fillME(MEs.iLayer->ClusterChargePerCMfromTrack, dQdx_fromTrack);
1099  fillME(MEs.iLayer->ClusterChargePerCMfromOriginOnTrack, dQdx_fromOrigin);
1100  } else {
1101  fillME(MEs.iLayer->ClusterChargeOffTrack, charge);
1102  fillME(MEs.iLayer->ClusterNoiseOffTrack, noise);
1103  fillME(MEs.iLayer->ClusterWidthOffTrack, width);
1104  fillME(MEs.iLayer->ClusterPosOffTrack, position);
1105  fillME(MEs.iLayer->ClusterChargePerCMfromOriginOffTrack, dQdx_fromOrigin);
1106  }
1107  }
1108 
1109  // ringMEs
1110  if (MEs.iRing != nullptr) {
1111  if(flag==OnTrack){
1112  if(noise > 0.0) fillME(MEs.iRing->ClusterStoNCorrOnTrack, StoN*cos);
1113  if(noise == 0.0) LogDebug("SiStripMonitorTrack") << "Module " << detid << " in Event " << eventNb << " noise " << cluster->noiseRescaledByGain() << std::endl;
1114  fillME(MEs.iRing->ClusterChargeCorrOnTrack, charge*cos);
1115  fillME(MEs.iRing->ClusterChargeOnTrack, charge);
1116  fillME(MEs.iRing->ClusterNoiseOnTrack, noise);
1117  fillME(MEs.iRing->ClusterWidthOnTrack, width);
1118  fillME(MEs.iRing->ClusterChargePerCMfromTrack, dQdx_fromTrack);
1119  fillME(MEs.iRing->ClusterChargePerCMfromOriginOnTrack, dQdx_fromOrigin);
1120  } else {
1121  fillME(MEs.iRing->ClusterChargeOffTrack, charge);
1122  fillME(MEs.iRing->ClusterNoiseOffTrack, noise);
1123  fillME(MEs.iRing->ClusterWidthOffTrack, width);
1124  fillME(MEs.iRing->ClusterChargePerCMfromOriginOffTrack, dQdx_fromOrigin);
1125  }
1126  }
1127  // subdetMEs
1128  if(MEs.iSubdet != nullptr){
1129  if(flag==OnTrack){
1130  fillME(MEs.iSubdet->ClusterChargeOnTrack,charge);
1131  if(noise > 0.0) fillME(MEs.iSubdet->ClusterStoNCorrOnTrack,StoN*cos);
1132  fillME(MEs.iSubdet->ClusterChargePerCMfromTrack,dQdx_fromTrack);
1133  fillME(MEs.iSubdet->ClusterChargePerCMfromOriginOnTrack,dQdx_fromOrigin);
1134  } else {
1135  fillME(MEs.iSubdet->ClusterChargeOffTrack,charge);
1136  if(noise > 0.0) fillME(MEs.iSubdet->ClusterStoNOffTrack,StoN);
1137  fillME(MEs.iSubdet->ClusterChargePerCMfromOriginOffTrack,dQdx_fromOrigin);
1138  }
1139  }
1140 }
#define LogDebug(id)
void fillME(MonitorElement *ME, float value1)
float noiseRescaledByGain() const
float chargePerCM(DetId detid, Iter a, Iter b)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
float baryStrip() const
T y() const
Definition: PV3DBase.h:63
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:67
edm::ESHandle< TrackerGeometry > tkgeom_
float signalOverNoise() const
edm::EventNumber_t eventNb
uint16_t charge() const
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
uint16_t width() const
Definition: DetId.h:18
static int position[264][3]
Definition: ReadPGInfo.cc:509
T x() const
Definition: PV3DBase.h:62
void SiStripMonitorTrack::fillModMEs ( SiStripClusterInfo cluster,
std::string  name,
float  cos,
const uint32_t  detid,
const LocalVector  LV 
)
private

Definition at line 1023 of file SiStripMonitorTrack.cc.

References SiStripClusterInfo::baryStrip(), RecoTauCleanerPlugins::charge, SiStripClusterInfo::charge(), siStripClusterTools::chargePerCM(), conf_, eventNb, fillME(), edm::ParameterSet::getParameter(), i, LogDebug, SiStripClusterInfo::maxCharge(), SiStripClusterInfo::maxIndex(), ModMEsMap, HLT_25ns14e33_v1_cff::noise, SiStripClusterInfo::noiseRescaledByGain(), position, SiStripClusterInfo::signalOverNoise(), SiStripClusterInfo::stripCharges(), tkgeom_, GeomDet::toLocal(), SiStripClusterInfo::width(), create_public_lumi_plots::width, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by clusterInfos().

1024 {
1025  std::map<std::string, ModMEs>::iterator iModME = ModMEsMap.find(name);
1026  if(iModME!=ModMEsMap.end()){
1027 
1028  float StoN = cluster->signalOverNoise();
1029  uint16_t charge = cluster->charge();
1030  uint16_t width = cluster->width();
1031  float position = cluster->baryStrip();
1032 
1033  // new dE/dx (chargePerCM)
1034  // https://indico.cern.ch/event/342236/session/5/contribution/10/material/slides/0.pdf
1035  float dQdx_fromTrack = siStripClusterTools::chargePerCM(detid, *cluster, LV);
1036  // from straigth line origin-sensor centre
1037  const StripGeomDetUnit* DetUnit = (const StripGeomDetUnit*) tkgeom_->idToDetUnit(DetId(detid));
1038  LocalPoint locVtx = DetUnit->toLocal(GlobalPoint(0.0, 0.0, 0.0));
1039  LocalVector locDir(locVtx.x(), locVtx.y(), locVtx.z());
1040  float dQdx_fromOrigin = siStripClusterTools::chargePerCM(detid, *cluster, locDir);
1041 
1042  float noise = cluster->noiseRescaledByGain();
1043  if(noise > 0.0) fillME(iModME->second.ClusterStoNCorr ,StoN*cos);
1044  if(noise == 0.0) LogDebug("SiStripMonitorTrack") << "Module " << name << " in Event " << eventNb << " noise " << noise << std::endl;
1045  fillME(iModME->second.ClusterCharge,charge);
1046 
1047  fillME(iModME->second.ClusterChargeCorr,charge*cos);
1048 
1049  fillME(iModME->second.ClusterWidth ,width);
1050  fillME(iModME->second.ClusterPos ,position);
1051 
1052  fillME(iModME->second.ClusterChargePerCMfromTrack, dQdx_fromTrack);
1053  fillME(iModME->second.ClusterChargePerCMfromOrigin, dQdx_fromOrigin);
1054 
1055  //fill the PGV histo
1056  float PGVmax = cluster->maxCharge();
1057  int PGVposCounter = cluster->maxIndex();
1058  for (int i= int(conf_.getParameter<edm::ParameterSet>("TProfileClusterPGV").getParameter<double>("xmin"));i<PGVposCounter;++i)
1059  fillME(iModME->second.ClusterPGV, i,0.);
1060  for (auto it=cluster->stripCharges().begin();it<cluster->stripCharges().end();++it) {
1061  fillME(iModME->second.ClusterPGV, PGVposCounter++,(*it)/PGVmax);
1062  }
1063  for (int i= PGVposCounter;i<int(conf_.getParameter<edm::ParameterSet>("TProfileClusterPGV").getParameter<double>("xmax"));++i)
1064  fillME(iModME->second.ClusterPGV, i,0.);
1065  //end fill the PGV histo
1066  }
1067 }
#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 chargePerCM(DetId detid, Iter a, Iter b)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
float baryStrip() const
edm::ParameterSet conf_
T y() const
Definition: PV3DBase.h:63
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:67
uint16_t maxIndex() const
auto stripCharges() const -> decltype(cluster() ->amplitudes())
edm::ESHandle< TrackerGeometry > tkgeom_
float signalOverNoise() const
edm::EventNumber_t eventNb
uint16_t charge() const
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
uint16_t width() const
Definition: DetId.h:18
std::map< std::string, ModMEs > ModMEsMap
static int position[264][3]
Definition: ReadPGInfo.cc:509
T x() const
Definition: PV3DBase.h:62
SiStripMonitorTrack::Det2MEs SiStripMonitorTrack::findMEs ( const TrackerTopology tTopo,
const uint32_t  detid 
)
private

Definition at line 934 of file SiStripMonitorTrack.cc.

References folderOrganizer_, SiStripFolderOrganizer::getSubDetFolderAndTag(), SiStripHistoId::getSubdetid(), SiStripMonitorTrack::Det2MEs::iLayer, SiStripMonitorTrack::Det2MEs::iRing, SiStripMonitorTrack::Det2MEs::iSubdet, LayerMEsMap, alignCSCRings::ring_id, RingMEsMap, AlCaHLTBitMon_QueryRunRegistry::string, and SubDetMEsMap.

Referenced by AllClusters(), and RecHitInfo().

934  {
935  SiStripHistoId hidmanager1;
936 
937  std::string layer_id = hidmanager1.getSubdetid(detid, tTopo, false);
938  std::string ring_id = hidmanager1.getSubdetid(detid, tTopo, true);
939  std::string sdet_tag = folderOrganizer_.getSubDetFolderAndTag(detid, tTopo).second;
940 
941  Det2MEs me;
942  me.iLayer = nullptr;
943  me.iRing = nullptr;
944  me.iSubdet = nullptr;
945 
946  std::map<std::string, LayerMEs>::iterator iLayer = LayerMEsMap.find(layer_id);
947  if (iLayer != LayerMEsMap.end()) {
948  me.iLayer = &(iLayer->second);
949  }
950 
951  std::map<std::string, RingMEs>::iterator iRing = RingMEsMap.find(ring_id);
952  if (iRing != RingMEsMap.end()) {
953  me.iRing = &(iRing->second);
954  }
955 
956  std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.find(sdet_tag);
957  if (iSubdet != SubDetMEsMap.end()) {
958  me.iSubdet = &(iSubdet->second);
959  }
960 
961  return me;
962 }
std::pair< const std::string, const char * > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
std::map< std::string, RingMEs > RingMEsMap
std::map< std::string, SubDetMEs > SubDetMEsMap
SiStripFolderOrganizer folderOrganizer_
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
std::map< std::string, LayerMEs > LayerMEsMap
MonitorElement * SiStripMonitorTrack::handleBookMEs ( DQMStore::IBooker ibooker,
std::string &  viewParameter,
std::string &  id,
std::string &  histoParameters,
std::string &  histoName 
)
private

Definition at line 255 of file SiStripMonitorTrack.cc.

References bookME1D(), conf_, spr::find(), edm::ParameterSet::getParameter(), and NULL.

Referenced by bookLayerMEs(), and bookRingMEs().

255  {
256 
257  MonitorElement* me = NULL;
258  bool view = false;
259  view = (conf_.getParameter<edm::ParameterSet>(histoParameters.c_str())).getParameter<bool>(viewParameter.c_str());
260  if ( id.find("TEC") == std::string::npos && id.find("TID") == std::string::npos ) {
261  me = bookME1D(ibooker , histoParameters.c_str(), histoName.c_str());
262  } else {
263  if (view) {
264  // histoName = histoName + "__" + thickness;
265  me = bookME1D(ibooker , histoParameters.c_str(), histoName.c_str());
266  }
267  }
268  return me;
269 }
T getParameter(std::string const &) const
edm::ParameterSet conf_
MonitorElement * bookME1D(DQMStore::IBooker &, const char *, const char *)
#define NULL
Definition: scimark2.h:8
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
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 666 of file SiStripMonitorTrack.cc.

References TrackingRecHit::geographicalId(), LogDebug, LogTrace, visualization-live-secondInstance_cfg::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().

672  {
673  LocalVector statedirection;
674  if(matchedhit){ // type=Matched;
675  LogTrace("SiStripMonitorTrack")<<"\nMatched recHit found"<< std::endl;
676 
677  GluedGeomDet * gdet=(GluedGeomDet *)tkgeom_->idToDet(matchedhit->geographicalId());
678 
679  GlobalVector gtrkdirup=gdet->toGlobal(localMomentum);
680 
681  //mono side
682  const GeomDetUnit * monodet=gdet->monoDet();
683  statedirection=monodet->toLocal(gtrkdirup);
684  SiStripRecHit2D m = matchedhit->monoHit();
685  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&m,statedirection,es);
686 
687  //stereo side
688  const GeomDetUnit * stereodet=gdet->stereoDet();
689  statedirection=stereodet->toLocal(gtrkdirup);
690  SiStripRecHit2D s = matchedhit->stereoHit();
691  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&s,statedirection,es);
692  }
693  else if(projhit){ // type=Projected;
694  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found"<< std::endl;
695 
696  GluedGeomDet * gdet=(GluedGeomDet *)tkgeom_->idToDet(projhit->geographicalId());
697 
698  GlobalVector gtrkdirup=gdet->toGlobal(localMomentum);
699  const SiStripRecHit2D originalhit=projhit->originalHit();
700 
701  const GeomDetUnit * det;
702  if(!StripSubdetector(originalhit.geographicalId().rawId()).stereo()){
703  //mono side
704  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found MONO"<< std::endl;
705  det=gdet->monoDet();
706  statedirection=det->toLocal(gtrkdirup);
707  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es);
708  }
709  else{
710  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found STEREO"<< std::endl;
711  //stereo side
712  det=gdet->stereoDet();
713  statedirection=det->toLocal(gtrkdirup);
714  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es);
715  }
716  } else if (hit2D){ // type=2D
717  statedirection=localMomentum;
718  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(hit2D,statedirection,es);
719  } else if (hit1D) { // type=1D
720  statedirection=localMomentum;
721  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit1D>(hit1D,statedirection,es);
722  } else {
723  LogDebug ("SiStripMonitorTrack")
724  << " LocalMomentum: "<<statedirection
725  << "\nLocal x-z plane angle: "<<atan2(statedirection.x(),statedirection.z());
726  }
727 
728 }
#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 853 of file SiStripMonitorTrack.cc.

References clusterInfos(), cond::rpcobgas::detid, findMEs(), 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().

853  {
854 
855  if(!tkrecHit->isValid()){
856  LogTrace("SiStripMonitorTrack") <<"\t\t Invalid Hit " << std::endl;
857  return;
858  }
859 
860  const uint32_t& detid = tkrecHit->geographicalId().rawId();
861 
862  LogTrace("SiStripMonitorTrack")
863  <<"\n\t\tRecHit on det "<<tkrecHit->geographicalId().rawId()
864  <<"\n\t\tRecHit in LP "<<tkrecHit->localPosition()
865  <<"\n\t\tRecHit in GP "<<tkgeom_->idToDet(tkrecHit->geographicalId())->surface().toGlobal(tkrecHit->localPosition())
866  <<"\n\t\tRecHit trackLocal vector "<<LV.x() << " " << LV.y() << " " << LV.z() <<std::endl;
867 
868 
869  //Retrieve tracker topology from geometry
870  edm::ESHandle<TrackerTopology> tTopoHandle;
871  es.get<TrackerTopologyRcd>().get(tTopoHandle);
872  const TrackerTopology* const tTopo = tTopoHandle.product();
873 
874  //Get SiStripCluster from SiStripRecHit
875  if ( tkrecHit != NULL ){
876  const SiStripCluster* SiStripCluster_ = &*(tkrecHit->cluster());
877  SiStripClusterInfo SiStripClusterInfo_(*SiStripCluster_,es,detid);
878 
879  const Det2MEs MEs = findMEs(tTopo, detid);
880  if (clusterInfos(&SiStripClusterInfo_,detid, OnTrack, LV, MEs))
881  {
882  vPSiStripCluster.insert(SiStripCluster_);
883  }
884  }
885  else
886  {
887  edm::LogError("SiStripMonitorTrack") << "NULL hit" << std::endl;
888  }
889  }
Det2MEs findMEs(const TrackerTopology *tTopo, const uint32_t detid)
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, enum ClusterFlags flags, LocalVector LV, const Det2MEs &MEs)
T x() const
Definition: PV3DBase.h:62
void SiStripMonitorTrack::trackStudy ( const edm::Event ev,
const edm::EventSetup es 
)
private

Definition at line 730 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().

730  {
731 
732 using namespace std;
733 using namespace edm;
734 using namespace reco;
735 
736  // trajectory input
737  edm::Handle<TrajTrackAssociationCollection> TItkAssociatorCollection;
738  ev.getByToken(trackTrajToken_, TItkAssociatorCollection);
739  if( TItkAssociatorCollection.isValid()){
740  trackStudyFromTrajectory(TItkAssociatorCollection,es);
741  } else {
742  edm::LogError("SiStripMonitorTrack")<<"Association not found ... try w/ track collection"<<std::endl;
743 
744  // edm::Handle<std::vector<Trajectory> > trajectories;
745  // ev.getByToken(trajectoryToken_, trajectories);
746 
747  // track input
748  edm::Handle<reco::TrackCollection > trackCollectionHandle;
749  ev.getByToken(trackToken_, trackCollectionHandle);//takes the track collection
750  if (!trackCollectionHandle.isValid()){
751  edm::LogError("SiStripMonitorTrack")<<"also Track Collection is not valid !! " << TrackLabel_<<std::endl;
752  return;
753  } else {
754  trackStudyFromTrack(trackCollectionHandle,es);
755  }
756  }
757 
758 }
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:457
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< TrajTrackAssociationCollection > trackTrajToken_
void SiStripMonitorTrack::trackStudyFromTrack ( edm::Handle< reco::TrackCollection trackCollectionHandle,
const edm::EventSetup es 
)
private

Definition at line 760 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, HLT_25ns14e33_v3_cff::trackCollection, DetId::Tracker, and reco::HitPattern::validHitFilter().

Referenced by trackStudy().

760  {
761 
762  // edm::ESHandle<TransientTrackBuilder> builder;
763  // es.get<TransientTrackRecord>().get("TransientTrackBuilder",builder);
764  // const TransientTrackBuilder* transientTrackBuilder = builder.product();
765 
766  reco::TrackCollection trackCollection = *trackCollectionHandle;
767  for (reco::TrackCollection::const_iterator track = trackCollection.begin(), etrack = trackCollection.end();
768  track!=etrack; ++track) {
769 
770  // const reco::TransientTrack transientTrack = transientTrackBuilder->build(track);
771 
772 
773  for (trackingRecHit_iterator hit = track->recHitsBegin(), ehit = track->recHitsEnd();
774  hit!=ehit; ++hit) {
775  if (!(*hit)->isValid()) continue;
776  DetId detID = (*hit)->geographicalId();
777  if (detID.det() != DetId::Tracker) continue;
778  const TrackingRecHit* theHit = (*hit);
779  const ProjectedSiStripRecHit2D* projhit = dynamic_cast<const ProjectedSiStripRecHit2D*>( (theHit) );
780  const SiStripMatchedRecHit2D* matchedhit = dynamic_cast<const SiStripMatchedRecHit2D*> ( (theHit) );
781  const SiStripRecHit2D* hit2D = dynamic_cast<const SiStripRecHit2D*> ( (theHit) );
782  const SiStripRecHit1D* hit1D = dynamic_cast<const SiStripRecHit1D*> ( (theHit) );
783 
784  // GlobalPoint globalPoint = hit->globalPosition();
785  // reco::TrajectoryStateOnSurface stateOnSurface = transientTrack->stateOnSurface(globalPoint);
786 
787  LocalVector localMomentum;
788  hitStudy(es,projhit,matchedhit,hit2D,hit1D,localMomentum);
789  }
790 
791 
792 
793  // hit pattern of the track
794  const reco::HitPattern & hitsPattern = track->hitPattern();
795  // loop over the hits of the track
796  // for (int i=0; i<hitsPattern.numberOfHits(); i++) {
797  for (int i=0; i<hitsPattern.numberOfHits(reco::HitPattern::TRACK_HITS); i++) {
798  uint32_t hit = hitsPattern.getHitPattern(reco::HitPattern::TRACK_HITS,i);
799 
800  // if the hit is valid and in pixel barrel, print out the layer
801  if (hitsPattern.validHitFilter(hit) && hitsPattern.pixelBarrelHitFilter(hit))
802 
803  if (!hitsPattern.validHitFilter(hit)) continue;
804 // if (hitsPattern.pixelHitFilter(hit)) std::cout << "pixel" << std::endl; // pixel
805 // if (hitsPattern.pixelBarrelHitFilter(hit)) std::cout << "pixel barrel" << std::endl; // pixel barrel
806 // if (hitsPattern.pixelEndcapHitFilter(hit)) std::cout << "pixel endcap" << std::endl; // pixel endcap
807 // if (hitsPattern.stripHitFilter(hit)) std::cout << "strip" << std::endl; // strip
808 // if (hitsPattern.stripTIBHitFilter(hit)) std::cout << "TIB" << std::endl; // strip TIB
809 // if (hitsPattern.stripTIDHitFilter(hit)) std::cout << "TID" << std::endl; // strip TID
810 // if (hitsPattern.stripTOBHitFilter(hit)) std::cout << "TOB" << std::endl; // strip TOB
811 // if (hitsPattern.stripTECHitFilter(hit)) std::cout << "TEC" << std::endl; // strip TEC
812 // if (hitsPattern.muonDTHitFilter(hit)) std::cout << "DT" << std::endl; // muon DT
813 // if (hitsPattern.muonCSCHitFilter(hit)) std::cout << "CSC" << std::endl; // muon CSC
814 // if (hitsPattern.muonRPCHitFilter(hit)) std::cout << "RPC" << std::endl; // muon RPC
815 //
816 // // expert level: printout the hit in 10-bit binary format
817 // std::cout << "hit in 10-bit binary format = ";
818 // for (int j=9; j>=0; j--) {
819 // int bit = (hit >> j) & 0x1;
820 // std::cout << bit;
821 // }
822 // std::cout << std::endl;
823  }
824  }
825 }
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 827 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().

827  {
828  //Perform track study
829  int i=0;
830  for(TrajTrackAssociationCollection::const_iterator it = TItkAssociatorCollection->begin();it != TItkAssociatorCollection->end(); ++it){
831  const edm::Ref<std::vector<Trajectory> > traj_iterator = it->key;
832 
833  // Trajectory Map, extract Trajectory for this track
834  reco::TrackRef trackref = it->val;
835  LogDebug("SiStripMonitorTrack")
836  << "Track number "<< i+1 << std::endl;
837  // << "\n\tmomentum: " << trackref->momentum()
838  // << "\n\tPT: " << trackref->pt()
839  // << "\n\tvertex: " << trackref->vertex()
840  // << "\n\timpact parameter: " << trackref->d0()
841  // << "\n\tcharge: " << trackref->charge()
842  // << "\n\tnormalizedChi2: " << trackref->normalizedChi2()
843  // <<"\n\tFrom EXTRA : "
844  // <<"\n\t\touter PT "<< trackref->outerPt()<<std::endl;
845  i++;
846 
847  // trajectoryStudy(traj_iterator,trackref,es);
848  trajectoryStudy(traj_iterator,es);
849 
850  }
851 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
key_type key() const
Accessor for product key.
Definition: Ref.h:264
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 587 of file SiStripMonitorTrack.cc.

References TrackingRecHit::geographicalId(), TrajectoryStateOnSurface::localMomentum(), LogDebug, LogTrace, visualization-live-secondInstance_cfg::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().

587  {
588 
589 
590  const std::vector<TrajectoryMeasurement> & measurements = traj->measurements();
591  std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator;
592  for(std::vector<TrajectoryMeasurement>::const_iterator traj_mes_iterator= measurements.begin(), traj_mes_end=measurements.end();
593  traj_mes_iterator!=traj_mes_end;traj_mes_iterator++){//loop on measurements
594  //trajectory local direction and position on detector
595  LocalVector statedirection;
596 
597  TrajectoryStateOnSurface updatedtsos=traj_mes_iterator->updatedState();
598  ConstRecHitPointer ttrh=traj_mes_iterator->recHit();
599 
600  if (!ttrh->isValid()) continue;
601 
602  const ProjectedSiStripRecHit2D* projhit = dynamic_cast<const ProjectedSiStripRecHit2D*>( ttrh->hit() );
603  const SiStripMatchedRecHit2D* matchedhit = dynamic_cast<const SiStripMatchedRecHit2D*>( ttrh->hit() );
604  const SiStripRecHit2D* hit2D = dynamic_cast<const SiStripRecHit2D*>( ttrh->hit() );
605  const SiStripRecHit1D* hit1D = dynamic_cast<const SiStripRecHit1D*>( ttrh->hit() );
606 
607  // RecHitType type=Single;
608 
609  if(matchedhit){
610  LogTrace("SiStripMonitorTrack")<<"\nMatched recHit found"<< std::endl;
611  // type=Matched;
612 
613  GluedGeomDet * gdet=(GluedGeomDet *)tkgeom_->idToDet(matchedhit->geographicalId());
614  GlobalVector gtrkdirup=gdet->toGlobal(updatedtsos.localMomentum());
615  //mono side
616  const GeomDetUnit * monodet=gdet->monoDet();
617  statedirection=monodet->toLocal(gtrkdirup);
618  SiStripRecHit2D m = matchedhit->monoHit();
619  // if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&m,statedirection,trackref,es);
620  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&m,statedirection,es);
621  //stereo side
622  const GeomDetUnit * stereodet=gdet->stereoDet();
623  statedirection=stereodet->toLocal(gtrkdirup);
624  SiStripRecHit2D s = matchedhit->stereoHit();
625  // if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&s,statedirection,trackref,es);
626  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&s,statedirection,es);
627  }
628  else if(projhit){
629  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found"<< std::endl;
630  // type=Projected;
631  GluedGeomDet * gdet=(GluedGeomDet *)tkgeom_->idToDet(projhit->geographicalId());
632 
633  GlobalVector gtrkdirup=gdet->toGlobal(updatedtsos.localMomentum());
634  const SiStripRecHit2D originalhit=projhit->originalHit();
635  const GeomDetUnit * det;
636  if(!StripSubdetector(originalhit.geographicalId().rawId()).stereo()){
637  //mono side
638  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found MONO"<< std::endl;
639  det=gdet->monoDet();
640  statedirection=det->toLocal(gtrkdirup);
641  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es);
642  }
643  else{
644  LogTrace("SiStripMonitorTrack")<<"\nProjected recHit found STEREO"<< std::endl;
645  //stereo side
646  det=gdet->stereoDet();
647  statedirection=det->toLocal(gtrkdirup);
648  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(&(originalhit),statedirection,es);
649  }
650  }else if (hit2D){
651  statedirection=updatedtsos.localMomentum();
652  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit2D>(hit2D,statedirection,es);
653  } else if (hit1D) {
654  statedirection=updatedtsos.localMomentum();
655  if(statedirection.mag() != 0) RecHitInfo<SiStripRecHit1D>(hit1D,statedirection,es);
656  } else {
657  LogDebug ("SiStripMonitorTrack")
658  << " LocalMomentum: "<<statedirection
659  << "\nLocal x-z plane angle: "<<atan2(statedirection.x(),statedirection.z());
660  }
661 
662  }
663 
664 }
#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 224 of file SiStripMonitorTrack.h.

Referenced by clusterInfos(), and SiStripMonitorTrack().

edm::InputTag SiStripMonitorTrack::Cluster_src_
private

Definition at line 201 of file SiStripMonitorTrack.h.

Referenced by SiStripMonitorTrack().

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

Definition at line 203 of file SiStripMonitorTrack.h.

Referenced by AllClusters(), and SiStripMonitorTrack().

edm::ParameterSet SiStripMonitorTrack::conf_
private
SiStripDCSStatus* SiStripMonitorTrack::dcsStatus_
private

Definition at line 230 of file SiStripMonitorTrack.h.

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

edm::EventNumber_t SiStripMonitorTrack::eventNb
private

Definition at line 221 of file SiStripMonitorTrack.h.

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

int SiStripMonitorTrack::firstEvent
private

Definition at line 222 of file SiStripMonitorTrack.h.

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

SiStripFolderOrganizer SiStripMonitorTrack::folderOrganizer_
private

Definition at line 232 of file SiStripMonitorTrack.h.

Referenced by findMEs().

GenericTriggerEventFlag* SiStripMonitorTrack::genTriggerEventFlag_
private

Definition at line 231 of file SiStripMonitorTrack.h.

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

std::string SiStripMonitorTrack::histname
private

Definition at line 122 of file SiStripMonitorTrack.h.

bool SiStripMonitorTrack::HistoFlag_On_
private

Definition at line 211 of file SiStripMonitorTrack.h.

float SiStripMonitorTrack::iLumisection
private

Definition at line 124 of file SiStripMonitorTrack.h.

Referenced by analyze().

float SiStripMonitorTrack::iOrbitSec
private

Definition at line 124 of file SiStripMonitorTrack.h.

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

Definition at line 187 of file SiStripMonitorTrack.h.

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

LocalVector SiStripMonitorTrack::LV
private

Definition at line 123 of file SiStripMonitorTrack.h.

bool SiStripMonitorTrack::Mod_On_
private

Definition at line 208 of file SiStripMonitorTrack.h.

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

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

Definition at line 186 of file SiStripMonitorTrack.h.

Referenced by bookModMEs(), and fillModMEs().

bool SiStripMonitorTrack::OffHisto_On_
private

Definition at line 210 of file SiStripMonitorTrack.h.

edm::ParameterSet SiStripMonitorTrack::Parameters
private

Definition at line 200 of file SiStripMonitorTrack.h.

bool SiStripMonitorTrack::ring_flag
private

Definition at line 212 of file SiStripMonitorTrack.h.

std::map<std::string, RingMEs> SiStripMonitorTrack::RingMEsMap
private

Definition at line 188 of file SiStripMonitorTrack.h.

Referenced by book(), bookRingMEs(), and findMEs().

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

Definition at line 198 of file SiStripMonitorTrack.h.

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

double SiStripMonitorTrack::sToNLowerLimit_
private

Definition at line 225 of file SiStripMonitorTrack.h.

Referenced by clusterInfos(), and SiStripMonitorTrack().

double SiStripMonitorTrack::sToNUpperLimit_
private

Definition at line 226 of file SiStripMonitorTrack.h.

Referenced by clusterInfos(), and SiStripMonitorTrack().

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

Definition at line 189 of file SiStripMonitorTrack.h.

Referenced by analyze(), book(), bookSubDetMEs(), and findMEs().

edm::ESHandle<TrackerGeometry> SiStripMonitorTrack::tkgeom_
private
TkHistoMap * SiStripMonitorTrack::tkhisto_NumOffTrack
private

Definition at line 129 of file SiStripMonitorTrack.h.

Referenced by book(), and clusterInfos().

TkHistoMap * SiStripMonitorTrack::tkhisto_NumOnTrack
private

Definition at line 129 of file SiStripMonitorTrack.h.

Referenced by book(), and clusterInfos().

TkHistoMap* SiStripMonitorTrack::tkhisto_StoNCorrOnTrack
private

Definition at line 129 of file SiStripMonitorTrack.h.

Referenced by book(), and clusterInfos().

bool SiStripMonitorTrack::TkHistoMap_On_
private

Definition at line 213 of file SiStripMonitorTrack.h.

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

std::string SiStripMonitorTrack::topFolderName_
private

Definition at line 126 of file SiStripMonitorTrack.h.

Referenced by book(), and SiStripMonitorTrack().

bool SiStripMonitorTrack::trackAssociatorCollection_in_EventTree
private

Definition at line 220 of file SiStripMonitorTrack.h.

std::string SiStripMonitorTrack::TrackLabel_
private

Definition at line 216 of file SiStripMonitorTrack.h.

Referenced by SiStripMonitorTrack(), and trackStudy().

std::string SiStripMonitorTrack::TrackProducer_
private

Definition at line 215 of file SiStripMonitorTrack.h.

Referenced by SiStripMonitorTrack().

bool SiStripMonitorTrack::tracksCollection_in_EventTree
private

Definition at line 219 of file SiStripMonitorTrack.h.

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

Definition at line 204 of file SiStripMonitorTrack.h.

Referenced by SiStripMonitorTrack(), and trackStudy().

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

Definition at line 206 of file SiStripMonitorTrack.h.

Referenced by SiStripMonitorTrack(), and trackStudy().

bool SiStripMonitorTrack::Trend_On_
private

Definition at line 209 of file SiStripMonitorTrack.h.

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

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

Definition at line 218 of file SiStripMonitorTrack.h.

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

double SiStripMonitorTrack::widthLowerLimit_
private

Definition at line 227 of file SiStripMonitorTrack.h.

Referenced by clusterInfos(), and SiStripMonitorTrack().

double SiStripMonitorTrack::widthUpperLimit_
private

Definition at line 228 of file SiStripMonitorTrack.h.

Referenced by clusterInfos(), and SiStripMonitorTrack().