CMS 3D CMS Logo

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

#include <DQM/SiStripMonitorMuonHLT/src/SiStripMonitorMuonHLT.cc>

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

Classes

struct  LayerMEs
 

Public Member Functions

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

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
void analyzeOnTrackClusters (const reco::Track *l3tk, const TrackerGeometry &theTracker, bool isL3MuTrack=true)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void createMEs (DQMStore::IBooker &, const edm::EventSetup &es)
 
virtual void endJob ()
 
void GeometryFromTrackGeom (const std::vector< DetId > &Dets, const TrackerGeometry &theTracker, const edm::EventSetup &iSetup, std::map< std::string, std::vector< float > > &m_PhiStripMod_Eta, std::map< std::string, std::vector< float > > &m_PhiStripMod_Nb)
 
float GetEtaWeight (std::string label, GlobalPoint gp)
 
float GetPhiWeight (std::string label, GlobalPoint gp)
 
void Normalizer (const std::vector< DetId > &Dets, const TrackerGeometry &theTracker)
 
void PrintNormalization (const std::vector< std::string > &v_LabelHisto)
 

Private Attributes

uint32_t cached_detid
 
int16_t cached_layer
 
TkLayerMap::XYbin cached_XYbin
 
edm::InputTag clusterCollectionTag_
 
edm::EDGetTokenT
< edm::LazyGetter
< SiStripCluster > > 
clusterCollectionToken_
 
int counterEvt_
 
int HistoNumber
 
edm::InputTag l3collectionTag_
 
edm::EDGetTokenT
< reco::RecoChargedCandidateCollection
l3collectionToken_
 
std::map< std::string, LayerMEsLayerMEMap
 
std::map< std::string,
std::vector< float > > 
m_BinEta
 
std::map< std::string,
std::vector< float > > 
m_BinPhi
 
std::map< std::string,
std::vector< float > > 
m_ModNormEta
 
std::map< std::string,
std::vector< float > > 
m_ModNormPhi
 
std::string monitorName_
 
bool normalize_
 
int nTrig_
 counter More...
 
std::string outputFile_
 
edm::ParameterSet parameters_
 
int prescaleEvt_
 mutriggered events More...
 
bool printNormalize_
 
bool runOnClusters_
 
bool runOnMuonCandidates_
 
bool runOnTracks_
 
TkDetMaptkdetmap_
 
TkHistoMaptkmapAllClusters
 
TkHistoMaptkmapL3MuTrackClusters
 
TkHistoMaptkmapOnTrackClusters
 
edm::InputTag TrackCollectionTag_
 
edm::EDGetTokenT
< reco::TrackCollection
TrackCollectionToken_
 
bool verbose_
 every n events More...
 

Additional Inherited Members

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

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 79 of file SiStripMonitorMuonHLT.h.

Constructor & Destructor Documentation

SiStripMonitorMuonHLT::SiStripMonitorMuonHLT ( const edm::ParameterSet ps)
explicit

Definition at line 24 of file SiStripMonitorMuonHLT.cc.

References cached_detid, cached_layer, clusterCollectionTag_, clusterCollectionToken_, edm::ParameterSet::getUntrackedParameter(), HistoNumber, edm::Service< T >::isAvailable(), l3collectionTag_, l3collectionToken_, monitorName_, normalize_, cppFunctionSkipper::operator, outputFile_, parameters_, prescaleEvt_, printNormalize_, runOnClusters_, runOnMuonCandidates_, runOnTracks_, AlCaHLTBitMon_QueryRunRegistry::string, tkdetmap_, TrackCollectionTag_, TrackCollectionToken_, and verbose_.

25 {
26  cached_detid=0;
27  cached_layer=0;
28  //now do what ever initialization is needed
29  parameters_ = iConfig;
30  verbose_ = parameters_.getUntrackedParameter<bool>("verbose",false);
31  normalize_ = parameters_.getUntrackedParameter<bool>("normalize",true);
32  printNormalize_ = parameters_.getUntrackedParameter<bool>("printNormalize",false);
33  monitorName_ = parameters_.getUntrackedParameter<std::string>("monitorName","HLT/HLTMonMuon");
34  prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt",-1);
35 
36  //booleans
37  runOnClusters_ = parameters_.getUntrackedParameter<bool>("runOnClusters",true);
38  runOnMuonCandidates_ = parameters_.getUntrackedParameter<bool>("runOnMuonCandidates",true);
39  runOnTracks_ = parameters_.getUntrackedParameter<bool>("runOnTracks",true);
40 
41  //tags
42  clusterCollectionTag_ = parameters_.getUntrackedParameter < edm::InputTag > ("clusterCollectionTag",edm::InputTag("hltSiStripRawToClustersFacility"));
43  l3collectionTag_ = parameters_.getUntrackedParameter < edm::InputTag > ("l3MuonTag",edm::InputTag("hltL3MuonCandidates"));
44  TrackCollectionTag_ = parameters_.getUntrackedParameter < edm::InputTag > ("trackCollectionTag",edm::InputTag("hltL3TkTracksFromL2"));
46  clusterCollectionToken_ = consumes<edm::LazyGetter < SiStripCluster > >(clusterCollectionTag_);
47  l3collectionToken_ = consumes<reco::RecoChargedCandidateCollection>(l3collectionTag_);
48  TrackCollectionToken_ = consumes<reco::TrackCollection>(TrackCollectionTag_);
49 
50 
51  HistoNumber = 35;
52 
53  //services
54  tkdetmap_ = 0;
56  {
57  edm::LogError ("TkHistoMap") <<
58  "\n------------------------------------------"
59  "\nUnAvailable Service TkHistoMap: please insert in the configuration file an instance like" "\n\tprocess.TkDetMap = cms.Service(\"TkDetMap\")" "\n------------------------------------------";
60  }
63 
65  if (outputFile_.size () != 0) edm::LogWarning ("HLTMuonDQMSource") << "Muon HLT Monitoring histograms will be saved to " << outputFile_ << std::endl;
66  else outputFile_ = "MuonHLTDQM.root";
67 
68  bool disable = parameters_.getUntrackedParameter < bool > ("disableROOToutput",false);
69  if (disable) outputFile_ = "";
70 
71 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::TrackCollection > TrackCollectionToken_
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > l3collectionToken_
bool verbose_
every n events
bool isAvailable() const
Definition: Service.h:46
int prescaleEvt_
mutriggered events
edm::EDGetTokenT< edm::LazyGetter< SiStripCluster > > clusterCollectionToken_
edm::ParameterSet parameters_
SiStripMonitorMuonHLT::~SiStripMonitorMuonHLT ( )

Definition at line 74 of file SiStripMonitorMuonHLT.cc.

75 {
76 
77  // do anything here that needs to be done at desctruction time
78  // (e.g. close files, deallocate resources etc.)
79 
80 }

Member Function Documentation

void SiStripMonitorMuonHLT::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 111 of file SiStripMonitorMuonHLT.cc.

References TkHistoMap::add(), analyzeOnTrackClusters(), cached_detid, cached_layer, cached_XYbin, clusterCollectionToken_, counterEvt_, PV3DBase< T, PVType, FrameType >::eta(), edm::HandleBase::failedToGet(), TkDetMap::FindLayer(), edm::EventSetup::get(), edm::Event::getByToken(), GetEtaWeight(), TkDetMap::getLayerName(), GetPhiWeight(), TrackerGeometry::idToDet(), edm::HandleBase::isValid(), l3collectionToken_, diffTwoXMLs::label, LayerMEMap, LogDebug, normalize_, PV3DBase< T, PVType, FrameType >::phi(), prescaleEvt_, edm::ESHandle< class >::product(), runOnClusters_, runOnMuonCandidates_, runOnTracks_, StripGeomDetUnit::specificTopology(), contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, GeomDet::surface(), tkdetmap_, tkmapAllClusters, Surface::toGlobal(), and TrackCollectionToken_.

112 {
113  counterEvt_++;
114  if (prescaleEvt_ > 0 && counterEvt_ % prescaleEvt_ != 0)
115  return;
116  LogDebug ("SiStripMonitorHLTMuon") << " processing conterEvt_: " << counterEvt_ << std::endl;
117 
118 
120  iSetup.get < TrackerDigiGeometryRecord > ().get (TG);
121  const TrackerGeometry *theTrackerGeometry = TG.product ();
122  const TrackerGeometry & theTracker (*theTrackerGeometry);
123 
124 
126 
127  //Access to L3MuonCand
129  bool accessToL3Muons = true;
130  iEvent.getByToken (l3collectionToken_, l3mucands);
131  reco::RecoChargedCandidateCollection::const_iterator cand;
132 
133  //Access to clusters
135  bool accessToClusters = true;
136  iEvent.getByToken (clusterCollectionToken_, clusters);
138 
139  //Access to Tracks
140  edm::Handle<reco::TrackCollection > trackCollection;
141  bool accessToTracks = true;
142  iEvent.getByToken (TrackCollectionToken_, trackCollection);
143  reco::TrackCollection::const_iterator track;
145 
146 
147  if (runOnClusters_ && accessToClusters && !clusters.failedToGet () && clusters.isValid())
148  {
149  for (clust = clusters->begin_record (); clust != clusters->end_record (); ++clust)
150  {
151 
152  uint detID = 0; // zero since long time clust->geographicalId ();
153  std::stringstream ss;
154  int layer = tkdetmap_->FindLayer (detID , cached_detid , cached_layer , cached_XYbin);
156  const StripGeomDetUnit *theGeomDet = dynamic_cast < const StripGeomDetUnit * >(theTracker.idToDet (detID));
157  const StripTopology *topol = dynamic_cast < const StripTopology * >(&(theGeomDet->specificTopology ()));
158  // get the cluster position in local coordinates (cm)
159  LocalPoint clustlp = topol->localPosition (clust->barycenter ());
160  GlobalPoint clustgp = theGeomDet->surface ().toGlobal (clustlp);
161 
162  //NORMALIZE HISTO IF ASKED
163  float etaWeight = 1.;
164  float phiWeight = 1.;
165  if (normalize_){
166  etaWeight = GetEtaWeight(label, clustgp);
167  phiWeight = GetPhiWeight(label,clustgp);
168  }
169  LayerMEMap[label.c_str ()].EtaDistribAllClustersMap->Fill (clustgp.eta (),etaWeight);
170  LayerMEMap[label.c_str ()].PhiDistribAllClustersMap->Fill (clustgp.phi (),phiWeight);
171  LayerMEMap[label.c_str ()].EtaPhiAllClustersMap->Fill (clustgp.eta (), clustgp.phi ());
172  tkmapAllClusters->add(detID,1.);
173  }
174  }
175 
176  if (runOnMuonCandidates_ && accessToL3Muons && !l3mucands.failedToGet () && l3mucands.isValid())
177  {
178  for (cand = l3mucands->begin (); cand != l3mucands->end (); ++cand)
179  {
180  //TrackRef l3tk = cand->get < TrackRef > ();
181  const reco::Track* l3tk = cand->get < reco::TrackRef > ().get();
182  analyzeOnTrackClusters(l3tk, theTracker, true);
183  } //loop over l3mucands
184  } //if l3seed
185 
186  if (runOnTracks_ && accessToTracks && !trackCollection.failedToGet() && trackCollection.isValid()){
187  for (track = trackCollection->begin (); track != trackCollection->end() ; ++ track)
188  {
189  const reco::Track* tk = &(*track);
190  analyzeOnTrackClusters(tk, theTracker, false);
191  }
192  }
193 
194 }
#define LogDebug(id)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
edm::EDGetTokenT< reco::TrackCollection > TrackCollectionToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
float GetPhiWeight(std::string label, GlobalPoint gp)
TkLayerMap::XYbin cached_XYbin
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > l3collectionToken_
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
float GetEtaWeight(std::string label, GlobalPoint gp)
record_type::const_iterator record_iterator
Definition: LazyGetter.h:317
std::string getLayerName(int &in) const
Definition: TkDetMap.cc:702
void analyzeOnTrackClusters(const reco::Track *l3tk, const TrackerGeometry &theTracker, bool isL3MuTrack=true)
bool isValid() const
Definition: HandleBase.h:76
int prescaleEvt_
mutriggered events
std::map< std::string, LayerMEs > LayerMEMap
bool failedToGet() const
Definition: HandleBase.h:80
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
T eta() const
Definition: PV3DBase.h:76
edm::EDGetTokenT< edm::LazyGetter< SiStripCluster > > clusterCollectionToken_
int16_t FindLayer(uint32_t &detid, uint32_t &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:664
void add(uint32_t &detid, float value)
Definition: TkHistoMap.cc:213
void SiStripMonitorMuonHLT::analyzeOnTrackClusters ( const reco::Track l3tk,
const TrackerGeometry theTracker,
bool  isL3MuTrack = true 
)
private

Definition at line 196 of file SiStripMonitorMuonHLT.cc.

References TkHistoMap::add(), cached_detid, cached_layer, cached_XYbin, SiStripRecHit1D::cluster(), PV3DBase< T, PVType, FrameType >::eta(), TkDetMap::FindLayer(), edm::Ref< C, T, F >::get(), GetEtaWeight(), TkDetMap::getLayerName(), GetPhiWeight(), TrackerGeometry::idToDet(), diffTwoXMLs::label, LayerMEMap, StripTopology::localPosition(), normalize_, PV3DBase< T, PVType, FrameType >::phi(), reco::Track::recHit(), reco::Track::recHitsSize(), StripGeomDetUnit::specificTopology(), AlCaHLTBitMon_QueryRunRegistry::string, GeomDet::surface(), tkdetmap_, tkmapL3MuTrackClusters, tkmapOnTrackClusters, Surface::toGlobal(), and DetId::Tracker.

Referenced by analyze().

196  {
197 
198  for (size_t hit = 0; hit < l3tk->recHitsSize (); hit++)
199  {
200  //if hit is valid and in tracker say true
201  if (l3tk->recHit (hit)->isValid () == true && l3tk->recHit (hit)->geographicalId ().det () == DetId::Tracker)
202  {
203  uint detID = l3tk->recHit (hit)->geographicalId ()();
204 
205  const SiStripRecHit1D *hit1D = dynamic_cast < const SiStripRecHit1D * >(l3tk->recHit (hit).get ());
206  const SiStripRecHit2D *hit2D = dynamic_cast < const SiStripRecHit2D * >(l3tk->recHit (hit).get ());
207  const SiStripMatchedRecHit2D *hitMatched2D = dynamic_cast < const SiStripMatchedRecHit2D * >(l3tk->recHit (hit).get ());
208  const ProjectedSiStripRecHit2D *hitProj2D = dynamic_cast < const ProjectedSiStripRecHit2D * >(l3tk->recHit (hit).get ());
209 
210 
211  // if SiStripRecHit1D
212  if (hit1D != 0)
213  {
214  int layer = tkdetmap_->FindLayer (detID , cached_detid , cached_layer , cached_XYbin);
216  const StripGeomDetUnit *theGeomDet = dynamic_cast < const StripGeomDetUnit * >(theTracker.idToDet (detID));
217  if (theGeomDet != 0)
218  {
219  const StripTopology *topol = dynamic_cast < const StripTopology * >(&(theGeomDet->specificTopology ()));
220  if (topol != 0)
221  {
222  // get the cluster position in local coordinates (cm)
223  LocalPoint clustlp = topol->localPosition (hit1D->cluster()->barycenter ());
224  GlobalPoint clustgp = theGeomDet->surface ().toGlobal (clustlp);
225  //NORMALIZE HISTO IF ASKED
226  float etaWeight = 1.;
227  float phiWeight = 1.;
228  if (normalize_){
229  etaWeight = GetEtaWeight(label, clustgp);
230  phiWeight = GetPhiWeight(label,clustgp);
231  }
232  if(!isL3MuTrack){
233  LayerMEMap[label.c_str ()].EtaDistribOnTrackClustersMap->Fill (clustgp.eta (),etaWeight);
234  LayerMEMap[label.c_str ()].PhiDistribOnTrackClustersMap->Fill (clustgp.phi (),phiWeight);
235  LayerMEMap[label.c_str ()].EtaPhiOnTrackClustersMap->Fill (clustgp.eta (), clustgp.phi ());
236  tkmapOnTrackClusters->add(detID,1.);
237  }
238  else{
239  LayerMEMap[label.c_str ()].EtaDistribL3MuTrackClustersMap->Fill (clustgp.eta (),etaWeight);
240  LayerMEMap[label.c_str ()].PhiDistribL3MuTrackClustersMap->Fill (clustgp.phi (),phiWeight);
241  LayerMEMap[label.c_str ()].EtaPhiL3MuTrackClustersMap->Fill (clustgp.eta (), clustgp.phi ());
242  tkmapL3MuTrackClusters->add(detID,1.);
243  }
244  }
245  }
246  }
247  // if SiStripRecHit2D
248  if (hit2D != 0)
249  {
250  int layer = tkdetmap_->FindLayer (detID , cached_detid , cached_layer , cached_XYbin);
251  std::string label = tkdetmap_->getLayerName (layer);
252  const StripGeomDetUnit *theGeomDet = dynamic_cast < const StripGeomDetUnit * >(theTracker.idToDet (detID));
253  if (theGeomDet != 0)
254  {
255  const StripTopology *topol = dynamic_cast < const StripTopology * >(&(theGeomDet->specificTopology ()));
256  if (topol != 0)
257  {
258  // get the cluster position in local coordinates (cm)
259  LocalPoint clustlp = topol->localPosition (hit2D->cluster()->barycenter ());
260  GlobalPoint clustgp = theGeomDet->surface ().toGlobal (clustlp);
261 
262  //NORMALIZE HISTO IF ASKED
263  float etaWeight = 1.;
264  float phiWeight = 1.;
265  if (normalize_){
266  etaWeight = GetEtaWeight(label, clustgp);
267  phiWeight = GetPhiWeight(label,clustgp);
268  }
269  if(!isL3MuTrack){
270  LayerMEMap[label.c_str ()].EtaDistribOnTrackClustersMap->Fill (clustgp.eta (),etaWeight);
271  LayerMEMap[label.c_str ()].PhiDistribOnTrackClustersMap->Fill (clustgp.phi (),phiWeight);
272  LayerMEMap[label.c_str ()].EtaPhiOnTrackClustersMap->Fill (clustgp.eta (), clustgp.phi ());
273  tkmapOnTrackClusters->add(detID,1.);
274  }
275  else{
276  LayerMEMap[label.c_str ()].EtaDistribL3MuTrackClustersMap->Fill (clustgp.eta (),etaWeight);
277  LayerMEMap[label.c_str ()].PhiDistribL3MuTrackClustersMap->Fill (clustgp.phi (),phiWeight);
278  LayerMEMap[label.c_str ()].EtaPhiL3MuTrackClustersMap->Fill (clustgp.eta (), clustgp.phi ());
279  tkmapL3MuTrackClusters->add(detID,1.);
280  }
281  }
282  }
283  }
284  // if SiStripMatchedRecHit2D
285  if (hitMatched2D != 0)
286  {
287  //hit mono
288  detID = hitMatched2D->monoId();
289  int layer = tkdetmap_->FindLayer (detID , cached_detid , cached_layer , cached_XYbin);
290  std::string label = tkdetmap_->getLayerName (layer);
291  const StripGeomDetUnit *theGeomDet = dynamic_cast < const StripGeomDetUnit * >(theTracker.idToDet (detID));
292  if (theGeomDet != 0)
293  {
294  const StripTopology *topol = dynamic_cast < const StripTopology * >(&(theGeomDet->specificTopology ()));
295  if (topol != 0)
296  {
297  // get the cluster position in local coordinates (cm)
298  LocalPoint clustlp = topol->localPosition (hitMatched2D->monoCluster().barycenter ());
299  GlobalPoint clustgp = theGeomDet->surface ().toGlobal (clustlp);
300  //NORMALIZE HISTO IF ASKED
301  float etaWeight = 1.;
302  float phiWeight = 1.;
303  if (normalize_){
304  etaWeight = GetEtaWeight(label, clustgp);
305  phiWeight = GetPhiWeight(label,clustgp);
306  }
307  if(!isL3MuTrack){
308  LayerMEMap[label.c_str ()].EtaDistribOnTrackClustersMap->Fill (clustgp.eta (),etaWeight);
309  LayerMEMap[label.c_str ()].PhiDistribOnTrackClustersMap->Fill (clustgp.phi (),phiWeight);
310  LayerMEMap[label.c_str ()].EtaPhiOnTrackClustersMap->Fill (clustgp.eta (), clustgp.phi ());
311  tkmapOnTrackClusters->add(detID,1.);
312  }
313  else{
314  LayerMEMap[label.c_str ()].EtaDistribL3MuTrackClustersMap->Fill (clustgp.eta (),etaWeight);
315  LayerMEMap[label.c_str ()].PhiDistribL3MuTrackClustersMap->Fill (clustgp.phi (),phiWeight);
316  LayerMEMap[label.c_str ()].EtaPhiL3MuTrackClustersMap->Fill (clustgp.eta (), clustgp.phi ());
317  tkmapL3MuTrackClusters->add(detID,1.);
318  }
319  }
320  }
321 
322  //hit stereo
323  detID = hitMatched2D->stereoId ();
325  label = tkdetmap_->getLayerName (layer);
326  const StripGeomDetUnit *theGeomDet2 = dynamic_cast < const StripGeomDetUnit * >(theTracker.idToDet (detID));
327  if (theGeomDet2 != 0)
328  {
329  const StripTopology *topol = dynamic_cast < const StripTopology * >(&(theGeomDet2->specificTopology ()));
330  if (topol != 0)
331  {
332  // get the cluster position in local coordinates (cm)
333  LocalPoint clustlp = topol->localPosition (hitMatched2D->stereoCluster().barycenter ());
334  GlobalPoint clustgp = theGeomDet2->surface ().toGlobal (clustlp);
335  //NORMALIZE HISTO IF ASKED
336  float etaWeight = 1.;
337  float phiWeight = 1.;
338  if (normalize_){
339  etaWeight = GetEtaWeight(label, clustgp);
340  phiWeight = GetPhiWeight(label,clustgp);
341  }
342  if(!isL3MuTrack){
343  LayerMEMap[label.c_str ()].EtaDistribOnTrackClustersMap->Fill (clustgp.eta (),etaWeight);
344  LayerMEMap[label.c_str ()].PhiDistribOnTrackClustersMap->Fill (clustgp.phi (),phiWeight);
345  LayerMEMap[label.c_str ()].EtaPhiOnTrackClustersMap->Fill (clustgp.eta (), clustgp.phi ());
346  tkmapOnTrackClusters->add(detID,1.);
347  }
348  else{
349  LayerMEMap[label.c_str ()].EtaDistribL3MuTrackClustersMap->Fill (clustgp.eta (),etaWeight);
350  LayerMEMap[label.c_str ()].PhiDistribL3MuTrackClustersMap->Fill (clustgp.phi (),phiWeight);
351  LayerMEMap[label.c_str ()].EtaPhiL3MuTrackClustersMap->Fill (clustgp.eta (), clustgp.phi ());
352  tkmapL3MuTrackClusters->add(detID,1.);
353  }
354  }
355  }
356 
357  }
358 
359  //if ProjectedSiStripRecHit2D
360  if (hitProj2D != 0)
361  {
362  detID = hitProj2D->geographicalId ();
363  int layer = tkdetmap_->FindLayer (detID , cached_detid , cached_layer , cached_XYbin);
364  std::string label = tkdetmap_->getLayerName (layer);
365  const StripGeomDetUnit *theGeomDet = dynamic_cast < const StripGeomDetUnit * >(theTracker.idToDet (detID));
366  if (theGeomDet != 0)
367  {
368  const StripTopology *topol = dynamic_cast < const StripTopology * >(&(theGeomDet->specificTopology ()));
369  if (topol != 0)
370  {
371  // get the cluster position in local coordinates (cm)
372  LocalPoint clustlp = topol->localPosition (hitProj2D->cluster()->barycenter ());
373  GlobalPoint clustgp = theGeomDet->surface ().toGlobal (clustlp);
374  //NORMALIZE HISTO IF ASKED
375  float etaWeight = 1.;
376  float phiWeight = 1.;
377  if (normalize_){
378  etaWeight = GetEtaWeight(label, clustgp);
379  phiWeight = GetPhiWeight(label,clustgp);
380  }
381  if(!isL3MuTrack){
382  LayerMEMap[label.c_str ()].EtaDistribOnTrackClustersMap->Fill (clustgp.eta (),etaWeight);
383  LayerMEMap[label.c_str ()].PhiDistribOnTrackClustersMap->Fill (clustgp.phi (),phiWeight);
384  LayerMEMap[label.c_str ()].EtaPhiOnTrackClustersMap->Fill (clustgp.eta (), clustgp.phi ());
385  tkmapOnTrackClusters->add(detID,1.);
386  }
387  else{
388  LayerMEMap[label.c_str ()].EtaDistribL3MuTrackClustersMap->Fill (clustgp.eta (),etaWeight);
389  LayerMEMap[label.c_str ()].PhiDistribL3MuTrackClustersMap->Fill (clustgp.phi (),phiWeight);
390  LayerMEMap[label.c_str ()].EtaPhiL3MuTrackClustersMap->Fill (clustgp.eta (), clustgp.phi ());
391  tkmapL3MuTrackClusters->add(detID,1.);
392  }
393  }
394  }
395  }
396 
397  }
398  } //loop over RecHits
399 }
ClusterRef cluster() const
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
Definition: Track.h:119
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
float GetPhiWeight(std::string label, GlobalPoint gp)
TkLayerMap::XYbin cached_XYbin
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
float GetEtaWeight(std::string label, GlobalPoint gp)
std::string getLayerName(int &in) const
Definition: TkDetMap.cc:702
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
std::map< std::string, LayerMEs > LayerMEMap
T eta() const
Definition: PV3DBase.h:76
TrackingRecHitRef recHit(size_t i) const
Get i-th hit on the track.
Definition: Track.h:114
virtual LocalPoint localPosition(float strip) const =0
int16_t FindLayer(uint32_t &detid, uint32_t &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:664
void add(uint32_t &detid, float value)
Definition: TkHistoMap.cc:213
virtual const TrackerGeomDet * idToDet(DetId) const
void SiStripMonitorMuonHLT::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  es 
)
overrideprivatevirtual

Implements thread_unsafe::DQMEDAnalyzer.

Definition at line 1246 of file SiStripMonitorMuonHLT.cc.

References createMEs(), monitorName_, prescaleEvt_, runOnClusters_, runOnMuonCandidates_, runOnTracks_, DQMStore::IBooker::setCurrentFolder(), tkmapAllClusters, tkmapL3MuTrackClusters, and tkmapOnTrackClusters.

1247 {
1248  if (monitorName_ != "")
1249  monitorName_ = monitorName_ + "/";
1250  ibooker.setCurrentFolder (monitorName_);
1251  edm::LogInfo ("HLTMuonDQMSource") << "===>DQM event prescale = " << prescaleEvt_ << " events " << std::endl;
1252  createMEs (ibooker , es);
1253  //create TKHistoMap
1254  if(runOnClusters_)
1255  tkmapAllClusters = new TkHistoMap(ibooker , "HLT/HLTMonMuon/SiStrip" ,"TkHMap_AllClusters",0.0,0);
1256  if(runOnTracks_)
1257  tkmapOnTrackClusters = new TkHistoMap(ibooker , "HLT/HLTMonMuon/SiStrip" ,"TkHMap_OnTrackClusters",0.0,0);
1259  tkmapL3MuTrackClusters = new TkHistoMap(ibooker , "HLT/HLTMonMuon/SiStrip" ,"TkHMap_L3MuTrackClusters",0.0,0);
1260 }
int prescaleEvt_
mutriggered events
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
void createMEs(DQMStore::IBooker &, const edm::EventSetup &es)
void SiStripMonitorMuonHLT::createMEs ( DQMStore::IBooker ibooker,
const edm::EventSetup es 
)
private

Creation of folder structure and ME decleration

Definition at line 402 of file SiStripMonitorMuonHLT.cc.

References begin, DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), TrackerGeometry::detUnitIds(), end, SiStripMonitorMuonHLT::LayerMEs::EtaDistribAllClustersMap, SiStripMonitorMuonHLT::LayerMEs::EtaDistribL3MuTrackClustersMap, SiStripMonitorMuonHLT::LayerMEs::EtaDistribOnTrackClustersMap, SiStripMonitorMuonHLT::LayerMEs::EtaPhiAllClustersMap, SiStripMonitorMuonHLT::LayerMEs::EtaPhiL3MuTrackClustersMap, SiStripMonitorMuonHLT::LayerMEs::EtaPhiOnTrackClustersMap, newFWLiteAna::fullName, GeometryFromTrackGeom(), edm::EventSetup::get(), TkDetMap::getLayerName(), SiStripFolderOrganizer::getSubDetLayerFolderName(), TkDetMap::getSubDetLayerSide(), HistoNumber, i, LayerMEMap, m_BinEta, m_BinPhi, M_PI, monitorName_, Normalizer(), AlCaHLTBitMon_ParallelJobs::p, SiStripMonitorMuonHLT::LayerMEs::PhiDistribAllClustersMap, SiStripMonitorMuonHLT::LayerMEs::PhiDistribL3MuTrackClustersMap, SiStripMonitorMuonHLT::LayerMEs::PhiDistribOnTrackClustersMap, edm::ESHandle< class >::product(), runOnClusters_, runOnMuonCandidates_, runOnTracks_, DQMStore::IBooker::setCurrentFolder(), edm::shift, python.multivaluedict::sort(), contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, indexGen::title, and tkdetmap_.

Referenced by bookHistograms().

403 {
404 
405  // vector used
406  std::vector <float *> tgraphEta;
407  std::vector <float *> tgraphPhi;
408  std::vector <int> tgraphSize;
409 
410  std::vector <std::vector<float> > binningEta;
411  std::vector <std::vector<float> > binningPhi;
412 
413  for (int p = 0; p < 34; p++){
414  tgraphEta.push_back (new float[1000]);
415  tgraphPhi.push_back (new float[1000]);
416  }
417 
418  // FOR COMPUTING BINNING
419  std::map< std::string,std::vector<float> > m_BinEta_Prel ;
420  std::map< std::string,std::vector<float> > m_PhiStripMod_Eta;
421  std::map< std::string,std::vector<float> > m_PhiStripMod_Nb;
422 
423  //----------------
424 
425  //Get the tracker geometry
427  es.get < TrackerDigiGeometryRecord > ().get (TG);
428  const TrackerGeometry *theTrackerGeometry = TG.product ();
429  const TrackerGeometry & theTracker (*theTrackerGeometry);
430 
431  std::vector<DetId> Dets = theTracker.detUnitIds();
432 
433 
434  //CALL GEOMETRY METHOD
435  GeometryFromTrackGeom(Dets,theTracker,es,m_PhiStripMod_Eta,m_PhiStripMod_Nb);
436 
437 
442 
443  std::string fullName, folder;
444 
445  //STRUCTURE OF DETECTORS
446  int p =0;
447 
448  //Loop over layers
449  for (int layer = 1; layer < HistoNumber; ++layer)
450  {
451  SiStripFolderOrganizer folderOrg;
452  std::stringstream ss;
454  uint32_t subdetlayer, side;
455  tkdetmap_->getSubDetLayerSide (layer, subDet, subdetlayer, side);
456  folderOrg.getSubDetLayerFolderName (ss, subDet, subdetlayer, side);
457  folder = ss.str ();
458  ibooker.setCurrentFolder (monitorName_ + folder);
459 
460  LayerMEs layerMEs;
461  layerMEs.EtaPhiAllClustersMap = 0;
462  layerMEs.EtaDistribAllClustersMap = 0;
463  layerMEs.PhiDistribAllClustersMap = 0;
464  layerMEs.EtaPhiOnTrackClustersMap = 0;
465  layerMEs.EtaDistribOnTrackClustersMap = 0;
466  layerMEs.PhiDistribOnTrackClustersMap = 0;
467  layerMEs.EtaPhiL3MuTrackClustersMap = 0;
468  layerMEs.EtaDistribL3MuTrackClustersMap = 0;
469  layerMEs.PhiDistribL3MuTrackClustersMap = 0;
470 
471  std::string histoname;
473  std::string labelHisto = tkdetmap_->getLayerName (layer);
474 
475  std::string labelHisto_ID = labelHisto;
476  labelHisto_ID.erase(3);
477 
478  //
479  unsigned int sizePhi = 0;
480  unsigned int sizeEta = 0;
481  float * xbinsPhi = new float[100];
482  float * xbinsEta = new float[100];
483 
484  //TEC && TID && TOB && TIB
485  if (labelHisto_ID == "TEC" || labelHisto_ID == "TID" || labelHisto_ID == "TOB" || labelHisto_ID == "TIB"){
486 
487  // PHI BINNING
488  //ADDING BORDERS
489  m_BinPhi[labelHisto].push_back(-M_PI);
490  m_BinPhi[labelHisto].push_back(M_PI);
491 
492  //SORTING
493  sort(m_BinPhi[labelHisto].begin(),m_BinPhi[labelHisto].end());
494  //CREATING XBIN VECTOR
495  sizePhi = m_BinPhi[labelHisto].size();
496 
497  for (unsigned int i = 0; i < sizePhi; i++){
498  xbinsPhi[i] = m_BinPhi[labelHisto][i];
499  }
500 
501  //ETA BINNING
502  std::vector <float > v_BinEta_Prel;
503  // LOOPING ON RINGS
504  for (unsigned int i = 0; i < 12; i++){
505  // COMPUTE BARYCENTER IF NON NULL
506  if (m_PhiStripMod_Nb[labelHisto][i] != 0 && fabs(m_PhiStripMod_Eta[labelHisto][i]) > 0.05){
507  float EtaBarycenter = m_PhiStripMod_Eta[labelHisto][i]/m_PhiStripMod_Nb[labelHisto][i];
508  v_BinEta_Prel.push_back(EtaBarycenter);
509  }
510  }
511 
512  //SORT THEM IN ETA
513  sort(v_BinEta_Prel.begin(),v_BinEta_Prel.end());
514 
515  //RECOMPUTE THE BINS BY TAKING THE HALF OF THE DISTANCE
516  for (unsigned int i = 0; i < v_BinEta_Prel.size(); i++){
517  if (i == 0) m_BinEta[labelHisto].push_back(v_BinEta_Prel[i] - 0.15);
518  if (i != 0) {
519  float shift = v_BinEta_Prel[i] - v_BinEta_Prel[i-1];
520  m_BinEta[labelHisto].push_back(v_BinEta_Prel[i] - shift/2.);
521  }
522  if (i == v_BinEta_Prel.size()-1) m_BinEta[labelHisto].push_back(v_BinEta_Prel[i] + 0.15);
523  }
524 
525  sort(m_BinEta[labelHisto].begin(),m_BinEta[labelHisto].end());
526 
527  //CREATING XBIN VECTOR
528  sizeEta = m_BinEta[labelHisto].size();
529 
530  for (unsigned int i = 0; i < sizeEta; i++){
531  xbinsEta[i] = m_BinEta[labelHisto][i];
532  }
533 
534  } // END SISTRIP DETECTORS
535 
536  // all clusters
537  if(runOnClusters_){
538  histoname = "EtaAllClustersDistrib_" + labelHisto;
539  title = "#eta(All Clusters) in " + labelHisto;
540  layerMEs.EtaDistribAllClustersMap = ibooker.book1D (histoname, title, sizeEta - 1, xbinsEta);
541  histoname = "PhiAllClustersDistrib_" + labelHisto;
542  title = "#phi(All Clusters) in " + labelHisto;
543  layerMEs.PhiDistribAllClustersMap = ibooker.book1D (histoname, title, sizePhi - 1, xbinsPhi);
544  histoname = "EtaPhiAllClustersMap_" + labelHisto;
545  title = "#eta-#phi All Clusters map in " + labelHisto;
546  layerMEs.EtaPhiAllClustersMap = ibooker.book2D (histoname, title, sizeEta - 1, xbinsEta, sizePhi - 1, xbinsPhi);
547  }
548  // on track clusters
549  if(runOnTracks_){
550  histoname = "EtaOnTrackClustersDistrib_" + labelHisto;
551  title = "#eta(OnTrack Clusters) in " + labelHisto;
552  layerMEs.EtaDistribOnTrackClustersMap = ibooker.book1D (histoname, title, sizeEta - 1, xbinsEta);
553  histoname = "PhiOnTrackClustersDistrib_" + labelHisto;
554  title = "#phi(OnTrack Clusters) in " + labelHisto;
555  layerMEs.PhiDistribOnTrackClustersMap = ibooker.book1D (histoname, title, sizePhi - 1, xbinsPhi);
556  histoname = "EtaPhiOnTrackClustersMap_" + labelHisto;
557  title = "#eta-#phi OnTrack Clusters map in " + labelHisto;
558  layerMEs.EtaPhiOnTrackClustersMap = ibooker.book2D (histoname, title, sizeEta - 1, xbinsEta, sizePhi - 1, xbinsPhi);
559  }
561  // L3 muon track clusters
562  histoname = "EtaL3MuTrackClustersDistrib_" + labelHisto;
563  title = "#eta(L3MuTrack Clusters) in " + labelHisto;
564  layerMEs.EtaDistribL3MuTrackClustersMap = ibooker.book1D (histoname, title, sizeEta - 1, xbinsEta);
565  histoname = "PhiL3MuTrackClustersDistrib_" + labelHisto;
566  title = "#phi(L3MuTrack Clusters) in " + labelHisto;
567  layerMEs.PhiDistribL3MuTrackClustersMap = ibooker.book1D (histoname, title, sizePhi - 1, xbinsPhi);
568  histoname = "EtaPhiL3MuTrackClustersMap_" + labelHisto;
569  title = "#eta-#phi L3MuTrack Clusters map in " + labelHisto;
570  layerMEs.EtaPhiL3MuTrackClustersMap = ibooker.book2D (histoname, title, sizeEta - 1, xbinsEta, sizePhi - 1, xbinsPhi);
571  }
572  LayerMEMap[labelHisto] = layerMEs;
573 
574  //PUTTING ERRORS
575  if(runOnClusters_){
576  LayerMEMap[labelHisto].EtaDistribAllClustersMap->getTH1F()->Sumw2();
577  LayerMEMap[labelHisto].PhiDistribAllClustersMap->getTH1F()->Sumw2();
578  LayerMEMap[labelHisto].EtaPhiAllClustersMap->getTH2F()->Sumw2();
579  }
580  if(runOnTracks_){
581  LayerMEMap[labelHisto].EtaDistribOnTrackClustersMap->getTH1F()->Sumw2();
582  LayerMEMap[labelHisto].PhiDistribOnTrackClustersMap->getTH1F()->Sumw2();
583  LayerMEMap[labelHisto].EtaPhiOnTrackClustersMap->getTH2F()->Sumw2();
584  }
586  LayerMEMap[labelHisto].EtaDistribL3MuTrackClustersMap->getTH1F()->Sumw2();
587  LayerMEMap[labelHisto].PhiDistribL3MuTrackClustersMap->getTH1F()->Sumw2();
588  LayerMEMap[labelHisto].EtaPhiL3MuTrackClustersMap->getTH2F()->Sumw2();
589  }
590 
591  p++;
592  } //end of loop over layers
593 
594 
595  //CALL THE NORMALIZATION METHOD
596  Normalizer(Dets,theTracker);
597 
598 } //end of method
int i
Definition: DBlmapReader.cc:9
std::map< std::string, std::vector< float > > m_BinPhi
void GeometryFromTrackGeom(const std::vector< DetId > &Dets, const TrackerGeometry &theTracker, const edm::EventSetup &iSetup, std::map< std::string, std::vector< float > > &m_PhiStripMod_Eta, std::map< std::string, std::vector< float > > &m_PhiStripMod_Nb)
void getSubDetLayerFolderName(std::stringstream &ss, SiStripDetId::SubDetector subDet, uint32_t layer, uint32_t side=0)
void getSubDetLayerSide(int &in, SiStripDetId::SubDetector &, uint32_t &layer, uint32_t &side) const
Definition: TkDetMap.cc:849
std::string getLayerName(int &in) const
Definition: TkDetMap.cc:702
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
#define end
Definition: vmac.h:37
#define M_PI
std::map< std::string, LayerMEs > LayerMEMap
void Normalizer(const std::vector< DetId > &Dets, const TrackerGeometry &theTracker)
string fullName
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::map< std::string, std::vector< float > > m_BinEta
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
#define begin
Definition: vmac.h:30
static unsigned int const shift
void SiStripMonitorMuonHLT::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 1264 of file SiStripMonitorMuonHLT.cc.

References counterEvt_.

1265 {
1266  edm::LogInfo ("SiStripMonitorHLTMuon") << "analyzed " << counterEvt_ << " events";
1267  return;
1268 }
void SiStripMonitorMuonHLT::GeometryFromTrackGeom ( const std::vector< DetId > &  Dets,
const TrackerGeometry theTracker,
const edm::EventSetup iSetup,
std::map< std::string, std::vector< float > > &  m_PhiStripMod_Eta,
std::map< std::string, std::vector< float > > &  m_PhiStripMod_Nb 
)
private

Definition at line 602 of file SiStripMonitorMuonHLT.cc.

References cached_detid, cached_layer, cached_XYbin, prof2calltree::count, cond::rpcobgas::detid, PV3DBase< T, PVType, FrameType >::eta(), TkDetMap::FindLayer(), edm::EventSetup::get(), TkDetMap::getLayerName(), i, TrackerGeometry::idToDet(), TrackerGeometry::idToDetUnit(), m_BinPhi, PV3DBase< T, PVType, FrameType >::phi(), edm::ESHandle< class >::product(), StripGeomDetUnit::specificTopology(), AlCaHLTBitMon_QueryRunRegistry::string, GeomDet::subDetector(), GeomDet::surface(), GeomDetEnumerators::TEC, TrackerTopology::tecIsBackPetal(), TrackerTopology::tecIsFrontPetal(), TrackerTopology::tecIsStereo(), TrackerTopology::tecIsZMinusSide(), TrackerTopology::tecModule(), TrackerTopology::tecPetalNumber(), TrackerTopology::tecRing(), GeomDetEnumerators::TIB, TrackerTopology::tibIsInternalString(), TrackerTopology::tibIsStereo(), TrackerTopology::tibIsZMinusSide(), TrackerTopology::tibModule(), TrackerTopology::tibString(), GeomDetEnumerators::TID, tkdetmap_, GeomDetEnumerators::TOB, TrackerTopology::tobIsStereo(), TrackerTopology::tobIsZMinusSide(), TrackerTopology::tobModule(), TrackerTopology::tobRod(), and Surface::toGlobal().

Referenced by createMEs().

603  {
604 
605  //Retrieve tracker topology from geometry
606  edm::ESHandle<TrackerTopology> tTopoHandle;
607  es.get<IdealGeometryRecord>().get(tTopoHandle);
608  const TrackerTopology* const tTopo = tTopoHandle.product();
609 
610  std::vector<std::string> v_LabelHisto;
611 
612  //Loop over DetIds
613  //-----------------------------------------
614  for(std::vector<DetId>::const_iterator detid_iterator = Dets.begin(); detid_iterator!=Dets.end(); ++detid_iterator){
615  uint32_t detid = (*detid_iterator)();
616 
617  if ( (*detid_iterator).null() == true) break;
618  if (detid == 0) break;
619 
620  // Select the propers detectors - avoid pixels
621  const GeomDetUnit * GeomDet = theTracker.idToDetUnit(detid);
622  const GeomDet::SubDetector detector = GeomDet->subDetector();
623 
624  int mylayer;
625  std::string mylabelHisto;
626 
627  // SELECT SISTRIP DETECTORS
628  if (detector == GeomDetEnumerators::TEC
629  || detector == GeomDetEnumerators::TID
630  || detector == GeomDetEnumerators::TOB
631  || detector == GeomDetEnumerators::TIB
632  ){
633 
634  const StripGeomDetUnit *theGeomDet = dynamic_cast < const StripGeomDetUnit * >(theTracker.idToDet (detid));
635  const StripTopology *topol = dynamic_cast < const StripTopology * >(&(theGeomDet->specificTopology ()));
636 
637  // Get the position of the 1st strip in local coordinates (cm)
638  LocalPoint clustlp = topol->localPosition (1.);
639  GlobalPoint clustgp = theGeomDet->surface ().toGlobal (clustlp);
640 
641  // Get the eta, phi of modules
642  mylayer = tkdetmap_->FindLayer (detid , cached_detid , cached_layer , cached_XYbin);
643  mylabelHisto = tkdetmap_->getLayerName (mylayer);
644 
645  // SiStripDetId stripdet = SiStripDetId(detid);
646 
647  // INITIALISATION OF m_PhiStripMod_Eta + BOOKING LAYERS
648 
649  //TEST IF NEW LAYER
650  unsigned int count = 0;
651  while (count < v_LabelHisto.size()){
652  if (mylabelHisto == v_LabelHisto[count]) break;
653  count++;
654  }
655  if (count == v_LabelHisto.size()){
656 
657  //FILL THE NEW LAYER
658  v_LabelHisto.push_back(mylabelHisto);
659 
660  //INITIALIZE
661 
662  // LOOPING ON RINGS
663  for (int i = 0; i < 12; i++){
664  m_PhiStripMod_Eta[mylabelHisto].push_back(0.);
665  m_PhiStripMod_Nb[mylabelHisto].push_back(0.);
666  }
667  }
668 
669  //TEC
670  if (detector == GeomDetEnumerators::TEC ){
671 
672 
673 
674  //PHI BINNING
675  //Select 7th ring
676  if (tTopo->tecRing(detid) == 7){
677  //SELECT FP
678  if (tTopo->tecModule(detid) == 1 && tTopo->tecIsFrontPetal(detid) == true) m_BinPhi[mylabelHisto].push_back(clustgp.phi());
679  //SELECT BP
680  if (tTopo->tecModule(detid) == 1 && tTopo->tecIsBackPetal(detid) == true) m_BinPhi[mylabelHisto].push_back(clustgp.phi());
681  }
682 
683  //ETA BINNING
684  //Select arbitrary petal
685  if (tTopo->tecPetalNumber(detid) == 1 ){
686  m_PhiStripMod_Eta[mylabelHisto][tTopo->tecRing(detid)-1] = m_PhiStripMod_Eta[mylabelHisto][tTopo->tecRing(detid)-1] + clustgp.eta();
687  m_PhiStripMod_Nb[mylabelHisto][tTopo->tecRing(detid)-1]++;
688  }
689 
690  } //END TEC
691 
692  //TID
693  if (detector == GeomDetEnumerators::TID ){
694 
695 
696 
697  //PHI BINNING
698  //Select 1st ring
699  if (tTopo->tecRing(detid) == 1){
700  //SELECT MONO
701  if (tTopo->tecIsFrontPetal(detid) == true && tTopo->tecIsStereo(detid) == false) m_BinPhi[mylabelHisto].push_back(clustgp.phi());
702  //SELECT STEREO
703  if (tTopo->tecIsFrontPetal(detid) == true && tTopo->tecIsStereo(detid) == true) m_BinPhi[mylabelHisto].push_back(clustgp.phi());
704  }
705 
706  //ETA BINNING
707  //Select arbitrary line in eta (phi fixed)
708  if (tTopo->tecModule(detid) == 1){
709  m_PhiStripMod_Eta[mylabelHisto][tTopo->tecRing(detid)-1] = m_PhiStripMod_Eta[mylabelHisto][tTopo->tecRing(detid)-1] + clustgp.eta();
710  m_PhiStripMod_Nb[mylabelHisto][tTopo->tecRing(detid)-1]++;
711  }
712 
713  } //END TID
714 
715  //TOB
716  if (detector == GeomDetEnumerators::TOB ){
717 
718 
719  //PHI BINNING
720  //Select arbitrary line in phi (detid)ta fixed)
721  if (tTopo->tecModule(detid) == 1 && tTopo->tecIsZMinusSide(detid) == true){
722  //SELECT MONO
723  if (tTopo->tecIsStereo(detid) == false) m_BinPhi[mylabelHisto].push_back(clustgp.phi());
724  }
725 
726  //ETA BINNING
727  //Select arbitrary rod
728  if ( (tTopo->tobRod(detid) == 2 && tTopo->tobIsStereo(detid) == false)
729  || (tTopo->tobRod(detid) == 1 && tTopo->tobIsStereo(detid) == true)
730  ){
731  if (tTopo->tobIsZMinusSide(detid) == true){
732  m_PhiStripMod_Eta[mylabelHisto][tTopo->tobModule(detid)-1] = m_PhiStripMod_Eta[mylabelHisto][tTopo->tobModule(detid)-1] + clustgp.eta();
733  m_PhiStripMod_Nb[mylabelHisto][tTopo->tobModule(detid)-1]++;
734  }
735  if (tTopo->tobIsZMinusSide(detid) == false){
736  m_PhiStripMod_Eta[mylabelHisto][tTopo->tobModule(detid)+5] = m_PhiStripMod_Eta[mylabelHisto][tTopo->tobModule(detid)+5] + clustgp.eta();
737  m_PhiStripMod_Nb[mylabelHisto][tTopo->tobModule(detid)+5]++;
738  }
739  }
740 
741  } //END TOB
742 
743  //TIB
744  if (detector == GeomDetEnumerators::TIB ){
745 
746 
747 
748  //PHI BINNING
749  //Select arbitrary line in phi (eta fixed)
750  if (tTopo->tibModule(detid) == 1 && tTopo->tibIsZMinusSide(detid) == true){
751  //SELECT MONO
752  if (tTopo->tibIsInternalString(detid) == true && tTopo->tibIsStereo(detid) == false) m_BinPhi[mylabelHisto].push_back(clustgp.phi());
753  }
754 
755  //ETA BINNING
756  //Select arbitrary string
757  if ( (tTopo->tibString(detid) == 2 && tTopo->tibIsStereo(detid) == false)
758  || (tTopo->tibString(detid) == 1 && tTopo->tibIsStereo(detid) == true)
759  ){
760  if (tTopo->tibIsZMinusSide(detid) == true){
761  if (tTopo->tibIsInternalString(detid) == true){
762  m_PhiStripMod_Eta[mylabelHisto][tTopo->tibModule(detid)-1] = m_PhiStripMod_Eta[mylabelHisto][tTopo->tibModule(detid)-1] + clustgp.eta();
763  m_PhiStripMod_Nb[mylabelHisto][tTopo->tibModule(detid)-1]++;
764  }
765  if (tTopo->tibIsInternalString(detid) == false){
766  m_PhiStripMod_Eta[mylabelHisto][tTopo->tibModule(detid)+2] = m_PhiStripMod_Eta[mylabelHisto][tTopo->tibModule(detid)+2] + clustgp.eta();
767  m_PhiStripMod_Nb[mylabelHisto][tTopo->tibModule(detid)+2]++;
768  }
769  }
770  if (tTopo->tibIsZMinusSide(detid) == false){
771  if (tTopo->tibIsInternalString(detid) == true){
772  m_PhiStripMod_Eta[mylabelHisto][tTopo->tibModule(detid)+5] = m_PhiStripMod_Eta[mylabelHisto][tTopo->tibModule(detid)+5] + clustgp.eta();
773  m_PhiStripMod_Nb[mylabelHisto][tTopo->tibModule(detid)+5]++;
774  }
775  if (tTopo->tibIsInternalString(detid) == false){
776  m_PhiStripMod_Eta[mylabelHisto][tTopo->tibModule(detid)+8] = m_PhiStripMod_Eta[mylabelHisto][tTopo->tibModule(detid)+8] + clustgp.eta();
777  m_PhiStripMod_Nb[mylabelHisto][tTopo->tibModule(detid)+8]++;
778  }
779  }
780  }
781 
782  } //END TIB
783 
784  } // END SISTRIP DETECTORS
785  } // END DETID LOOP
786 
787 } //END OF METHOD
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
virtual const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
int i
Definition: DBlmapReader.cc:9
std::map< std::string, std::vector< float > > m_BinPhi
unsigned int tibString(const DetId &id) const
bool tobIsStereo(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
TkLayerMap::XYbin cached_XYbin
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
bool tecIsZMinusSide(const DetId &id) const
bool tecIsStereo(const DetId &id) const
bool tibIsZMinusSide(const DetId &id) const
std::string getLayerName(int &in) const
Definition: TkDetMap.cc:702
bool tobIsZMinusSide(const DetId &id) const
unsigned int tibModule(const DetId &id) const
unsigned int tecModule(const DetId &id) const
bool tecIsFrontPetal(const DetId &id) const
bool tecIsBackPetal(const DetId &id) const
bool tibIsStereo(const DetId &id) const
T const * product() const
Definition: ESHandle.h:86
unsigned int tobModule(const DetId &id) const
T eta() const
Definition: PV3DBase.h:76
int16_t FindLayer(uint32_t &detid, uint32_t &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:664
unsigned int tecPetalNumber(const DetId &id) const
unsigned int tobRod(const DetId &id) const
virtual SubDetector subDetector() const
Which subdetector.
Definition: GeomDet.cc:49
bool tibIsInternalString(const DetId &id) const
virtual const TrackerGeomDet * idToDet(DetId) const
float SiStripMonitorMuonHLT::GetEtaWeight ( std::string  label,
GlobalPoint  gp 
)
private

Definition at line 87 of file SiStripMonitorMuonHLT.cc.

References PV3DBase< T, PVType, FrameType >::eta(), i, diffTwoXMLs::label, m_BinEta, and m_ModNormEta.

Referenced by analyze(), and analyzeOnTrackClusters().

87  {
88  float etaWeight = 1.;
89  for (unsigned int i = 0; i < m_BinEta[label].size() - 1; i++){
90  if (m_BinEta[label][i] < clustgp.eta() && clustgp.eta() < m_BinEta[label][i+1]){
91  if (m_ModNormEta[label][i] > 0.1) etaWeight = 1./m_ModNormEta[label][i];
92  else etaWeight = 1.;
93  }
94  }
95  return etaWeight;
96 }
int i
Definition: DBlmapReader.cc:9
std::map< std::string, std::vector< float > > m_BinEta
std::map< std::string, std::vector< float > > m_ModNormEta
float SiStripMonitorMuonHLT::GetPhiWeight ( std::string  label,
GlobalPoint  gp 
)
private

Definition at line 98 of file SiStripMonitorMuonHLT.cc.

References i, diffTwoXMLs::label, m_BinPhi, m_ModNormPhi, and PV3DBase< T, PVType, FrameType >::phi().

Referenced by analyze(), and analyzeOnTrackClusters().

98  {
99  float phiWeight = 1.;
100  for (unsigned int i = 0; i < m_BinPhi[label].size() - 1; i++){
101  if (m_BinPhi[label][i] < clustgp.phi() && clustgp.phi() < m_BinPhi[label][i+1]){
102  if (m_ModNormPhi[label][i] > 0.1) phiWeight = 1./m_ModNormPhi[label][i];
103  else phiWeight = 1.;
104  }
105  }
106  return phiWeight;
107 }
int i
Definition: DBlmapReader.cc:9
std::map< std::string, std::vector< float > > m_BinPhi
std::map< std::string, std::vector< float > > m_ModNormPhi
void SiStripMonitorMuonHLT::Normalizer ( const std::vector< DetId > &  Dets,
const TrackerGeometry theTracker 
)
private

Definition at line 792 of file SiStripMonitorMuonHLT.cc.

References cached_detid, cached_layer, cached_XYbin, prof2calltree::count, cond::rpcobgas::detid, PV3DBase< T, PVType, FrameType >::eta(), eta(), TkDetMap::FindLayer(), TkDetMap::getLayerName(), i, TrackerGeometry::idToDet(), TrackerGeometry::idToDetUnit(), RectangularPlaneBounds::length(), TrapezoidalPlaneBounds::length(), m_BinEta, m_BinPhi, m_ModNormEta, m_ModNormPhi, M_PI, bookConverter::max, min(), convertSQLitetoXML_cfg::output, phi, PV3DBase< T, PVType, FrameType >::phi(), PrintNormalization(), printNormalize_, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, GeomDet::subDetector(), GeomDet::surface(), GeomDetEnumerators::TEC, GeomDetEnumerators::TIB, GeomDetEnumerators::TID, tkdetmap_, GeomDetEnumerators::TOB, Surface::toGlobal(), RectangularPlaneBounds::width(), create_public_lumi_plots::width, TrapezoidalPlaneBounds::widthAtHalfLength(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by createMEs().

792  {
793 
794 
795  std::vector<std::string> v_LabelHisto;
796 
797  //Loop over DetIds
798  //-----------------------------------------
799  for(std::vector<DetId>::const_iterator detid_iterator = Dets.begin(); detid_iterator!=Dets.end(); detid_iterator++){
800  uint32_t detid = (*detid_iterator)();
801 
802  if ( (*detid_iterator).null() == true) break;
803  if (detid == 0) break;
804 
805  // Select the propers detectors - avoid pixels
806  const GeomDetUnit * GeomDet = theTracker.idToDetUnit(detid);
807  const GeomDet::SubDetector detector = GeomDet->subDetector();
808 
809  int mylayer;
810  std::string mylabelHisto;
811 
812  // SELECT SISTRIP DETECTORS
813  if (detector == GeomDetEnumerators::TEC
814  || detector == GeomDetEnumerators::TID
815  || detector == GeomDetEnumerators::TOB
816  || detector == GeomDetEnumerators::TIB
817  ){
818 
819  const StripGeomDetUnit *theGeomDet = dynamic_cast < const StripGeomDetUnit * >(theTracker.idToDet (detid));
820  // const StripTopology *topol = dynamic_cast < const StripTopology * >(&(theGeomDet->specificTopology ()));
821 
822  // Get the eta, phi of modules
823  mylayer = tkdetmap_->FindLayer (detid , cached_detid , cached_layer , cached_XYbin);
824  mylabelHisto = tkdetmap_->getLayerName (mylayer);
825 
826  // SiStripDetId stripdet = SiStripDetId(detid);
827 
828  // INITIALISATION OF m_ModNormEta + BOOKING LAYERS
829 
830  //TEST IF NEW LAYER
831  unsigned int count = 0;
832 
833  while (count < v_LabelHisto.size()){
834  if (mylabelHisto == v_LabelHisto[count]) break;
835  count++;
836  }
837 
838  if (count == v_LabelHisto.size()){
839  //FILL THE NEW LAYER
840  v_LabelHisto.push_back(mylabelHisto);
841 
842  //INITIALIZE
843  // LOOPING ON ETA VECTOR
844  for (unsigned int i = 0; i < m_BinEta[mylabelHisto].size() -1; i++){
845  m_ModNormEta[mylabelHisto].push_back(0.);
846  }
847 
848  // LOOPING ON PHI VECTOR
849  for (unsigned int i = 0; i < m_BinPhi[mylabelHisto].size() -1; i++){
850  m_ModNormPhi[mylabelHisto].push_back(0.);
851  }
852  }
853 
854  // Get the position of the 1st strip in local coordinates (cm)
855  // LocalPoint clustlp_1 = topol->localPosition (1.);
856  // GlobalPoint clustgp_1 = theGeomDet->surface ().toGlobal (clustlp_1);
857 
858  // Get the position of the center of the module
859  LocalPoint clustlp(0.,0.);
860  GlobalPoint clustgp = theGeomDet->surface ().toGlobal (clustlp);
861 
862  // Get the position of the last strip
863  // LocalPoint Border_clustlp = topol->localPosition (topol->nstrips());
864  // GlobalPoint Border_clustgp = theGeomDet->surface ().toGlobal (Border_clustlp);
865 
866  //GETTING SURFACE VALUE
867  const BoundPlane& GeomDetSurface = GeomDet->surface();
868  const Bounds& bound = GeomDetSurface.bounds();
869 
870  std::string labelHisto_ID = mylabelHisto;
871  labelHisto_ID.erase(3);
872 
873  float length = 0.;
874  float width = 0.;
875 
876  std::vector <GlobalPoint> v_Edge_G;
877 
878  float ratio = 0.;
879  float factor = 1.;
880 
881  //RECTANGULAR BOUNDS
882  if (labelHisto_ID == "TOB" || labelHisto_ID == "TIB"){
883  const RectangularPlaneBounds *rectangularBound = dynamic_cast < const RectangularPlaneBounds * >(& bound);
884  length = rectangularBound->length();
885  width = rectangularBound->width();
886  ratio = width/length;
887 
888  //EDGES POINTS
889  LocalPoint topleft(-width/2., length/2.);
890  LocalPoint topright(width/2., length/2.); LocalPoint botleft(-width/2., -length/2.);
891  LocalPoint botright(width/2., -length/2.);
892  v_Edge_G.push_back(theGeomDet->surface ().toGlobal (topleft));
893  v_Edge_G.push_back(theGeomDet->surface ().toGlobal (topright));
894  v_Edge_G.push_back(theGeomDet->surface ().toGlobal (botleft)); v_Edge_G.push_back(theGeomDet->surface ().toGlobal (botright));
895  }
896  //TRAPEZOIDAL BOUNDS
897  if (labelHisto_ID == "TEC" || labelHisto_ID == "TID"){
898  const TrapezoidalPlaneBounds *trapezoidalBound = dynamic_cast < const TrapezoidalPlaneBounds * >(& bound);
899 
900  length = trapezoidalBound->length();
901  width = trapezoidalBound->widthAtHalfLength();
902 
903  ratio = width/length;
904 
905  //EDGES POINTS
906  LocalPoint topleft(-width/2., length/2.);
907  LocalPoint topright(width/2., length/2.);
908  LocalPoint botleft(-width/2., -length/2.);
909  LocalPoint botright(width/2., -length/2.);
910 
911  v_Edge_G.push_back(theGeomDet->surface ().toGlobal (topleft));
912  v_Edge_G.push_back(theGeomDet->surface ().toGlobal (topright));
913  v_Edge_G.push_back(theGeomDet->surface ().toGlobal (botleft));
914  v_Edge_G.push_back(theGeomDet->surface ().toGlobal (botright));
915  }
916 
917  //SORTING EDGES POINTS
918  GlobalPoint top_left_G;
919  GlobalPoint top_rightG;
920  GlobalPoint bot_left_G;
921  GlobalPoint bot_rightG;
922 
923  std::vector <bool> v_Fill;
924  v_Fill.push_back(false);
925  v_Fill.push_back(false);
926  v_Fill.push_back(false);
927  v_Fill.push_back(false);
928 
929  for (unsigned int i =0 ; i< v_Edge_G.size() ; i++){
930  if (v_Edge_G[i].eta() < clustgp.eta()){
931  if (v_Edge_G[i].phi() < clustgp.phi()) {
932  bot_left_G = v_Edge_G[i];
933  v_Fill[0] = true;
934  }
935  if (v_Edge_G[i].phi() > clustgp.phi()){
936  top_left_G = v_Edge_G[i];
937  v_Fill[1] = true;
938  }
939  }
940  if (v_Edge_G[i].eta() > clustgp.eta()){
941  if (v_Edge_G[i].phi() < clustgp.phi()){
942  bot_rightG = v_Edge_G[i];
943  v_Fill[2] = true;
944  }
945  if (v_Edge_G[i].phi() > clustgp.phi()){
946  top_rightG = v_Edge_G[i];
947  v_Fill[3] = true;
948  }
949  }
950  }
951 
952  //USE EDGES FOR COMPUTING WIDTH AND LENGTH
953 
954  float G_length = 0.;
955  float G_width = 0.;
956 
957  bool flag_border = false;
958 
959  if (v_Fill[0] == true
960  && v_Fill[1] == true
961  && v_Fill[2] == true
962  && v_Fill[3] == true){
963 
964  //LENGTH BETWEEN TL AND TR
965  G_length = sqrt( (top_left_G.x()-top_rightG.x())*(top_left_G.x()-top_rightG.x()) + (top_left_G.y()-top_rightG.y())*(top_left_G.y()-top_rightG.y()) + (top_left_G.z()-top_rightG.z())*(top_left_G.z()-top_rightG.z()) );
966 
967  //WIDTH BETWEEN BL AND TL
968  G_width = sqrt( (bot_left_G.x()-top_left_G.x())*(bot_left_G.x()-top_left_G.x()) + (bot_left_G.y()-top_left_G.y())*(bot_left_G.y()-top_left_G.y()) + (bot_left_G.z()-top_left_G.z())*(bot_left_G.z()-top_left_G.z()) );
969 
970  }
971  else {
972 
973  // MODULE IN THE PHI BORDER (-PI,PI)
974  flag_border = true;
975 
976  //SORT THE EDGES POINTS
977  for (unsigned int i =0 ; i< v_Edge_G.size() ; i++){
978 
979  if (v_Edge_G[i].phi() > 0. ){
980  if (v_Edge_G[i].eta() < clustgp.eta()){
981  bot_left_G = v_Edge_G[i];
982  }
983  if (v_Edge_G[i].eta() > clustgp.eta()){
984  bot_rightG = v_Edge_G[i];
985  }
986  }
987  if (v_Edge_G[i].phi() < 0. ){
988  if (v_Edge_G[i].eta() < clustgp.eta()){
989  top_left_G = v_Edge_G[i];
990  }
991  if (v_Edge_G[i].eta() > clustgp.eta()){
992  top_rightG = v_Edge_G[i];
993  }
994  }
995  }
996 
997  // XYZ WIDTH AND LENGTH
998  G_length = sqrt( (top_left_G.x()-top_rightG.x())*(top_left_G.x()-top_rightG.x()) + (top_left_G.y()-top_rightG.y())*(top_left_G.y()-top_rightG.y()) + (top_left_G.z()-top_rightG.z())*(top_left_G.z()-top_rightG.z()) );
999  G_width = G_length*ratio;
1000  }
1001 
1002 
1003  //ETA PLOTS
1004  //unsigned int LastBinEta = m_BinEta[mylabelHisto].size() - 2;
1005  for (unsigned int i = 0; i < m_BinEta[mylabelHisto].size() - 1; i++){
1006  if (m_BinEta[mylabelHisto][i] <= clustgp.eta() && clustgp.eta() < m_BinEta[mylabelHisto][i+1]){
1007 
1008  // NO NEED TO DO CORRECTIONS FOR ETA
1009  m_ModNormEta[mylabelHisto][i] = m_ModNormEta[mylabelHisto][i] + factor*G_length*G_width;
1010 
1011  }
1012  } //END ETA
1013 
1014  //PHI PLOTS
1015  unsigned int LastBinPhi = m_BinPhi[mylabelHisto].size() - 2;
1016  for (unsigned int i = 0; i < m_BinPhi[mylabelHisto].size() - 1; i++){
1017  if (m_BinPhi[mylabelHisto][i] <= clustgp.phi() && clustgp.phi() < m_BinPhi[mylabelHisto][i+1]){
1018 
1019  // SCRIPT TO INTEGRATE THE SURFACE INTO PHI BIN
1020 
1021  float phiMin = std::min(bot_left_G.phi(),bot_rightG.phi());
1022  float phiMax = std::max(top_left_G.phi(),top_rightG.phi());
1023 
1024  bool offlimit_prev = false;
1025  bool offlimit_foll = false;
1026 
1027  if (phiMin < m_BinPhi[mylabelHisto][i]) offlimit_prev = true;
1028  if (i != LastBinPhi){
1029  if (phiMax > m_BinPhi[mylabelHisto][i+1]) offlimit_foll = true;
1030  }
1031 
1032  //LOOKING FOR THE INTERSECTION POINTS
1033  float MidPoint_X_prev;
1034  float MidPoint_Y_prev;
1035  float MidPoint_Z_prev;
1036  float MidPoint_X_foll;
1037  float MidPoint_Y_foll;
1038  float MidPoint_Z_foll;
1039 
1040  // OFF LIMIT IN THE PREVIOUS BIN
1041  if (offlimit_prev){
1042 
1043  // BL TL
1044  float tStar1 = (m_BinPhi[mylabelHisto][i]-bot_left_G.phi())/(top_left_G.phi()-bot_left_G.phi());
1045 
1046  // BR TR
1047  float tStar2 = (m_BinPhi[mylabelHisto][i]-bot_rightG.phi())/(top_rightG.phi()-bot_rightG.phi());
1048 
1049  if (tStar1 < 0.) tStar1 = 0.;
1050  if (tStar2 < 0.) tStar2 = 0.;
1051 
1052  //FIND Z OF STAR POINT
1053  float xStar1 = bot_left_G.x() + (tStar1*1.)*(top_left_G.x()-bot_left_G.x());
1054  float xStar2 = bot_rightG.x() + (tStar2*1.)*(top_rightG.x()-bot_rightG.x());
1055 
1056  float yStar1 = bot_left_G.y() + (tStar1*1.)*(top_left_G.y()-bot_left_G.y());
1057  float yStar2 = bot_rightG.y() + (tStar2*1.)*(top_rightG.y()-bot_rightG.y());
1058 
1059  float zStar1 = bot_left_G.z() + (tStar1*1.)*(top_left_G.z()-bot_left_G.z());
1060  float zStar2 = bot_rightG.z() + (tStar2*1.)*(top_rightG.z()-bot_rightG.z());
1061 
1062  //MIDPOINT
1063  MidPoint_X_prev = (xStar1 + xStar2)/2.;
1064  MidPoint_Y_prev = (yStar1 + yStar2)/2.;
1065  MidPoint_Z_prev = (zStar1 + zStar2)/2.;
1066  }
1067 
1068  if (offlimit_prev == false){
1069  MidPoint_X_prev = (bot_left_G.x() + bot_rightG.x())/2.;
1070  MidPoint_Y_prev = (bot_left_G.y() + bot_rightG.y())/2.;
1071  MidPoint_Z_prev = (bot_left_G.z() + bot_rightG.z())/2.;
1072  }
1073 
1074  // OFF LIMIT IN THE FOLLOWING BIN
1075  if (offlimit_foll){
1076 
1077  // BL TL
1078  float tStar1 = (m_BinPhi[mylabelHisto][i+1]-bot_left_G.phi())/(top_left_G.phi()-bot_left_G.phi());
1079 
1080  // BR TR
1081  float tStar2 = (m_BinPhi[mylabelHisto][i+1]-bot_rightG.phi())/(top_rightG.phi()-bot_rightG.phi());
1082 
1083  if (tStar1 > 1.) tStar1 = 1.;
1084  if (tStar2 > 1.) tStar2 = 1.;
1085 
1086  //FIND Z OF STAR POINT
1087  float xStar1 = bot_left_G.x() + (tStar1*1.)*(top_left_G.x()-bot_left_G.x());
1088  float xStar2 = bot_rightG.x() + (tStar2*1.)*(top_rightG.x()-bot_rightG.x());
1089 
1090  float yStar1 = bot_left_G.y() + (tStar1*1.)*(top_left_G.y()-bot_left_G.y());
1091  float yStar2 = bot_rightG.y() + (tStar2*1.)*(top_rightG.y()-bot_rightG.y());
1092 
1093  float zStar1 = bot_left_G.z() + (tStar1*1.)*(top_left_G.z()-bot_left_G.z());
1094  float zStar2 = bot_rightG.z() + (tStar2*1.)*(top_rightG.z()-bot_rightG.z());
1095 
1096  //MIDPOINT
1097  MidPoint_X_foll = (xStar1 + xStar2)/2.;
1098  MidPoint_Y_foll = (yStar1 + yStar2)/2.;
1099  MidPoint_Z_foll = (zStar1 + zStar2)/2.;
1100  }
1101 
1102  if (offlimit_foll == false){
1103  MidPoint_X_foll = (top_left_G.x() + top_rightG.x())/2.;
1104  MidPoint_Y_foll = (top_left_G.y() + top_rightG.y())/2.;
1105  MidPoint_Z_foll = (top_left_G.z() + top_rightG.z())/2.;
1106  }
1107 
1108  //COMPUTE THE B AND T EDGES
1109  float EdgePoint_X_B = (bot_left_G.x() + bot_rightG.x())/2.;
1110  float EdgePoint_Y_B = (bot_left_G.y() + bot_rightG.y())/2.;
1111  float EdgePoint_Z_B = (bot_left_G.z() + bot_rightG.z())/2.;
1112 
1113  float EdgePoint_X_T = (top_left_G.x() + top_rightG.x())/2.;
1114  float EdgePoint_Y_T = (top_left_G.y() + top_rightG.y())/2.;
1115  float EdgePoint_Z_T = (top_left_G.z() + top_rightG.z())/2.;
1116  // FILL INSIDE WIDTH
1117  float G_width_Ins = sqrt( (MidPoint_X_foll-MidPoint_X_prev)*(MidPoint_X_foll-MidPoint_X_prev) + (MidPoint_Y_foll-MidPoint_Y_prev)*(MidPoint_Y_foll-MidPoint_Y_prev) + (MidPoint_Z_foll-MidPoint_Z_prev)*(MidPoint_Z_foll-MidPoint_Z_prev) );
1118 
1119  //IF BORDER
1120  if (flag_border){
1121 
1122  // A) 3 POINT AND 1 POINT
1123  if (i != 0 && i != LastBinPhi){
1124  m_ModNormPhi[mylabelHisto][i] = m_ModNormPhi[mylabelHisto][i] + factor*G_length*G_width;
1125  }
1126 
1127  // B) MODULE SPLITTED IN TWO
1128  if (i == 0 || i == LastBinPhi){
1129  float PhiBalance = 0.;
1130  if (clustgp.phi() > 0.) PhiBalance = clustgp.phi() - M_PI ;
1131  if (clustgp.phi() < 0.) PhiBalance = clustgp.phi() + M_PI ;
1132 
1133  // Average Phi width of a phi bin
1134  float Phi_Width = m_BinPhi[mylabelHisto][3] - m_BinPhi[mylabelHisto][2];
1135 
1136  float weight_FirstBin = (1.+ (PhiBalance/(Phi_Width/2.)))/2. ;
1137  float weight_LastBin = fabs(1. - weight_FirstBin);
1138 
1139  m_ModNormPhi[mylabelHisto][0] = m_ModNormPhi[mylabelHisto][0] + weight_FirstBin*(factor*G_length*G_width);
1140  m_ModNormPhi[mylabelHisto][LastBinPhi] = m_ModNormPhi[mylabelHisto][LastBinPhi] + weight_LastBin*(factor*G_length*G_width);
1141  }
1142  }
1143 
1144  if (flag_border == false){
1145 
1146  // A) SURFACE TOTALY CONTAINED IN THE BIN
1147  if (offlimit_prev == false && offlimit_foll == false){
1148  m_ModNormPhi[mylabelHisto][i] = m_ModNormPhi[mylabelHisto][i] + factor*G_length*G_width;
1149  }
1150 
1151  // B) SURFACE CONTAINED IN 2 BINS
1152  if ((offlimit_prev == true && offlimit_foll == false)
1153  ||(offlimit_prev == false && offlimit_foll == true) ){
1154  float G_width_Out = fabs(G_width - G_width_Ins);
1155 
1156  //FILL INSIDE CELL
1157  m_ModNormPhi[mylabelHisto][i] = m_ModNormPhi[mylabelHisto][i] + factor*G_width_Ins*G_length;
1158 
1159  //FILL OFF LIMITS CELLS
1160  if (offlimit_prev && i != 0) m_ModNormPhi[mylabelHisto][i-1] = m_ModNormPhi[mylabelHisto][i-1] + factor*G_width_Out*G_length;
1161  if (offlimit_foll && i != LastBinPhi) m_ModNormPhi[mylabelHisto][i+1] = m_ModNormPhi[mylabelHisto][i+1] + factor*G_width_Out*G_length;
1162  }
1163 
1164  // C) SURFACE CONTAINED IN 3 BINS
1165  if (offlimit_prev == true && offlimit_foll == true){
1166 
1167  //COMPUTE OFF LIMITS LENGTHS
1168  float G_width_T = sqrt( (MidPoint_X_foll-EdgePoint_X_T)*(MidPoint_X_foll-EdgePoint_X_T) + (MidPoint_Y_foll-EdgePoint_Y_T)*(MidPoint_Y_foll-EdgePoint_Y_T) + (MidPoint_Z_foll-EdgePoint_Z_T)*(MidPoint_Z_foll-EdgePoint_Z_T) );
1169  float G_width_B = sqrt( (MidPoint_X_prev-EdgePoint_X_B)*(MidPoint_X_prev-EdgePoint_X_B) + (MidPoint_Y_prev-EdgePoint_Y_B)*(MidPoint_Y_prev-EdgePoint_Y_B) + (MidPoint_Z_prev-EdgePoint_Z_B)*(MidPoint_Z_prev-EdgePoint_Z_B) );
1170 
1171  //FOR SAFETY
1172  if (i != 0 && i != LastBinPhi){
1173  //FILL INSIDE CELL
1174  m_ModNormPhi[mylabelHisto][i] = m_ModNormPhi[mylabelHisto][i] + factor*G_width_Ins*G_length;
1175 
1176  //FILL OFF LIMITS CELLS
1177  if (i != 0) m_ModNormPhi[mylabelHisto][i-1] = m_ModNormPhi[mylabelHisto][i-1] + factor*G_width_B*G_length;
1178  if (i != LastBinPhi) m_ModNormPhi[mylabelHisto][i+1] = m_ModNormPhi[mylabelHisto][i+1] + factor*G_width_T*G_length;
1179  }
1180 
1181  }
1182  }
1183  }
1184  } // END PHI
1185 
1186  } // END SISTRIP DETECTORS
1187 
1188  } // END DETID LOOP
1189 
1190  //PRINT NORMALIZATION IF ASKED
1191  if (printNormalize_) {
1192  TFile output("MuonHLTDQMNormalization.root","recreate");
1193  output.cd();
1194  PrintNormalization(v_LabelHisto);
1195  output.Close();
1196  }
1197 
1198 } //END METHOD
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
virtual const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
int i
Definition: DBlmapReader.cc:9
std::map< std::string, std::vector< float > > m_BinPhi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
TkLayerMap::XYbin cached_XYbin
T eta() const
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
std::string getLayerName(int &in) const
Definition: TkDetMap.cc:702
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
T min(T a, T b)
Definition: MathUtil.h:58
virtual float width() const
Width along local X.
#define M_PI
std::map< std::string, std::vector< float > > m_BinEta
std::map< std::string, std::vector< float > > m_ModNormPhi
virtual float widthAtHalfLength() const
void PrintNormalization(const std::vector< std::string > &v_LabelHisto)
T eta() const
Definition: PV3DBase.h:76
virtual float length() const
Lenght along local Y.
int16_t FindLayer(uint32_t &detid, uint32_t &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:664
Definition: Bounds.h:22
virtual float length() const
std::map< std::string, std::vector< float > > m_ModNormEta
virtual SubDetector subDetector() const
Which subdetector.
Definition: GeomDet.cc:49
T x() const
Definition: PV3DBase.h:62
virtual const TrackerGeomDet * idToDet(DetId) const
Definition: DDAxes.h:10
void SiStripMonitorMuonHLT::PrintNormalization ( const std::vector< std::string > &  v_LabelHisto)
private

Definition at line 1203 of file SiStripMonitorMuonHLT.cc.

References i, m_BinEta, m_BinPhi, m_ModNormEta, m_ModNormPhi, AlCaHLTBitMon_ParallelJobs::p, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by Normalizer().

1204 {
1205  std::vector <TH1F *> h_ModNorm_Eta;
1206  std::vector <TH1F *> h_ModNorm_Phi;
1207 
1208  for (unsigned int p = 0; p < v_LabelHisto.size(); p++){
1209 
1210  std::string titleHistoEta = v_LabelHisto[p] + "_eta" ;
1211  std::string titleHistoPhi = v_LabelHisto[p] + "_phi" ;
1212 
1213  std::string labelHisto = v_LabelHisto[p];
1214 
1215  float * xbinsPhi = new float[100];
1216  float * xbinsEta = new float[100];
1217 
1218  //CREATING XBIN VECTOR
1219  unsigned int sizePhi = m_BinPhi[labelHisto].size();
1220  for (unsigned int i = 0; i < sizePhi; i++){
1221  xbinsPhi[i] = m_BinPhi[labelHisto][i];
1222  }
1223  //CREATING XBIN VECTOR
1224  unsigned int sizeEta = m_BinEta[labelHisto].size();
1225  for (unsigned int i = 0; i < sizeEta; i++){
1226  xbinsEta[i] = m_BinEta[labelHisto][i];
1227  }
1228 
1229  h_ModNorm_Eta.push_back(new TH1F (titleHistoEta.c_str(),titleHistoEta.c_str(),sizeEta - 1,xbinsEta));
1230  h_ModNorm_Phi.push_back(new TH1F (titleHistoPhi.c_str(),titleHistoPhi.c_str(),sizePhi - 1,xbinsPhi));
1231 
1232  for (unsigned int i = 0; i < m_ModNormEta[labelHisto].size(); i++){
1233  (*h_ModNorm_Eta[p]).SetBinContent(i+1,m_ModNormEta[labelHisto][i]);
1234  }
1235  for (unsigned int i = 0; i < m_ModNormPhi[labelHisto].size(); i++){
1236  (*h_ModNorm_Phi[p]).SetBinContent(i+1,m_ModNormPhi[labelHisto][i]);
1237  }
1238 
1239  (*h_ModNorm_Eta[p]).Write();
1240  (*h_ModNorm_Phi[p]).Write();
1241  }
1242 
1243 }
int i
Definition: DBlmapReader.cc:9
std::map< std::string, std::vector< float > > m_BinPhi
std::map< std::string, std::vector< float > > m_BinEta
std::map< std::string, std::vector< float > > m_ModNormPhi
std::map< std::string, std::vector< float > > m_ModNormEta

Member Data Documentation

uint32_t SiStripMonitorMuonHLT::cached_detid
private
int16_t SiStripMonitorMuonHLT::cached_layer
private
TkLayerMap::XYbin SiStripMonitorMuonHLT::cached_XYbin
private
edm::InputTag SiStripMonitorMuonHLT::clusterCollectionTag_
private

Definition at line 133 of file SiStripMonitorMuonHLT.h.

Referenced by SiStripMonitorMuonHLT().

edm::EDGetTokenT<edm::LazyGetter < SiStripCluster > > SiStripMonitorMuonHLT::clusterCollectionToken_
private

Definition at line 137 of file SiStripMonitorMuonHLT.h.

Referenced by analyze(), and SiStripMonitorMuonHLT().

int SiStripMonitorMuonHLT::counterEvt_
private

Definition at line 120 of file SiStripMonitorMuonHLT.h.

Referenced by analyze(), and endJob().

int SiStripMonitorMuonHLT::HistoNumber
private

Definition at line 143 of file SiStripMonitorMuonHLT.h.

Referenced by createMEs(), and SiStripMonitorMuonHLT().

edm::InputTag SiStripMonitorMuonHLT::l3collectionTag_
private

Definition at line 134 of file SiStripMonitorMuonHLT.h.

Referenced by SiStripMonitorMuonHLT().

edm::EDGetTokenT<reco::RecoChargedCandidateCollection> SiStripMonitorMuonHLT::l3collectionToken_
private

Definition at line 138 of file SiStripMonitorMuonHLT.h.

Referenced by analyze(), and SiStripMonitorMuonHLT().

std::map<std::string, LayerMEs> SiStripMonitorMuonHLT::LayerMEMap
private

Definition at line 148 of file SiStripMonitorMuonHLT.h.

Referenced by analyze(), analyzeOnTrackClusters(), and createMEs().

std::map<std::string,std::vector<float> > SiStripMonitorMuonHLT::m_BinEta
private

Definition at line 157 of file SiStripMonitorMuonHLT.h.

Referenced by createMEs(), GetEtaWeight(), Normalizer(), and PrintNormalization().

std::map<std::string,std::vector<float> > SiStripMonitorMuonHLT::m_BinPhi
private
std::map<std::string,std::vector<float> > SiStripMonitorMuonHLT::m_ModNormEta
private

Definition at line 159 of file SiStripMonitorMuonHLT.h.

Referenced by GetEtaWeight(), Normalizer(), and PrintNormalization().

std::map<std::string,std::vector<float> > SiStripMonitorMuonHLT::m_ModNormPhi
private

Definition at line 158 of file SiStripMonitorMuonHLT.h.

Referenced by GetPhiWeight(), Normalizer(), and PrintNormalization().

std::string SiStripMonitorMuonHLT::monitorName_
private

Definition at line 118 of file SiStripMonitorMuonHLT.h.

Referenced by bookHistograms(), createMEs(), and SiStripMonitorMuonHLT().

bool SiStripMonitorMuonHLT::normalize_
private

Definition at line 124 of file SiStripMonitorMuonHLT.h.

Referenced by analyze(), analyzeOnTrackClusters(), and SiStripMonitorMuonHLT().

int SiStripMonitorMuonHLT::nTrig_
private

counter

Definition at line 121 of file SiStripMonitorMuonHLT.h.

std::string SiStripMonitorMuonHLT::outputFile_
private

Definition at line 119 of file SiStripMonitorMuonHLT.h.

Referenced by SiStripMonitorMuonHLT().

edm::ParameterSet SiStripMonitorMuonHLT::parameters_
private
int SiStripMonitorMuonHLT::prescaleEvt_
private

mutriggered events

Definition at line 122 of file SiStripMonitorMuonHLT.h.

Referenced by analyze(), bookHistograms(), and SiStripMonitorMuonHLT().

bool SiStripMonitorMuonHLT::printNormalize_
private

Definition at line 125 of file SiStripMonitorMuonHLT.h.

Referenced by Normalizer(), and SiStripMonitorMuonHLT().

bool SiStripMonitorMuonHLT::runOnClusters_
private

Definition at line 128 of file SiStripMonitorMuonHLT.h.

Referenced by analyze(), bookHistograms(), createMEs(), and SiStripMonitorMuonHLT().

bool SiStripMonitorMuonHLT::runOnMuonCandidates_
private

Definition at line 129 of file SiStripMonitorMuonHLT.h.

Referenced by analyze(), bookHistograms(), createMEs(), and SiStripMonitorMuonHLT().

bool SiStripMonitorMuonHLT::runOnTracks_
private

Definition at line 130 of file SiStripMonitorMuonHLT.h.

Referenced by analyze(), bookHistograms(), createMEs(), and SiStripMonitorMuonHLT().

TkDetMap* SiStripMonitorMuonHLT::tkdetmap_
private
TkHistoMap* SiStripMonitorMuonHLT::tkmapAllClusters
private

Definition at line 150 of file SiStripMonitorMuonHLT.h.

Referenced by analyze(), and bookHistograms().

TkHistoMap* SiStripMonitorMuonHLT::tkmapL3MuTrackClusters
private

Definition at line 152 of file SiStripMonitorMuonHLT.h.

Referenced by analyzeOnTrackClusters(), and bookHistograms().

TkHistoMap* SiStripMonitorMuonHLT::tkmapOnTrackClusters
private

Definition at line 151 of file SiStripMonitorMuonHLT.h.

Referenced by analyzeOnTrackClusters(), and bookHistograms().

edm::InputTag SiStripMonitorMuonHLT::TrackCollectionTag_
private

Definition at line 135 of file SiStripMonitorMuonHLT.h.

Referenced by SiStripMonitorMuonHLT().

edm::EDGetTokenT<reco::TrackCollection> SiStripMonitorMuonHLT::TrackCollectionToken_
private

Definition at line 139 of file SiStripMonitorMuonHLT.h.

Referenced by analyze(), and SiStripMonitorMuonHLT().

bool SiStripMonitorMuonHLT::verbose_
private

every n events

Definition at line 123 of file SiStripMonitorMuonHLT.h.

Referenced by SiStripMonitorMuonHLT().