CMS 3D CMS Logo

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

#include <GlobalRecHitsAnalyzer.h>

Inheritance diagram for GlobalRecHitsAnalyzer:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Types

typedef std::map< uint32_t,
float, std::less< uint32_t > > 
MapType
 
- 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 Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
 GlobalRecHitsAnalyzer (const edm::ParameterSet &)
 
virtual ~GlobalRecHitsAnalyzer ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 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
 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 ()
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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)
 

Private Member Functions

template<typename type >
int compute (const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit > > &simHitsPerWire, const std::map< DTWireId, std::vector< type > > &recHitsPerWire, int step)
 
void fillECal (const edm::Event &, const edm::EventSetup &)
 
void fillHCal (const edm::Event &, const edm::EventSetup &)
 
void fillMuon (const edm::Event &, const edm::EventSetup &)
 
void fillTrk (const edm::Event &, const edm::EventSetup &)
 
template<typename type >
const typefindBestRecHit (const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
 
std::map< DTWireId,
std::vector< DTRecHit1DPair > > 
map1DRecHitsPerWire (const DTRecHitCollection *dt1DRecHitPairs)
 
void plotResolution (const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
 
std::pair< LocalPoint,
LocalVector
projectHit (const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
 
float recHitDistFromWire (const DTRecHit1DPair &hitPair, const DTLayer *layer)
 
float recHitDistFromWire (const DTRecHit1D &recHit, const DTLayer *layer)
 
float simHitDistFromWire (const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
 

Private Attributes

edm::ParameterSet conf_
 
unsigned int count
 
edm::EDGetTokenT
< CrossingFrame< PCaloHit > > 
EBHits_Token_
 
edm::InputTag ECalEBSrc_
 
edm::EDGetTokenT
< EBRecHitCollection
ECalEBSrc_Token_
 
edm::InputTag ECalEESrc_
 
edm::EDGetTokenT
< EERecHitCollection
ECalEESrc_Token_
 
edm::InputTag ECalESSrc_
 
edm::EDGetTokenT
< ESRecHitCollection
ECalESSrc_Token_
 
edm::InputTag ECalUncalEBSrc_
 
edm::EDGetTokenT
< EBUncalibratedRecHitCollection
ECalUncalEBSrc_Token_
 
edm::InputTag ECalUncalEESrc_
 
edm::EDGetTokenT
< EEUncalibratedRecHitCollection
ECalUncalEESrc_Token_
 
edm::EDGetTokenT
< CrossingFrame< PCaloHit > > 
EEHits_Token_
 
edm::EDGetTokenT
< CrossingFrame< PCaloHit > > 
ESHits_Token_
 
std::string fName
 
int frequency
 
bool getAllProvenances
 
edm::InputTag HCalSrc_
 
edm::EDGetTokenT
< edm::PCaloHitContainer
HCalSrc_Token_
 
std::string hitsProducer
 
std::string label
 
std::vector< PSimHitmatched
 
MonitorElementmehCSCn
 
MonitorElementmehCSCResRDPhi
 
MonitorElementmehDtMuonn
 
MonitorElementmehDtMuonRes
 
MonitorElementmehEcaln [3]
 
MonitorElementmehEcalRes [3]
 
MonitorElementmehHcaln [4]
 
MonitorElementmehHcalRes [4]
 
MonitorElementmehRPCn
 
MonitorElementmehRPCResX
 
MonitorElementmehSiPixeln [7]
 
MonitorElementmehSiPixelResX [7]
 
MonitorElementmehSiPixelResY [7]
 
MonitorElementmehSiStripn [19]
 
MonitorElementmehSiStripResX [19]
 
MonitorElementmehSiStripResY [19]
 
edm::EDGetTokenT
< CrossingFrame< PSimHit > > 
MuCSCHits_Token_
 
edm::InputTag MuCSCSrc_
 
edm::EDGetTokenT
< CSCRecHit2DCollection
MuCSCSrc_Token_
 
edm::InputTag MuDTSimSrc_
 
edm::EDGetTokenT
< edm::PSimHitContainer
MuDTSimSrc_Token_
 
edm::InputTag MuDTSrc_
 
edm::EDGetTokenT
< DTRecHitCollection
MuDTSrc_Token_
 
edm::InputTag MuRPCSimSrc_
 
edm::EDGetTokenT
< edm::PSimHitContainer
MuRPCSimSrc_Token_
 
edm::InputTag MuRPCSrc_
 
edm::EDGetTokenT
< RPCRecHitCollection
MuRPCSrc_Token_
 
bool printProvenanceInfo
 
edm::InputTag SiPxlSrc_
 
edm::EDGetTokenT
< SiPixelRecHitCollection
SiPxlSrc_Token_
 
edm::InputTag SiStripSrc_
 
edm::EDGetTokenT
< SiStripMatchedRecHit2DCollection
SiStripSrc_Token_
 
std::map< int,
edm::PSimHitContainer
theMap
 
int verbosity
 

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)
 

Detailed Description

Definition at line 142 of file GlobalRecHitsAnalyzer.h.

Member Typedef Documentation

typedef std::map<uint32_t,float,std::less<uint32_t> > GlobalRecHitsAnalyzer::MapType

Definition at line 147 of file GlobalRecHitsAnalyzer.h.

Constructor & Destructor Documentation

GlobalRecHitsAnalyzer::GlobalRecHitsAnalyzer ( const edm::ParameterSet iPSet)
explicit

Definition at line 16 of file GlobalRecHitsAnalyzer.cc.

References conf_, EBHits_Token_, ECalEBSrc_, ECalEBSrc_Token_, ECalEESrc_, ECalEESrc_Token_, ECalESSrc_, ECalESSrc_Token_, ECalUncalEBSrc_, ECalUncalEBSrc_Token_, ECalUncalEESrc_, ECalUncalEESrc_Token_, EEHits_Token_, ESHits_Token_, fName, frequency, getAllProvenances, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HCalSrc_, HCalSrc_Token_, hitsProducer, HLT_25ns14e33_v1_cff::InputTag, edm::InputTag::instance(), edm::InputTag::label(), MuCSCHits_Token_, MuCSCSrc_, MuCSCSrc_Token_, MuDTSimSrc_, MuDTSimSrc_Token_, MuDTSrc_, MuDTSrc_Token_, MuRPCSimSrc_, MuRPCSimSrc_Token_, MuRPCSrc_, MuRPCSrc_Token_, printProvenanceInfo, SiPxlSrc_, SiPxlSrc_Token_, SiStripSrc_, SiStripSrc_Token_, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

16  :
17  fName(""), verbosity(0), frequency(0), label(""), getAllProvenances(false),
18  printProvenanceInfo(false), count(0)
19 {
20  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_GlobalRecHitsAnalyzer";
21 
22  // get information from parameter set
23  fName = iPSet.getUntrackedParameter<std::string>("Name");
24  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
25  frequency = iPSet.getUntrackedParameter<int>("Frequency");
26  edm::ParameterSet m_Prov =
27  iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
29  m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
31  m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
32  hitsProducer = iPSet.getParameter<std::string>("hitsProducer");
33 
34  //get Labels to use to extract information
35  ECalEBSrc_ = iPSet.getParameter<edm::InputTag>("ECalEBSrc");
36  ECalUncalEBSrc_ = iPSet.getParameter<edm::InputTag>("ECalUncalEBSrc");
37  ECalEESrc_ = iPSet.getParameter<edm::InputTag>("ECalEESrc");
38  ECalUncalEESrc_ = iPSet.getParameter<edm::InputTag>("ECalUncalEESrc");
39  ECalESSrc_ = iPSet.getParameter<edm::InputTag>("ECalESSrc");
40  HCalSrc_ = iPSet.getParameter<edm::InputTag>("HCalSrc");
41  SiStripSrc_ = iPSet.getParameter<edm::InputTag>("SiStripSrc");
42  SiPxlSrc_ = iPSet.getParameter<edm::InputTag>("SiPxlSrc");
43  MuDTSrc_ = iPSet.getParameter<edm::InputTag>("MuDTSrc");
44  MuDTSimSrc_ = iPSet.getParameter<edm::InputTag>("MuDTSimSrc");
45  MuCSCSrc_ = iPSet.getParameter<edm::InputTag>("MuCSCSrc");
46  MuRPCSrc_ = iPSet.getParameter<edm::InputTag>("MuRPCSrc");
47  MuRPCSimSrc_ = iPSet.getParameter<edm::InputTag>("MuRPCSimSrc");
48 
49  conf_ = iPSet;
50 
51  // fix for consumes
52  ECalUncalEBSrc_Token_ = consumes<EBUncalibratedRecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalUncalEBSrc"));
53  ECalUncalEESrc_Token_ = consumes<EEUncalibratedRecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalUncalEESrc"));
54  ECalEBSrc_Token_ = consumes<EBRecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalEBSrc"));
55  ECalEESrc_Token_ = consumes<EERecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalEESrc"));
56  ECalESSrc_Token_ = consumes<ESRecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalESSrc"));
57  HCalSrc_Token_ = consumes<edm::PCaloHitContainer>(iPSet.getParameter<edm::InputTag>("HCalSrc"));
58  SiStripSrc_Token_ = consumes<SiStripMatchedRecHit2DCollection>(iPSet.getParameter<edm::InputTag>("SiStripSrc"));
59  SiPxlSrc_Token_ = consumes<SiPixelRecHitCollection>(iPSet.getParameter<edm::InputTag>("SiPxlSrc"));
60 
61  MuDTSrc_Token_ = consumes<DTRecHitCollection>(iPSet.getParameter<edm::InputTag>("MuDTSrc"));
62  MuDTSimSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("MuDTSimSrc"));
63 
64  MuCSCSrc_Token_ = consumes<CSCRecHit2DCollection>(iPSet.getParameter<edm::InputTag>("MuCSCSrc"));
65  MuCSCHits_Token_ = consumes<CrossingFrame<PSimHit>>(edm::InputTag(std::string("mix"), iPSet.getParameter<std::string>("hitsProducer") + std::string("MuonCSCHits")));
66 
67  MuRPCSrc_Token_ = consumes<RPCRecHitCollection>(iPSet.getParameter<edm::InputTag>("MuRPCSrc"));
68  MuRPCSimSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("MuRPCSimSrc"));
69 
70  EBHits_Token_ = consumes<CrossingFrame<PCaloHit> >(edm::InputTag(std::string("mix"), iPSet.getParameter<std::string>("hitsProducer") + std::string("EcalHitsEB")));
71  EEHits_Token_ = consumes<CrossingFrame<PCaloHit> >(edm::InputTag(std::string("mix"), iPSet.getParameter<std::string>("hitsProducer") + std::string("EcalHitsEE")));
72  ESHits_Token_ = consumes<CrossingFrame<PCaloHit> >(edm::InputTag(std::string("mix"), iPSet.getParameter<std::string>("hitsProducer") + std::string("EcalHitsES")));
73 
74  // use value of first digit to determine default output level (inclusive)
75  // 0 is none, 1 is basic, 2 is fill output, 3 is gather output
76  verbosity %= 10;
77 
78  // create persistent object
79  // produces<PGlobalRecHit>(label);
80 
81  // print out Parameter Set information being used
82  if (verbosity >= 0) {
83  edm::LogInfo(MsgLoggerCat)
84  << "\n===============================\n"
85  << "Initialized as EDProducer with parameter values:\n"
86  << " Name = " << fName << "\n"
87  << " Verbosity = " << verbosity << "\n"
88  << " Frequency = " << frequency << "\n"
89  << " GetProv = " << getAllProvenances << "\n"
90  << " PrintProv = " << printProvenanceInfo << "\n"
91  << " ECalEBSrc = " << ECalEBSrc_.label()
92  << ":" << ECalEBSrc_.instance() << "\n"
93  << " ECalUncalEBSrc = " << ECalUncalEBSrc_.label()
94  << ":" << ECalUncalEBSrc_.instance() << "\n"
95  << " ECalEESrc = " << ECalEESrc_.label()
96  << ":" << ECalUncalEESrc_.instance() << "\n"
97  << " ECalUncalEESrc = " << ECalUncalEESrc_.label()
98  << ":" << ECalEESrc_.instance() << "\n"
99  << " ECalESSrc = " << ECalESSrc_.label()
100  << ":" << ECalESSrc_.instance() << "\n"
101  << " HCalSrc = " << HCalSrc_.label()
102  << ":" << HCalSrc_.instance() << "\n"
103  << " SiStripSrc = " << SiStripSrc_.label()
104  << ":" << SiStripSrc_.instance() << "\n"
105  << " SiPixelSrc = " << SiPxlSrc_.label()
106  << ":" << SiPxlSrc_.instance() << "\n"
107  << " MuDTSrc = " << MuDTSrc_.label()
108  << ":" << MuDTSrc_.instance() << "\n"
109  << " MuDTSimSrc = " << MuDTSimSrc_.label()
110  << ":" << MuDTSimSrc_.instance() << "\n"
111  << " MuCSCSrc = " << MuCSCSrc_.label()
112  << ":" << MuCSCSrc_.instance() << "\n"
113  << " MuRPCSrc = " << MuRPCSrc_.label()
114  << ":" << MuRPCSrc_.instance() << "\n"
115  << " MuRPCSimSrc = " << MuRPCSimSrc_.label()
116  << ":" << MuRPCSimSrc_.instance() << "\n"
117  << "===============================\n";
118  }
119 }
edm::EDGetTokenT< SiPixelRecHitCollection > SiPxlSrc_Token_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< EBRecHitCollection > ECalEBSrc_Token_
edm::EDGetTokenT< ESRecHitCollection > ECalESSrc_Token_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuCSCHits_Token_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
edm::EDGetTokenT< edm::PSimHitContainer > MuDTSimSrc_Token_
edm::EDGetTokenT< EBUncalibratedRecHitCollection > ECalUncalEBSrc_Token_
edm::EDGetTokenT< CSCRecHit2DCollection > MuCSCSrc_Token_
edm::EDGetTokenT< RPCRecHitCollection > MuRPCSrc_Token_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
std::string const & label() const
Definition: InputTag.h:42
edm::EDGetTokenT< DTRecHitCollection > MuDTSrc_Token_
edm::EDGetTokenT< EEUncalibratedRecHitCollection > ECalUncalEESrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > MuRPCSimSrc_Token_
std::string const & instance() const
Definition: InputTag.h:43
edm::EDGetTokenT< EERecHitCollection > ECalEESrc_Token_
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > SiStripSrc_Token_
GlobalRecHitsAnalyzer::~GlobalRecHitsAnalyzer ( )
virtual

Definition at line 121 of file GlobalRecHitsAnalyzer.cc.

121 {}

Member Function Documentation

void GlobalRecHitsAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 291 of file GlobalRecHitsAnalyzer.cc.

References count, edm::EventID::event(), fillECal(), fillHCal(), fillMuon(), fillTrk(), frequency, edm::Event::getAllProvenance(), getAllProvenances, i, edm::EventBase::id(), nevt, printProvenanceInfo, edm::EventID::run(), AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

293 {
294  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_analyze";
295 
296  // keep track of number of events processed
297  ++count;
298 
299  // get event id information
300  edm::RunNumber_t nrun = iEvent.id().run();
301  edm::EventNumber_t nevt = iEvent.id().event();
302 
303  if (verbosity > 0) {
304  edm::LogInfo(MsgLoggerCat)
305  << "Processing run " << nrun << ", event " << nevt
306  << " (" << count << " events total)";
307  } else if (verbosity == 0) {
308  if (nevt%frequency == 0 || nevt == 1) {
309  edm::LogInfo(MsgLoggerCat)
310  << "Processing run " << nrun << ", event " << nevt
311  << " (" << count << " events total)";
312  }
313  }
314 
315  // look at information available in the event
316  if (getAllProvenances) {
317 
318  std::vector<const edm::Provenance*> AllProv;
319  iEvent.getAllProvenance(AllProv);
320 
321  if (verbosity >= 0)
322  edm::LogInfo(MsgLoggerCat)
323  << "Number of Provenances = " << AllProv.size();
324 
325  if (printProvenanceInfo && (verbosity >= 0)) {
326  TString eventout("\nProvenance info:\n");
327 
328  for (unsigned int i = 0; i < AllProv.size(); ++i) {
329  eventout += "\n ******************************";
330  eventout += "\n Module : ";
331  eventout += AllProv[i]->moduleLabel();
332  eventout += "\n ProductID : ";
333  eventout += AllProv[i]->productID().id();
334  eventout += "\n ClassName : ";
335  eventout += AllProv[i]->className();
336  eventout += "\n InstanceName : ";
337  eventout += AllProv[i]->productInstanceName();
338  eventout += "\n BranchName : ";
339  eventout += AllProv[i]->branchName();
340  }
341  eventout += "\n ******************************\n";
342  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
343  printProvenanceInfo = false;
344  }
345  getAllProvenances = false;
346  }
347 
348  // call fill functions
349  // gather Ecal information from event
350  fillECal(iEvent, iSetup);
351  // gather Hcal information from event
352  fillHCal(iEvent, iSetup);
353  // gather Track information from event
354  fillTrk(iEvent, iSetup);
355  // gather Muon information from event
356  fillMuon(iEvent, iSetup);
357 
358  if (verbosity > 0)
359  edm::LogInfo (MsgLoggerCat)
360  << "Done gathering data from event.";
361 
362  return;
363 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Event.cc:83
int i
Definition: DBlmapReader.cc:9
void fillMuon(const edm::Event &, const edm::EventSetup &)
unsigned long long EventNumber_t
void fillTrk(const edm::Event &, const edm::EventSetup &)
edm::EventID id() const
Definition: EventBase.h:60
void fillECal(const edm::Event &, const edm::EventSetup &)
unsigned int RunNumber_t
void fillHCal(const edm::Event &, const edm::EventSetup &)
void GlobalRecHitsAnalyzer::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 123 of file GlobalRecHitsAnalyzer.cc.

References DQMStore::IBooker::book1D(), i, j, mehCSCn, mehCSCResRDPhi, mehDtMuonn, mehDtMuonRes, mehEcaln, mehEcalRes, mehHcaln, mehHcalRes, mehRPCn, mehRPCResX, mehSiPixeln, mehSiPixelResX, mehSiPixelResY, mehSiStripn, mehSiStripResX, mehSiStripResY, MonitorElement::setAxisTitle(), and DQMStore::IBooker::setCurrentFolder().

123  {
124  // Si Strip
125  string SiStripString[19] = {"TECW1", "TECW2", "TECW3", "TECW4", "TECW5",
126  "TECW6", "TECW7", "TECW8", "TIBL1", "TIBL2",
127  "TIBL3", "TIBL4", "TIDW1", "TIDW2", "TIDW3",
128  "TOBL1", "TOBL2", "TOBL3", "TOBL4"};
129  for(int i = 0; i<19; ++i) {
130  mehSiStripn[i]=0;
131  mehSiStripResX[i]=0;
132  mehSiStripResY[i]=0;
133  }
134  string hcharname, hchartitle;
135  iBooker.setCurrentFolder("GlobalRecHitsV/SiStrips");
136  for(int amend = 0; amend < 19; ++amend) {
137  hcharname = "hSiStripn_"+SiStripString[amend];
138  hchartitle= SiStripString[amend]+" rechits";
139  mehSiStripn[amend] = iBooker.book1D(hcharname,hchartitle,200,0.,200.);
140  mehSiStripn[amend]->setAxisTitle("Number of hits in "+
141  SiStripString[amend],1);
142  mehSiStripn[amend]->setAxisTitle("Count",2);
143  hcharname = "hSiStripResX_"+SiStripString[amend];
144  hchartitle= SiStripString[amend]+" rechit x resolution";
145  mehSiStripResX[amend] = iBooker.book1D(hcharname,hchartitle,200,-0.02,.02);
146  mehSiStripResX[amend]->setAxisTitle("X-resolution in "
147  +SiStripString[amend],1);
148  mehSiStripResX[amend]->setAxisTitle("Count",2);
149  hcharname = "hSiStripResY_"+SiStripString[amend];
150  hchartitle= SiStripString[amend]+" rechit y resolution";
151  mehSiStripResY[amend] = iBooker.book1D(hcharname,hchartitle,200,-0.02,.02);
152  mehSiStripResY[amend]->setAxisTitle("Y-resolution in "+
153  SiStripString[amend],1);
154  mehSiStripResY[amend]->setAxisTitle("Count",2);
155  }
156 
157 
158  //HCal
159  //string hcharname, hchartitle;
160  string HCalString[4]={"HB", "HE", "HF", "HO"};
161  float HCalnUpper[4]={3000.,3000.,3000.,3000.};
162  float HCalnLower[4]={0.,0.,0.,0.};
163  for(int j =0; j <4; ++j) {
164  mehHcaln[j]=0;
165  mehHcalRes[j]=0;
166  }
167 
168  iBooker.setCurrentFolder("GlobalRecHitsV/HCals");
169  for(int amend = 0; amend < 4; ++amend) {
170  hcharname = "hHcaln_"+HCalString[amend];
171  hchartitle= HCalString[amend]+" rechits";
172  mehHcaln[amend] = iBooker.book1D(hcharname,hchartitle, 1000, HCalnLower[amend],
173  HCalnUpper[amend]);
174  mehHcaln[amend]->setAxisTitle("Number of RecHits",1);
175  mehHcaln[amend]->setAxisTitle("Count",2);
176  hcharname = "hHcalRes_"+HCalString[amend];
177  hchartitle= HCalString[amend]+" rechit resolution";
178  mehHcalRes[amend] = iBooker.book1D(hcharname,hchartitle, 25, -2., 2.);
179  mehHcalRes[amend]->setAxisTitle("RecHit E - SimHit E",1);
180  mehHcalRes[amend]->setAxisTitle("Count",2);
181  }
182 
183 
184  //Ecal
185  string ECalString[3] = {"EB","EE", "ES"};
186  int ECalnBins[3] = {1000,3000,150};
187  float ECalnUpper[3] = {20000., 62000., 3000.};
188  float ECalnLower[3] = {0., 0., 0.};
189  int ECalResBins[3] = {200,200,200};
190  float ECalResUpper[3] = {1., 0.3, .0002};
191  float ECalResLower[3] = {-1., -0.3, -.0002};
192  for(int i =0; i<3; ++i) {
193  mehEcaln[i]=0;
194  mehEcalRes[i]=0;
195  }
196  iBooker.setCurrentFolder("GlobalRecHitsV/ECals");
197 
198  for(int amend = 0; amend < 3; ++amend) {
199  hcharname = "hEcaln_"+ECalString[amend];
200  hchartitle= ECalString[amend]+" rechits";
201  mehEcaln[amend] = iBooker.book1D(hcharname,hchartitle, ECalnBins[amend],
202  ECalnLower[amend], ECalnUpper[amend]);
203  mehEcaln[amend]->setAxisTitle("Number of RecHits",1);
204  mehEcaln[amend]->setAxisTitle("Count",2);
205  hcharname = "hEcalRes_"+ECalString[amend];
206  hchartitle= ECalString[amend]+" rechit resolution";
207  mehEcalRes[amend] = iBooker.book1D(hcharname,hchartitle,ECalResBins[amend],
208  ECalResLower[amend],
209  ECalResUpper[amend]);
210  mehEcalRes[amend]->setAxisTitle("RecHit E - SimHit E",1);
211  mehEcalRes[amend]->setAxisTitle("Count",2);
212  }
213 
214  //Si Pixels
215  string SiPixelString[7] = {"BRL1", "BRL2", "BRL3", "FWD1n", "FWD1p",
216  "FWD2n", "FWD2p"};
217  for(int j =0; j<7; ++j) {
218  mehSiPixeln[j]=0;
219  mehSiPixelResX[j]=0;
220  mehSiPixelResY[j]=0;
221  }
222 
223  iBooker.setCurrentFolder("GlobalRecHitsV/SiPixels");
224  for(int amend = 0; amend < 7; ++amend) {
225  hcharname = "hSiPixeln_"+SiPixelString[amend];
226  hchartitle= SiPixelString[amend]+" rechits";
227  mehSiPixeln[amend] = iBooker.book1D(hcharname,hchartitle,200,0.,200.);
228  mehSiPixeln[amend]->setAxisTitle("Number of hits in "+
229  SiPixelString[amend],1);
230  mehSiPixeln[amend]->setAxisTitle("Count",2);
231  hcharname = "hSiPixelResX_"+SiPixelString[amend];
232  hchartitle= SiPixelString[amend]+" rechit x resolution";
233  mehSiPixelResX[amend] = iBooker.book1D(hcharname,hchartitle,200,-0.02,.02);
234  mehSiPixelResX[amend]->setAxisTitle("X-resolution in "+
235  SiPixelString[amend],1);
236  mehSiPixelResX[amend]->setAxisTitle("Count",2);
237  hcharname = "hSiPixelResY_"+SiPixelString[amend];
238  hchartitle= SiPixelString[amend]+" rechit y resolution";
239 
240  mehSiPixelResY[amend] = iBooker.book1D(hcharname,hchartitle,200,-0.02,.02);
241  mehSiPixelResY[amend]->setAxisTitle("Y-resolution in "+
242  SiPixelString[amend],1);
243  mehSiPixelResY[amend]->setAxisTitle("Count",2);
244  }
245 
246  //Muons
247  iBooker.setCurrentFolder("GlobalRecHitsV/Muons");
248 
249  mehDtMuonn = 0;
250  mehCSCn = 0;
251  mehRPCn = 0;
252 
253  string n_List[3] = {"hDtMuonn", "hCSCn", "hRPCn"};
254  string hist_string[3] = {"Dt", "CSC", "RPC"};
255 
256  for(int amend=0; amend<3; ++amend) {
257  hchartitle = hist_string[amend]+" rechits";
258  if(amend==0) {
259  mehDtMuonn=iBooker.book1D(n_List[amend],hchartitle,50, 0., 500.);
260  mehDtMuonn->setAxisTitle("Number of Rechits",1);
261  mehDtMuonn->setAxisTitle("Count",2);
262  }
263  if(amend==1) {
264  mehCSCn=iBooker.book1D(n_List[amend],hchartitle,50, 0., 500.);
265  mehCSCn->setAxisTitle("Number of Rechits",1);
266  mehCSCn->setAxisTitle("Count",2);
267  }
268  if(amend==2){
269  mehRPCn=iBooker.book1D(n_List[amend],hchartitle,50, 0., 500.);
270  mehRPCn->setAxisTitle("Number of Rechits",1);
271  mehRPCn->setAxisTitle("Count",2);
272  }
273  }
274 
275  mehDtMuonRes=0;
276  mehCSCResRDPhi=0;
277  mehRPCResX=0;
278 
279  hcharname = "hDtMuonRes";
280  hchartitle = "DT wire distance resolution";
281  mehDtMuonRes = iBooker.book1D(hcharname, hchartitle, 200, -0.2, 0.2);
282  hcharname = "CSCResRDPhi";
283  hchartitle = "CSC perp*dphi resolution";
284  mehCSCResRDPhi = iBooker.book1D(hcharname, hchartitle, 200, -0.2, 0.2);
285  hcharname = "hRPCResX";
286  hchartitle = "RPC rechits x resolution";
287  mehRPCResX = iBooker.book1D(hcharname, hchartitle, 50, -5., 5.);
288 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * mehCSCResRDPhi
MonitorElement * mehHcalRes[4]
MonitorElement * mehEcalRes[3]
MonitorElement * mehSiStripn[19]
MonitorElement * mehSiPixelResX[7]
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
int j
Definition: DBlmapReader.cc:9
MonitorElement * mehEcaln[3]
MonitorElement * mehSiPixelResY[7]
MonitorElement * mehSiStripResY[19]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * mehSiPixeln[7]
MonitorElement * mehHcaln[4]
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * mehSiStripResX[19]
template<typename type >
int GlobalRecHitsAnalyzer::compute ( const DTGeometry dtGeom,
const std::map< DTWireId, std::vector< PSimHit > > &  simHitsPerWire,
const std::map< DTWireId, std::vector< type > > &  recHitsPerWire,
int  step 
)
private

Definition at line 1613 of file GlobalRecHitsAnalyzer.cc.

References MonitorElement::Fill(), findBestRecHit(), DTHitQualityUtils::findMuSimHit(), DTGeometry::layer(), python.multivaluedict::map(), mehDtMuonRes, recHitDistFromWire(), HLT_25ns14e33_v3_cff::recHits, and simHitDistFromWire().

Referenced by fillMuon().

1618  {
1619 
1620 std::map<DTWireId, std::vector<PSimHit> > simHitsPerWire = _simHitsPerWire;
1621 std::map<DTWireId, std::vector<type> > recHitsPerWire = _recHitsPerWire;
1622  int nDt = 0;
1623  // Loop over cells with a muon SimHit
1624  for(std::map<DTWireId, std::vector<PSimHit> >::const_iterator wireAndSHits =
1625  simHitsPerWire.begin();
1626  wireAndSHits != simHitsPerWire.end();
1627  wireAndSHits++) {
1628  DTWireId wireId = (*wireAndSHits).first;
1629  std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
1630 
1631  // Get the layer
1632  const DTLayer* layer = dtGeom->layer(wireId);
1633 
1634  // Look for a mu hit in the cell
1635  const PSimHit* muSimHit = DTHitQualityUtils::findMuSimHit(simHitsInCell);
1636  if (muSimHit==0) {
1637  continue; // Skip this cell
1638  }
1639 
1640  // Find the distance of the simhit from the wire
1641  float simHitWireDist = simHitDistFromWire(layer, wireId, *muSimHit);
1642  // Skip simhits out of the cell
1643  if(simHitWireDist>2.1) {
1644  continue; // Skip this cell
1645  }
1646 
1647  // Look for RecHits in the same cell
1648  if(recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
1649  continue; // No RecHit found in this cell
1650  } else {
1651 
1652  std::vector<type> recHits = recHitsPerWire[wireId];
1653 
1654  // Find the best RecHit
1655  const type* theBestRecHit =
1656  findBestRecHit(layer, wireId, recHits, simHitWireDist);
1657 
1658  float recHitWireDist = recHitDistFromWire(*theBestRecHit, layer);
1659 
1660  ++nDt;
1661 
1662  mehDtMuonRes->Fill(recHitWireDist-simHitWireDist);
1663 
1664  } // find rechits
1665  } // loop over simhits
1666 
1667  return nDt;
1668 }
type
Definition: HCALResponse.h:21
static const PSimHit * findMuSimHit(const edm::PSimHitContainer &hits)
Select the SimHit from a muon in a vector of SimHits.
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
float simHitDistFromWire(const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
void Fill(long long x)
const DTLayer * layer(DTLayerId id) const
Return a layer given its id.
Definition: DTGeometry.cc:110
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
void GlobalRecHitsAnalyzer::fillECal ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 365 of file GlobalRecHitsAnalyzer.cc.

References HLT_25ns14e33_v3_cff::barrelHits, edm::SortedCollection< T, SORT >::begin(), EBHits_Token_, ECalEBSrc_Token_, ECalEESrc_Token_, ECalESSrc_Token_, ECalUncalEBSrc_Token_, ECalUncalEESrc_Token_, EEHits_Token_, edm::SortedCollection< T, SORT >::end(), HLT_25ns14e33_v3_cff::endcapHits, ESHits_Token_, MonitorElement::Fill(), edm::SortedCollection< T, SORT >::find(), edm::Event::getByToken(), edm::HandleBase::isValid(), LogDebug, mehEcaln, mehEcalRes, edm::Handle< T >::product(), DetId::rawId(), AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

Referenced by analyze().

367 {
368  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_fillECal";
369 
370  TString eventout;
371  if (verbosity > 0)
372  eventout = "\nGathering info:";
373 
374  // extract crossing frame from event
375  edm::Handle<CrossingFrame<PCaloHit> > crossingFrame;
376 
378  //extract EB information
381  iEvent.getByToken(ECalUncalEBSrc_Token_, EcalUncalibRecHitEB);
382  bool validUncalibRecHitEB = true;
383  if (!EcalUncalibRecHitEB.isValid()) {
384  LogDebug(MsgLoggerCat)
385  << "Unable to find EcalUncalRecHitEB in event!";
386  validUncalibRecHitEB = false;
387  }
388 
389  edm::Handle<EBRecHitCollection> EcalRecHitEB;
390  iEvent.getByToken(ECalEBSrc_Token_, EcalRecHitEB);
391  bool validRecHitEB = true;
392  if (!EcalRecHitEB.isValid()) {
393  LogDebug(MsgLoggerCat)
394  << "Unable to find EcalRecHitEB in event!";
395  validRecHitEB = false;
396  }
397 
398  // loop over simhits
399  iEvent.getByToken(EBHits_Token_,crossingFrame);
400  bool validXFrame = true;
401  if (!crossingFrame.isValid()) {
402  LogDebug(MsgLoggerCat)
403  << "Unable to find cal barrel crossingFrame in event!";
404  validXFrame = false;
405  }
406 
407  MapType ebSimMap;
408  if (validXFrame) {
409  std::auto_ptr<MixCollection<PCaloHit> >
410  barrelHits(new MixCollection<PCaloHit>(crossingFrame.product()));
411 
412  // keep track of sum of simhit energy in each crystal
414  = barrelHits->begin();
415  hitItr != barrelHits->end();
416  ++hitItr) {
417 
418  EBDetId ebid = EBDetId(hitItr->id());
419 
420  uint32_t crystid = ebid.rawId();
421  ebSimMap[crystid] += hitItr->energy();
422  }
423  }
424 
425  int nEBRecHits = 0;
426  // loop over RecHits
427  if (validUncalibRecHitEB && validRecHitEB) {
428  const EBUncalibratedRecHitCollection *EBUncalibRecHit =
429  EcalUncalibRecHitEB.product();
430  const EBRecHitCollection *EBRecHit = EcalRecHitEB.product();
431 
433  EBUncalibRecHit->begin();
434  uncalibRecHit != EBUncalibRecHit->end();
435  ++uncalibRecHit) {
436 
437  EBDetId EBid = EBDetId(uncalibRecHit->id());
438 
439  EcalRecHitCollection::const_iterator myRecHit = EBRecHit->find(EBid);
440 
441  if (myRecHit != EBRecHit->end()) {
442  ++nEBRecHits;
443  mehEcalRes[1]->Fill(myRecHit->energy()-ebSimMap[EBid.rawId()]);
444  }
445  }
446 
447  if (verbosity > 1) {
448  eventout += "\n Number of EBRecHits collected:............ ";
449  eventout += nEBRecHits;
450  }
451  mehEcaln[1]->Fill((float)nEBRecHits);
452  }
453 
455  //extract EE information
458  iEvent.getByToken(ECalUncalEESrc_Token_, EcalUncalibRecHitEE);
459  bool validuncalibRecHitEE = true;
460  if (!EcalUncalibRecHitEE.isValid()) {
461  LogDebug(MsgLoggerCat)
462  << "Unable to find EcalUncalRecHitEE in event!";
463  validuncalibRecHitEE = false;
464  }
465 
466  edm::Handle<EERecHitCollection> EcalRecHitEE;
467  iEvent.getByToken(ECalEESrc_Token_, EcalRecHitEE);
468  bool validRecHitEE = true;
469  if (!EcalRecHitEE.isValid()) {
470  LogDebug(MsgLoggerCat)
471  << "Unable to find EcalRecHitEE in event!";
472  validRecHitEE = false;
473  }
474 
475  // loop over simhits
476  iEvent.getByToken(EEHits_Token_,crossingFrame);
477  validXFrame = true;
478  if (!crossingFrame.isValid()) {
479  LogDebug(MsgLoggerCat)
480  << "Unable to find cal endcap crossingFrame in event!";
481  validXFrame = false;
482  }
483 
484  MapType eeSimMap;
485  if (validXFrame) {
486  std::auto_ptr<MixCollection<PCaloHit> >
487  endcapHits(new MixCollection<PCaloHit>(crossingFrame.product()));
488 
489  // keep track of sum of simhit energy in each crystal
491  = endcapHits->begin();
492  hitItr != endcapHits->end();
493  ++hitItr) {
494 
495  EEDetId eeid = EEDetId(hitItr->id());
496 
497  uint32_t crystid = eeid.rawId();
498  eeSimMap[crystid] += hitItr->energy();
499  }
500  }
501 
502  int nEERecHits = 0;
503  if (validuncalibRecHitEE && validRecHitEE) {
504  // loop over RecHits
505  const EEUncalibratedRecHitCollection *EEUncalibRecHit =
506  EcalUncalibRecHitEE.product();
507  const EERecHitCollection *EERecHit = EcalRecHitEE.product();
508 
510  EEUncalibRecHit->begin();
511  uncalibRecHit != EEUncalibRecHit->end();
512  ++uncalibRecHit) {
513 
514  EEDetId EEid = EEDetId(uncalibRecHit->id());
515 
516  EcalRecHitCollection::const_iterator myRecHit = EERecHit->find(EEid);
517 
518  if (myRecHit != EERecHit->end()) {
519  ++nEERecHits;
520  mehEcalRes[0]->Fill(myRecHit->energy()-eeSimMap[EEid.rawId()]);
521  }
522  }
523 
524  if (verbosity > 1) {
525  eventout += "\n Number of EERecHits collected:............ ";
526  eventout += nEERecHits;
527  }
528  mehEcaln[0]->Fill((float)nEERecHits);
529  }
530 
532  //extract ES information
534  edm::Handle<ESRecHitCollection> EcalRecHitES;
535  iEvent.getByToken(ECalESSrc_Token_, EcalRecHitES);
536  bool validRecHitES = true;
537  if (!EcalRecHitES.isValid()) {
538  LogDebug(MsgLoggerCat)
539  << "Unable to find EcalRecHitES in event!";
540  validRecHitES = false;
541  }
542 
543  // loop over simhits
544  iEvent.getByToken(ESHits_Token_,crossingFrame);
545  validXFrame = true;
546  if (!crossingFrame.isValid()) {
547  LogDebug(MsgLoggerCat)
548  << "Unable to find cal preshower crossingFrame in event!";
549  validXFrame = false;
550  }
551 
552  MapType esSimMap;
553  if (validXFrame) {
554  std::auto_ptr<MixCollection<PCaloHit> >
555  preshowerHits(new MixCollection<PCaloHit>(crossingFrame.product()));
556 
557  // keep track of sum of simhit energy in each crystal
559  = preshowerHits->begin();
560  hitItr != preshowerHits->end();
561  ++hitItr) {
562 
563  ESDetId esid = ESDetId(hitItr->id());
564 
565  uint32_t crystid = esid.rawId();
566  esSimMap[crystid] += hitItr->energy();
567  }
568  }
569 
570  int nESRecHits = 0;
571  if (validRecHitES) {
572  // loop over RecHits
573  const ESRecHitCollection *ESRecHit = EcalRecHitES.product();
575  ESRecHit->begin();
576  recHit != ESRecHit->end();
577  ++recHit) {
578 
579  ESDetId ESid = ESDetId(recHit->id());
580 
581  ++nESRecHits;
582  mehEcalRes[2]->Fill(recHit->energy()-esSimMap[ESid.rawId()]);
583  }
584 
585  if (verbosity > 1) {
586  eventout += "\n Number of ESRecHits collected:............ ";
587  eventout += nESRecHits;
588  }
589  mehEcaln[2]->Fill(float(nESRecHits));
590  }
591 
592  if (verbosity > 0)
593  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
594 
595  return;
596 }
#define LogDebug(id)
edm::EDGetTokenT< EBRecHitCollection > ECalEBSrc_Token_
edm::EDGetTokenT< ESRecHitCollection > ECalESSrc_Token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
std::vector< EcalUncalibratedRecHit >::const_iterator const_iterator
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
MonitorElement * mehEcalRes[3]
void Fill(long long x)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
edm::EDGetTokenT< EBUncalibratedRecHitCollection > ECalUncalEBSrc_Token_
MonitorElement * mehEcaln[3]
bool isValid() const
Definition: HandleBase.h:75
const_iterator end() const
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
T const * product() const
Definition: Handle.h:81
std::map< uint32_t, float, std::less< uint32_t > > MapType
iterator find(key_type k)
edm::EDGetTokenT< EEUncalibratedRecHitCollection > ECalUncalEESrc_Token_
const_iterator begin() const
edm::EDGetTokenT< EERecHitCollection > ECalEESrc_Token_
void GlobalRecHitsAnalyzer::fillHCal ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 598 of file GlobalRecHitsAnalyzer.cc.

References MonitorElement::Fill(), geometry, edm::EventSetup::get(), edm::Event::getByToken(), edm::Event::getManyByType(), CaloCellGeometry::getPosition(), HCalSrc_Token_, ihf, edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), LogDebug, mehHcaln, mehHcalRes, PV3DBase< T, PVType, FrameType >::phi(), PI, edm::Handle< T >::product(), DetId::rawId(), sdHcalBrl, sdHcalEC, sdHcalFwd, sdHcalOut, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

Referenced by analyze().

600 {
601  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_fillHCal";
602 
603  TString eventout;
604  if (verbosity > 0)
605  eventout = "\nGathering info:";
606 
607  // get geometry
609  iSetup.get<CaloGeometryRecord>().get(geometry);
610  if (!geometry.isValid()) {
611  edm::LogWarning(MsgLoggerCat)
612  << "Unable to find CaloGeometry in event!";
613  return;
614  }
615 
616  // iterator to access containers
617  edm::PCaloHitContainer::const_iterator itHit;
618 
620  // extract simhit info
623  iEvent.getByToken(HCalSrc_Token_,hcalHits);
624  bool validhcalHits = true;
625  if (!hcalHits.isValid()) {
626  LogDebug(MsgLoggerCat)
627  << "Unable to find hcalHits in event!";
628  validhcalHits = false;
629  }
630 
631  MapType fHBEnergySimHits;
632  MapType fHEEnergySimHits;
633  MapType fHOEnergySimHits;
634  MapType fHFEnergySimHits;
635  if (validhcalHits) {
636  const edm::PCaloHitContainer *simhitResult = hcalHits.product();
637 
638  for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin();
639  simhits != simhitResult->end();
640  ++simhits) {
641 
642  HcalDetId detId(simhits->id());
643  uint32_t cellid = detId.rawId();
644 
645  if (detId.subdet() == sdHcalBrl){
646  fHBEnergySimHits[cellid] += simhits->energy();
647  }
648  if (detId.subdet() == sdHcalEC){
649  fHEEnergySimHits[cellid] += simhits->energy();
650  }
651  if (detId.subdet() == sdHcalOut){
652  fHOEnergySimHits[cellid] += simhits->energy();
653  }
654  if (detId.subdet() == sdHcalFwd){
655  fHFEnergySimHits[cellid] += simhits->energy();
656  }
657  }
658  }
659 
660  // max values to be used (HO is found in HB)
661  Double_t maxHBEnergy = 0.;
662  Double_t maxHEEnergy = 0.;
663  Double_t maxHFEnergy = 0.;
664 
665  Double_t maxHBPhi = -1000.;
666  Double_t maxHEPhi = -1000.;
667  Double_t maxHOPhi = -1000.;
668  Double_t maxHFPhi = -1000.;
669 
670 
671  Double_t PI = 3.141592653589;
672 
674  // get HBHE information
676  std::vector<edm::Handle<HBHERecHitCollection> > hbhe;
677  iEvent.getManyByType(hbhe);
678  bool validHBHE = true;
679  if (!hbhe[0].isValid()) {
680  LogDebug(MsgLoggerCat)
681  << "Unable to find any HBHERecHitCollections in event!";
682  validHBHE = false;
683  }
684 
685  if (validHBHE) {
686  std::vector<edm::Handle<HBHERecHitCollection> >::iterator ihbhe;
687 
688  int iHB = 0;
689  int iHE = 0;
690  for (ihbhe = hbhe.begin(); ihbhe != hbhe.end(); ++ihbhe) {
691 
692  // find max values
693  for (HBHERecHitCollection::const_iterator jhbhe = (*ihbhe)->begin();
694  jhbhe != (*ihbhe)->end(); ++jhbhe) {
695 
696  HcalDetId cell(jhbhe->id());
697 
698  if (cell.subdet() == sdHcalBrl) {
699 
700  const CaloCellGeometry* cellGeometry =
701  geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
702  double fPhi = cellGeometry->getPosition().phi () ;
703  if ( (jhbhe->energy()) > maxHBEnergy ) {
704  maxHBEnergy = jhbhe->energy();
705  maxHBPhi = fPhi;
706  maxHOPhi = maxHBPhi;
707  }
708  }
709 
710  if (cell.subdet() == sdHcalEC) {
711 
712  const CaloCellGeometry* cellGeometry =
713  geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
714  double fPhi = cellGeometry->getPosition().phi () ;
715  if ( (jhbhe->energy()) > maxHEEnergy ) {
716  maxHEEnergy = jhbhe->energy();
717  maxHEPhi = fPhi;
718  }
719  }
720  } // end find max values
721 
722  for (HBHERecHitCollection::const_iterator jhbhe = (*ihbhe)->begin();
723  jhbhe != (*ihbhe)->end(); ++jhbhe) {
724 
725  HcalDetId cell(jhbhe->id());
726 
727  if (cell.subdet() == sdHcalBrl) {
728 
729  ++iHB;
730 
731  const CaloCellGeometry* cellGeometry =
732  geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
733  double fPhi = cellGeometry->getPosition().phi () ;
734 
735  float deltaphi = maxHBPhi - fPhi;
736  if (fPhi > maxHBPhi) { deltaphi = fPhi - maxHBPhi;}
737  if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
738 
739  mehHcalRes[0]->Fill(jhbhe->energy() -
740  fHBEnergySimHits[cell.rawId()]);
741  }
742 
743  if (cell.subdet() == sdHcalEC) {
744 
745  ++iHE;
746 
747  const CaloCellGeometry* cellGeometry =
748  geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
749  double fPhi = cellGeometry->getPosition().phi () ;
750 
751  float deltaphi = maxHEPhi - fPhi;
752  if (fPhi > maxHEPhi) { deltaphi = fPhi - maxHEPhi;}
753  if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
754  mehHcalRes[1]->Fill(jhbhe->energy() -
755  fHEEnergySimHits[cell.rawId()]);
756  }
757  }
758  } // end loop through collection
759 
760 
761  if (verbosity > 1) {
762  eventout += "\n Number of HBRecHits collected:............ ";
763  eventout += iHB;
764  }
765 
766  if (verbosity > 1) {
767  eventout += "\n Number of HERecHits collected:............ ";
768  eventout += iHE;
769  }
770  mehHcaln[0]->Fill((float)iHB);
771  mehHcaln[1]->Fill((float)iHE);
772  }
773 
775  // get HF information
777  std::vector<edm::Handle<HFRecHitCollection> > hf;
778  iEvent.getManyByType(hf);
779  bool validHF = true;
780  if (!hf[0].isValid()) {
781  LogDebug(MsgLoggerCat)
782  << "Unable to find any HFRecHitCollections in event!";
783  validHF = false;
784  }
785  if (validHF) {
786  std::vector<edm::Handle<HFRecHitCollection> >::iterator ihf;
787 
788  int iHF = 0;
789  for (ihf = hf.begin(); ihf != hf.end(); ++ihf) {
790 
791  // find max values
792  for (HFRecHitCollection::const_iterator jhf = (*ihf)->begin();
793  jhf != (*ihf)->end(); ++jhf) {
794 
795  HcalDetId cell(jhf->id());
796 
797  if (cell.subdet() == sdHcalFwd) {
798 
799  const CaloCellGeometry* cellGeometry =
800  geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
801  double fPhi = cellGeometry->getPosition().phi () ;
802  if ( (jhf->energy()) > maxHFEnergy ) {
803  maxHFEnergy = jhf->energy();
804  maxHFPhi = fPhi;
805  }
806  }
807  } // end find max values
808 
809  for (HFRecHitCollection::const_iterator jhf = (*ihf)->begin();
810  jhf != (*ihf)->end(); ++jhf) {
811 
812  HcalDetId cell(jhf->id());
813 
814  if (cell.subdet() == sdHcalFwd) {
815 
816  ++iHF;
817 
818  const CaloCellGeometry* cellGeometry =
819  geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
820  double fPhi = cellGeometry->getPosition().phi () ;
821 
822  float deltaphi = maxHBPhi - fPhi;
823  if (fPhi > maxHFPhi) { deltaphi = fPhi - maxHFPhi;}
824  if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
825 
826  mehHcalRes[2]->Fill(jhf->energy()-fHFEnergySimHits[cell.rawId()]);
827  }
828  }
829  } // end loop through collection
830 
831  if (verbosity > 1) {
832  eventout += "\n Number of HFDigis collected:.............. ";
833  eventout += iHF;
834  }
835  mehHcaln[2]->Fill((float)iHF);
836  }
837 
839  // get HO information
841  std::vector<edm::Handle<HORecHitCollection> > ho;
842  iEvent.getManyByType(ho);
843  bool validHO = true;
844  if (!ho[0].isValid()) {
845  LogDebug(MsgLoggerCat)
846  << "Unable to find any HORecHitCollections in event!";
847  validHO = false;
848  }
849 
850  if (validHO) {
851  std::vector<edm::Handle<HORecHitCollection> >::iterator iho;
852 
853  int iHO = 0;
854  for (iho = ho.begin(); iho != ho.end(); ++iho) {
855 
856  for (HORecHitCollection::const_iterator jho = (*iho)->begin();
857  jho != (*iho)->end(); ++jho) {
858 
859  HcalDetId cell(jho->id());
860 
861  if (cell.subdet() == sdHcalOut) {
862 
863  ++iHO;
864 
865  const CaloCellGeometry* cellGeometry =
866  geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
867  double fPhi = cellGeometry->getPosition().phi () ;
868 
869  float deltaphi = maxHOPhi - fPhi;
870  if (fPhi > maxHOPhi) { deltaphi = fPhi - maxHOPhi;}
871  if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
872  mehHcalRes[3]->Fill(jho->energy()-fHOEnergySimHits[cell.rawId()]);
873  }
874  }
875  } // end loop through collection
876 
877  if (verbosity > 1) {
878  eventout += "\n Number of HODigis collected:.............. ";
879  eventout += iHO;
880  }
881  mehHcaln[3]->Fill((float)iHO);
882  }
883 
884  if (verbosity > 0)
885  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
886 
887  return;
888 }
#define LogDebug(id)
void getManyByType(std::vector< Handle< PROD > > &results) const
Definition: Event.h:439
std::vector< PCaloHit > PCaloHitContainer
int ihf
static const int sdHcalOut
#define PI
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
MonitorElement * mehHcalRes[4]
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
std::vector< HBHERecHit >::const_iterator const_iterator
void Fill(long long x)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
bool isValid() const
Definition: HandleBase.h:75
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:55
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
static const int sdHcalFwd
std::map< uint32_t, float, std::less< uint32_t > > MapType
static const int sdHcalBrl
ESHandle< TrackerGeometry > geometry
MonitorElement * mehHcaln[4]
bool isValid() const
Definition: ESHandle.h:47
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
static const int sdHcalEC
void GlobalRecHitsAnalyzer::fillMuon ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 1280 of file GlobalRecHitsAnalyzer.cc.

References CSCLayer::chamber(), CSCChamberSpecs::chamberType(), compute(), CSCDetId, MonitorElement::Fill(), edm::EventSetup::get(), edm::Event::getByToken(), i, CSCGeometry::idToDetUnit(), RPCRoll::isForward(), edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), getDQMSummary::iter, LogDebug, map1DRecHitsPerWire(), DTHitQualityUtils::mapSimHitsPerWire(), mehCSCn, mehDtMuonn, mehRPCn, mehRPCResX, MuCSCHits_Token_, MuCSCSrc_Token_, MuDTSimSrc_Token_, MuDTSrc_Token_, MuRPCSimSrc_Token_, MuRPCSrc_Token_, plotResolution(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), alignCSCRings::r, RPCDetId, trackerHits::simHits, CSCChamber::specs(), AlCaHLTBitMon_QueryRunRegistry::string, theMap, verbosity, and PV3DBase< T, PVType, FrameType >::x().

Referenced by analyze().

1282 {
1283  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_fillMuon";
1284 
1285  TString eventout;
1286  if (verbosity > 0)
1287  eventout = "\nGathering info:";
1288 
1289  // get DT information
1291  iSetup.get<MuonGeometryRecord>().get(dtGeom);
1292  if (!dtGeom.isValid()) {
1293  edm::LogWarning(MsgLoggerCat)
1294  << "Unable to find DTMuonGeometryRecord in event!";
1295  return;
1296  }
1297 
1299  iEvent.getByToken(MuDTSimSrc_Token_, dtsimHits);
1300  bool validdtsim = true;
1301  if (!dtsimHits.isValid()) {
1302  LogDebug(MsgLoggerCat)
1303  << "Unable to find dtsimHits in event!";
1304  validdtsim = false;
1305  }
1306 
1308  iEvent.getByToken(MuDTSrc_Token_, dtRecHits);
1309  bool validdtrec = true;
1310  if (!dtRecHits.isValid()) {
1311  LogDebug(MsgLoggerCat)
1312  << "Unable to find dtRecHits in event!";
1313  validdtrec = false;
1314  }
1315 
1316  if (validdtsim && validdtrec) {
1317 
1318  std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1320 
1321  std::map<DTWireId, std::vector<DTRecHit1DPair> > recHitsPerWire =
1322  map1DRecHitsPerWire(dtRecHits.product());
1323 
1324  int nDt = compute(dtGeom.product(), simHitsPerWire, recHitsPerWire, 1);
1325 
1326  if (verbosity > 1) {
1327  eventout += "\n Number of DtMuonRecHits collected:........ ";
1328  eventout += nDt;
1329  }
1330  mehDtMuonn->Fill(float(nDt));
1331  }
1332 
1333  // get CSC Strip information
1334  // get map of sim hits
1335  theMap.clear();
1337 
1338  iEvent.getByToken(MuCSCHits_Token_,cf);
1339  bool validXFrame = true;
1340  if (!cf.isValid()) {
1341  LogDebug(MsgLoggerCat)
1342  << "Unable to find muo CSC crossingFrame in event!";
1343  validXFrame = false;
1344  }
1345  if (validXFrame) {
1347 
1348  // arrange the hits by detUnit
1349  for(MixCollection<PSimHit>::MixItr hitItr = simHits.begin();
1350  hitItr != simHits.end(); ++hitItr) {
1351  theMap[hitItr->detUnitId()].push_back(*hitItr);
1352  }
1353  }
1354 
1355  // get geometry
1357  iSetup.get<MuonGeometryRecord>().get(hGeom);
1358  if (!hGeom.isValid()) {
1359  edm::LogWarning(MsgLoggerCat)
1360  << "Unable to find CSCMuonGeometryRecord in event!";
1361  return;
1362  }
1363  const CSCGeometry *theCSCGeometry = &*hGeom;
1364 
1365  // get rechits
1367  iEvent.getByToken(MuCSCSrc_Token_, hRecHits);
1368  bool validCSC = true;
1369  if (!hRecHits.isValid()) {
1370  LogDebug(MsgLoggerCat)
1371  << "Unable to find CSC RecHits in event!";
1372  validCSC = false;
1373  }
1374 
1375  if (validCSC) {
1376  const CSCRecHit2DCollection *cscRecHits = hRecHits.product();
1377 
1378  int nCSC = 0;
1379  for (CSCRecHit2DCollection::const_iterator recHitItr = cscRecHits->begin();
1380  recHitItr != cscRecHits->end(); ++recHitItr) {
1381 
1382  int detId = (*recHitItr).cscDetId().rawId();
1383 
1385  std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
1386  theMap.find(detId);
1387  if (mapItr != theMap.end()) {
1388  simHits = mapItr->second;
1389  }
1390 
1391  if (simHits.size() == 1) {
1392  ++nCSC;
1393 
1394  const GeomDetUnit* detUnit =
1395  theCSCGeometry->idToDetUnit(CSCDetId(detId));
1396  const CSCLayer *layer = dynamic_cast<const CSCLayer *>(detUnit);
1397 
1398  int chamberType = layer->chamber()->specs()->chamberType();
1399  plotResolution(simHits[0], *recHitItr, layer, chamberType);
1400  }
1401  }
1402 
1403  if (verbosity > 1) {
1404  eventout += "\n Number of CSCRecHits collected:........... ";
1405  eventout += nCSC;
1406  }
1407  mehCSCn->Fill((float)nCSC);
1408  }
1409 
1410  // get RPC information
1411  std::map<double, int> mapsim, maprec;
1412  std::map<int, double> nmapsim, nmaprec;
1413 
1415  iSetup.get<MuonGeometryRecord>().get(rpcGeom);
1416  if (!rpcGeom.isValid()) {
1417  edm::LogWarning(MsgLoggerCat)
1418  << "Unable to find RPCMuonGeometryRecord in event!";
1419  return;
1420  }
1421 
1423  iEvent.getByToken(MuRPCSimSrc_Token_, simHit);
1424  bool validrpcsim = true;
1425  if (!simHit.isValid()) {
1426  LogDebug(MsgLoggerCat)
1427  << "Unable to find RPCSimHit in event!";
1428  validrpcsim = false;
1429  }
1430 
1432  iEvent.getByToken(MuRPCSrc_Token_, recHit);
1433  bool validrpc = true;
1434  if (!simHit.isValid()) {
1435  LogDebug(MsgLoggerCat)
1436  << "Unable to find RPCRecHit in event!";
1437  validrpc = false;
1438  }
1439 
1440  if (validrpc) {
1441  int nRPC = 0;
1443  int nrec = 0;
1444  for (recIt = recHit->begin(); recIt != recHit->end(); ++recIt) {
1445  RPCDetId Rid = (RPCDetId)(*recIt).rpcId();
1446  const RPCRoll *roll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(Rid));
1447  if (roll->isForward()) {
1448 
1449  if (verbosity > 1) {
1450  eventout +=
1451  "\n Number of RPCRecHits collected:........... ";
1452  eventout += nRPC;
1453  }
1454 
1455  if (verbosity > 0)
1456  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1457  return;
1458  }
1459  nrec = nrec + 1;
1460  LocalPoint rhitlocal = (*recIt).localPosition();
1461  double rhitlocalx = rhitlocal.x();
1462  maprec[rhitlocalx] = nrec;
1463  }
1464 
1465  int i = 0;
1466  for (std::map<double,int>::iterator iter = maprec.begin();
1467  iter != maprec.end(); ++iter) {
1468  i = i + 1;
1469  nmaprec[i] = (*iter).first;
1470  }
1471 
1472  int nsim = 0;
1473  if (validrpcsim) {
1474  edm::PSimHitContainer::const_iterator simIt;
1475  for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
1476  int ptype = (*simIt).particleType();
1477  if (ptype == 13 || ptype == -13) {
1478  nsim = nsim + 1;
1479  LocalPoint shitlocal = (*simIt).localPosition();
1480  double shitlocalx = shitlocal.x();
1481  mapsim[shitlocalx] = nsim;
1482  }
1483  }
1484 
1485  i = 0;
1486  for (std::map<double,int>::iterator iter = mapsim.begin();
1487  iter != mapsim.end(); ++iter) {
1488  i = i + 1;
1489  nmapsim[i] = (*iter).first;
1490  }
1491  }
1492 
1493  if (nsim == nrec) {
1494  for (int r = 0; r < nsim; r++) {
1495  ++nRPC;
1496  mehRPCResX->Fill(nmaprec[r+1]-nmapsim[r+1]);
1497  }
1498  }
1499 
1500  if (verbosity > 1) {
1501  eventout += "\n Number of RPCRecHits collected:........... ";
1502  eventout += nRPC;
1503  }
1504  mehRPCn->Fill((float)nRPC);
1505  }
1506 
1507  if (verbosity > 0)
1508  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1509 
1510  return;
1511 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuCSCHits_Token_
edm::EDGetTokenT< edm::PSimHitContainer > MuDTSimSrc_Token_
void Fill(long long x)
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
std::map< int, edm::PSimHitContainer > theMap
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)
const CSCChamberSpecs * specs() const
Definition: CSCChamber.h:42
int compute(const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit > > &simHitsPerWire, const std::map< DTWireId, std::vector< type > > &recHitsPerWire, int step)
edm::EDGetTokenT< CSCRecHit2DCollection > MuCSCSrc_Token_
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< RPCRecHitCollection > MuRPCSrc_Token_
T const * product() const
Definition: Handle.h:81
int chamberType() const
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
tuple simHits
Definition: trackerHits.py:16
edm::EDGetTokenT< DTRecHitCollection > MuDTSrc_Token_
virtual const GeomDetUnit * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: CSCGeometry.cc:93
std::vector< PSimHit > PSimHitContainer
static std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
bool isValid() const
Definition: ESHandle.h:47
T x() const
Definition: PV3DBase.h:62
bool isForward() const
Definition: RPCRoll.cc:98
edm::EDGetTokenT< edm::PSimHitContainer > MuRPCSimSrc_Token_
const CSCChamber * chamber() const
Definition: CSCLayer.h:52
void GlobalRecHitsAnalyzer::fillTrk ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 890 of file GlobalRecHitsAnalyzer.cc.

References TrackerHitAssociator::associateHit(), edmNew::DetSet< T >::begin(), conf_, cond::rpcobgas::detid, edmNew::DetSet< T >::end(), MonitorElement::Fill(), TrackingRecHit::geographicalId(), relativeConstraints::geom, edm::EventSetup::get(), edm::Event::getByToken(), i, TrackerGeometry::idToDet(), edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), BaseTrackerRecHit::localPosition(), LogDebug, visualization-live-secondInstance_cfg::m, matched, mehSiPixeln, mehSiPixelResX, mehSiPixelResY, mehSiStripn, mehSiStripResX, mehSiStripResY, position, edm::ESHandle< class >::product(), projectHit(), TrackerTopology::pxbLayer(), TrackerTopology::pxfDisk(), TrackerTopology::pxfSide(), sdPxlBrl, sdPxlFwd, sdSiTEC, sdSiTIB, sdSiTID, sdSiTOB, SiPxlSrc_Token_, SiStripSrc_Token_, mathSSE::sqrt(), GluedGeomDet::stereoDet(), AlCaHLTBitMon_QueryRunRegistry::string, DetId::subdetId(), GeomDet::surface(), TrackerTopology::tecWheel(), TrackerTopology::tibLayer(), TrackerTopology::tidWheel(), TrackerTopology::tobLayer(), patCandidatesForDimuonsSequences_cff::tracker, verbosity, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by analyze().

892 {
893  //Retrieve tracker topology from geometry
894  edm::ESHandle<TrackerTopology> tTopoHandle;
895  iSetup.get<IdealGeometryRecord>().get(tTopoHandle);
896  const TrackerTopology* const tTopo = tTopoHandle.product();
897 
898 
899  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_fillTrk";
900 
901  TString eventout;
902  if (verbosity > 0)
903  eventout = "\nGathering info:";
904 
905  // get strip information
907  iEvent.getByToken(SiStripSrc_Token_, rechitsmatched);
908  bool validstrip = true;
909  if (!rechitsmatched.isValid()) {
910  LogDebug(MsgLoggerCat)
911  << "Unable to find stripmatchedrechits in event!";
912  validstrip = false;
913  }
914 
915  TrackerHitAssociator associate(iEvent,conf_);
916 
918  iSetup.get<TrackerDigiGeometryRecord>().get(pDD);
919  if (!pDD.isValid()) {
920  edm::LogWarning(MsgLoggerCat)
921  << "Unable to find TrackerDigiGeometry in event!";
922  return;
923  }
924  const TrackerGeometry &tracker(*pDD);
925 
926  if (validstrip) {
927  int nStripBrl = 0, nStripFwd = 0;
928 
929  // loop over det units
930  for (TrackerGeometry::DetContainer::const_iterator it =
931  pDD->dets().begin();
932  it != pDD->dets().end(); ++it) {
933 
934  uint32_t myid = ((*it)->geographicalId()).rawId();
935  DetId detid = ((*it)->geographicalId());
936 
937  //loop over rechits-matched in the same subdetector
938  SiStripMatchedRecHit2DCollection::const_iterator rechitmatchedMatch = rechitsmatched->find(detid);
939 
940  if (rechitmatchedMatch != rechitsmatched->end()) {
941  SiStripMatchedRecHit2DCollection::DetSet rechitmatchedRange = *rechitmatchedMatch;
942  SiStripMatchedRecHit2DCollection::DetSet::const_iterator rechitmatchedRangeIteratorBegin = rechitmatchedRange.begin();
943  SiStripMatchedRecHit2DCollection::DetSet::const_iterator rechitmatchedRangeIteratorEnd = rechitmatchedRange.end();
944  SiStripMatchedRecHit2DCollection::DetSet::const_iterator itermatched = rechitmatchedRangeIteratorBegin;
945 
946  for ( itermatched = rechitmatchedRangeIteratorBegin;
947  itermatched != rechitmatchedRangeIteratorEnd;
948  ++itermatched) {
949 
950  SiStripMatchedRecHit2D const rechit = *itermatched;
951  LocalPoint position = rechit.localPosition();
952 
953  float mindist = 999999.;
954  float distx = 999999.;
955  float disty = 999999.;
956  float dist = 999999.;
957  std::pair<LocalPoint,LocalVector> closestPair;
958  matched.clear();
959 
960  float rechitmatchedx = position.x();
961  float rechitmatchedy = position.y();
962 
963  matched = associate.associateHit(rechit);
964 
965  if (!matched.empty()) {
966  //project simhit;
967  const GluedGeomDet* gluedDet =
968  (const GluedGeomDet*)tracker.idToDet(rechit.geographicalId());
969  const StripGeomDetUnit* partnerstripdet =
970  (StripGeomDetUnit*) gluedDet->stereoDet();
971  std::pair<LocalPoint,LocalVector> hitPair;
972 
973  for(std::vector<PSimHit>::const_iterator m = matched.begin();
974  m != matched.end(); m++){
975  //project simhit;
976  hitPair = projectHit((*m),partnerstripdet,gluedDet->surface());
977  distx = fabs(rechitmatchedx - hitPair.first.x());
978  disty = fabs(rechitmatchedy - hitPair.first.y());
979  dist = sqrt(distx*distx+disty*disty);
980 
981  if(dist < mindist){
982  mindist = dist;
983  closestPair = hitPair;
984  }
985  }
986 
987  // get TIB
988  if (detid.subdetId() == sdSiTIB) {
989 
990 
991  ++nStripBrl;
992 
993  if (tTopo->tibLayer(myid) == 1) {
994  mehSiStripResX[8]->Fill(rechitmatchedx-closestPair.first.x());
995  mehSiStripResY[8]->Fill(rechitmatchedy-closestPair.first.y());
996  }
997  if (tTopo->tibLayer(myid) == 2) {
998  mehSiStripResX[9]->Fill(rechitmatchedx-closestPair.first.x());
999  mehSiStripResY[9]->Fill(rechitmatchedy-closestPair.first.y());
1000  }
1001  if (tTopo->tibLayer(myid) == 3) {
1002  mehSiStripResX[10]->Fill(rechitmatchedx-closestPair.first.x());
1003  mehSiStripResY[10]->Fill(rechitmatchedy-closestPair.first.y());
1004 
1005  }
1006  if (tTopo->tibLayer(myid) == 4) {
1007  mehSiStripResX[11]->Fill(rechitmatchedx-closestPair.first.x());
1008  mehSiStripResY[11]->Fill(rechitmatchedy-closestPair.first.y());
1009  }
1010  }
1011 
1012  // get TOB
1013  if (detid.subdetId() == sdSiTOB) {
1014 
1015 
1016  ++nStripBrl;
1017 
1018  if (tTopo->tobLayer(myid) == 1) {
1019  mehSiStripResX[15]->Fill(rechitmatchedx-closestPair.first.x());
1020  mehSiStripResY[15]->Fill(rechitmatchedy-closestPair.first.y());
1021  }
1022  if (tTopo->tobLayer(myid) == 2) {
1023  mehSiStripResX[16]->Fill(rechitmatchedx-closestPair.first.x());
1024  mehSiStripResY[16]->Fill(rechitmatchedy-closestPair.first.y());
1025  }
1026  if (tTopo->tobLayer(myid) == 3) {
1027  mehSiStripResX[17]->Fill(rechitmatchedx-closestPair.first.x());
1028  mehSiStripResY[17]->Fill(rechitmatchedy-closestPair.first.y());
1029  }
1030  if (tTopo->tobLayer(myid) == 4) {
1031  mehSiStripResX[18]->Fill(rechitmatchedx-closestPair.first.x());
1032  mehSiStripResY[18]->Fill(rechitmatchedy-closestPair.first.y());
1033  }
1034  }
1035 
1036  // get TID
1037  if (detid.subdetId() == sdSiTID) {
1038 
1039 
1040  ++nStripFwd;
1041 
1042  if (tTopo->tidWheel(myid) == 1) {
1043  mehSiStripResX[12]->Fill(rechitmatchedx-closestPair.first.x());
1044  mehSiStripResY[12]->Fill(rechitmatchedy-closestPair.first.y());
1045  }
1046  if (tTopo->tidWheel(myid) == 2) {
1047  mehSiStripResX[13]->Fill(rechitmatchedx-closestPair.first.x());
1048  mehSiStripResY[13]->Fill(rechitmatchedy-closestPair.first.y());
1049  }
1050  if (tTopo->tidWheel(myid) == 3) {
1051  mehSiStripResX[14]->Fill(rechitmatchedx-closestPair.first.x());
1052  mehSiStripResY[14]->Fill(rechitmatchedy-closestPair.first.y());
1053  }
1054  }
1055 
1056  // get TEC
1057  if (detid.subdetId() == sdSiTEC) {
1058 
1059 
1060  ++nStripFwd;
1061 
1062  if (tTopo->tecWheel(myid) == 1) {
1063  mehSiStripResX[0]->Fill(rechitmatchedx-closestPair.first.x());
1064  mehSiStripResY[0]->Fill(rechitmatchedy-closestPair.first.y());
1065  }
1066  if (tTopo->tecWheel(myid) == 2) {
1067  mehSiStripResX[1]->Fill(rechitmatchedx-closestPair.first.x());
1068  mehSiStripResY[1]->Fill(rechitmatchedy-closestPair.first.y());
1069  }
1070  if (tTopo->tecWheel(myid) == 3) {
1071  mehSiStripResX[2]->Fill(rechitmatchedx-closestPair.first.x());
1072  mehSiStripResY[2]->Fill(rechitmatchedy-closestPair.first.y());
1073  }
1074  if (tTopo->tecWheel(myid) == 4) {
1075  mehSiStripResX[3]->Fill(rechitmatchedx-closestPair.first.x());
1076  mehSiStripResY[3]->Fill(rechitmatchedy-closestPair.first.y());
1077 
1078  }
1079  if (tTopo->tecWheel(myid) == 5) {
1080  mehSiStripResX[4]->Fill(rechitmatchedx-closestPair.first.x());
1081  mehSiStripResY[4]->Fill(rechitmatchedy-closestPair.first.y());
1082  }
1083  if (tTopo->tecWheel(myid) == 6) {
1084  mehSiStripResX[5]->Fill(rechitmatchedx-closestPair.first.x());
1085  mehSiStripResY[5]->Fill(rechitmatchedy-closestPair.first.y());
1086  }
1087  if (tTopo->tecWheel(myid) == 7) {
1088  mehSiStripResX[6]->Fill(rechitmatchedx-closestPair.first.x());
1089  mehSiStripResY[6]->Fill(rechitmatchedy-closestPair.first.y());
1090  }
1091  if (tTopo->tecWheel(myid) == 8) {
1092  mehSiStripResX[7]->Fill(rechitmatchedx-closestPair.first.x());
1093  mehSiStripResY[7]->Fill(rechitmatchedy-closestPair.first.y());
1094  }
1095  }
1096 
1097  } // end if matched empty
1098  }
1099  }
1100  } // end loop over det units
1101 
1102  if (verbosity > 1) {
1103  eventout += "\n Number of BrlStripRecHits collected:...... ";
1104  eventout += nStripBrl;
1105  }
1106 
1107  for(int i =8; i<12; ++i)
1108  {mehSiStripn[i]->Fill((float)nStripBrl);}
1109  for(int i =16; i<19; ++i)
1110  {mehSiStripn[i]->Fill((float)nStripBrl);}
1111 
1112  if (verbosity > 1) {
1113  eventout += "\n Number of FrwdStripRecHits collected:..... ";
1114  eventout += nStripFwd;
1115  }
1116  for(int i =0; i<8; ++i)
1117  {mehSiStripn[i]->Fill((float)nStripFwd);}
1118  for(int i =12; i<16; ++i)
1119  {mehSiStripn[i]->Fill((float)nStripFwd);}
1120  }
1121 
1122  // get pixel information
1123  //Get RecHits
1125  iEvent.getByToken(SiPxlSrc_Token_, recHitColl);
1126  bool validpixel = true;
1127  if (!recHitColl.isValid()) {
1128  LogDebug(MsgLoggerCat)
1129  << "Unable to find SiPixelRecHitCollection in event!";
1130  validpixel = false;
1131  }
1132 
1133  //Get event setup
1135  iSetup.get<TrackerDigiGeometryRecord>().get(geom);
1136  if (!geom.isValid()) {
1137  edm::LogWarning(MsgLoggerCat)
1138  << "Unable to find TrackerDigiGeometry in event!";
1139  return;
1140  }
1141 
1142  if (validpixel) {
1143  int nPxlBrl = 0, nPxlFwd = 0;
1144  //iterate over detunits
1145  for (TrackerGeometry::DetContainer::const_iterator it =
1146  geom->dets().begin();
1147  it != geom->dets().end(); ++it) {
1148 
1149  uint32_t myid = ((*it)->geographicalId()).rawId();
1150  DetId detId = ((*it)->geographicalId());
1151  int subid = detId.subdetId();
1152 
1153  if (! ((subid == sdPxlBrl) || (subid == sdPxlFwd))) continue;
1154 
1155  SiPixelRecHitCollection::const_iterator pixeldet = recHitColl->find(detId);
1156  if (pixeldet == recHitColl->end()) continue;
1157  SiPixelRecHitCollection::DetSet pixelrechitRange = *pixeldet;
1158  SiPixelRecHitCollection::DetSet::const_iterator pixelrechitRangeIteratorBegin = pixelrechitRange.begin();
1159  SiPixelRecHitCollection::DetSet::const_iterator pixelrechitRangeIteratorEnd = pixelrechitRange.end();
1160  SiPixelRecHitCollection::DetSet::const_iterator pixeliter = pixelrechitRangeIteratorBegin;
1161 
1162 
1163  std::vector<PSimHit> matched;
1164 
1165  //----Loop over rechits for this detId
1166  for ( ; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1167 
1168  matched.clear();
1169  matched = associate.associateHit(*pixeliter);
1170 
1171  if ( !matched.empty() ) {
1172 
1173  float closest = 9999.9;
1174  LocalPoint lp = pixeliter->localPosition();
1175  float rechit_x = lp.x();
1176  float rechit_y = lp.y();
1177 
1178  float sim_x = 0.;
1179  float sim_y = 0.;
1180 
1181  //loop over sim hits and fill closet
1182  for (std::vector<PSimHit>::const_iterator m = matched.begin();
1183  m != matched.end(); ++m) {
1184 
1185  float sim_x1 = (*m).entryPoint().x();
1186  float sim_x2 = (*m).exitPoint().x();
1187  float sim_xpos = 0.5*(sim_x1+sim_x2);
1188 
1189  float sim_y1 = (*m).entryPoint().y();
1190  float sim_y2 = (*m).exitPoint().y();
1191  float sim_ypos = 0.5*(sim_y1+sim_y2);
1192 
1193  float x_res = fabs(sim_xpos - rechit_x);
1194  float y_res = fabs(sim_ypos - rechit_y);
1195 
1196  float dist = sqrt(x_res*x_res + y_res*y_res);
1197 
1198  if ( dist < closest ) {
1199  closest = dist;
1200  sim_x = sim_xpos;
1201  sim_y = sim_ypos;
1202  }
1203  } // end sim hit loop
1204 
1205  // get Barrel pixels ***************Pixel STuff******************
1206  if (subid == sdPxlBrl) {
1207 
1208  ++nPxlBrl;
1209 
1210  if (tTopo->pxbLayer(myid) == 1) {
1211  mehSiPixelResX[0]->Fill(rechit_x-sim_x);
1212  mehSiPixelResY[0]->Fill(rechit_y-sim_y);
1213 
1214  }
1215  if (tTopo->pxbLayer(myid) == 2) {
1216  mehSiPixelResX[1]->Fill(rechit_x-sim_x);
1217  mehSiPixelResY[1]->Fill(rechit_y-sim_y);
1218  }
1219  if (tTopo->pxbLayer(myid) == 3) {
1220  mehSiPixelResX[2]->Fill(rechit_x-sim_x);
1221  mehSiPixelResY[2]->Fill(rechit_y-sim_y);
1222  }
1223  }
1224 
1225  // get Forward pixels
1226  if (subid == sdPxlFwd) {
1227 
1228  ++nPxlFwd;
1229 
1230  if (tTopo->pxfDisk(myid) == 1) {
1231  if (tTopo->pxfSide(myid) == 1) {
1232  mehSiPixelResX[3]->Fill(rechit_x-sim_x);
1233  mehSiPixelResY[3]->Fill(rechit_y-sim_y);
1234  }
1235  if (tTopo->pxfSide(myid) == 2) {
1236  mehSiPixelResX[4]->Fill(rechit_x-sim_x);
1237  mehSiPixelResY[4]->Fill(rechit_y-sim_y);
1238  }
1239  }
1240  if (tTopo->pxfDisk(myid) == 2) {
1241  if (tTopo->pxfSide(myid) == 1) {
1242  mehSiPixelResX[5]->Fill(rechit_x-sim_x);
1243  mehSiPixelResY[5]->Fill(rechit_y-sim_y);
1244  }
1245  if (tTopo->pxfSide(myid) == 2) {
1246  mehSiPixelResX[6]->Fill(rechit_x-sim_x);
1247  mehSiPixelResY[6]->Fill(rechit_y-sim_y);
1248  }
1249  }
1250  }
1251  } // end matched emtpy
1252  } // <-----end rechit loop
1253  } // <------ end detunit loop
1254 
1255 
1256  if (verbosity > 1) {
1257  eventout += "\n Number of BrlPixelRecHits collected:...... ";
1258  eventout += nPxlBrl;
1259  }
1260  for(int i=0; i<3; ++i) {
1261  mehSiPixeln[i]->Fill((float)nPxlBrl);
1262  }
1263 
1264  if (verbosity > 1) {
1265  eventout += "\n Number of FrwdPixelRecHits collected:..... ";
1266  eventout += nPxlFwd;
1267  }
1268 
1269  for(int i=3; i<7; ++i) {
1270  mehSiPixeln[i]->Fill((float)nPxlFwd);
1271  }
1272  }
1273 
1274  if (verbosity > 0)
1275  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1276 
1277  return;
1278 }
#define LogDebug(id)
edm::EDGetTokenT< SiPixelRecHitCollection > SiPxlSrc_Token_
int i
Definition: DBlmapReader.cc:9
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
unsigned int tibLayer(const DetId &id) const
std::vector< PSimHit > matched
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
unsigned int pxfDisk(const DetId &id) const
static const int sdSiTID
T y() const
Definition: PV3DBase.h:63
unsigned int tidWheel(const DetId &id) const
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
MonitorElement * mehSiStripn[19]
void Fill(long long x)
static const int sdSiTIB
static const int sdPxlBrl
T sqrt(T t)
Definition: SSEVec.h:48
MonitorElement * mehSiPixelResX[7]
static const int sdSiTOB
MonitorElement * mehSiPixelResY[7]
MonitorElement * mehSiStripResY[19]
bool isValid() const
Definition: HandleBase.h:75
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
unsigned int pxbLayer(const DetId &id) const
Definition: DetId.h:18
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
MonitorElement * mehSiPixeln[7]
static const int sdSiTEC
iterator end()
Definition: DetSetNew.h:70
static int position[264][3]
Definition: ReadPGInfo.cc:509
unsigned int pxfSide(const DetId &id) const
static const int sdPxlFwd
DetId geographicalId() const
bool isValid() const
Definition: ESHandle.h:47
T x() const
Definition: PV3DBase.h:62
virtual LocalPoint localPosition() const
unsigned int tecWheel(const DetId &id) const
MonitorElement * mehSiStripResX[19]
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21
unsigned int tobLayer(const DetId &id) const
iterator begin()
Definition: DetSetNew.h:67
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > SiStripSrc_Token_
template<typename type >
const type * GlobalRecHitsAnalyzer::findBestRecHit ( const DTLayer layer,
DTWireId  wireId,
const std::vector< type > &  recHits,
const float  simHitDist 
)
private

Definition at line 1575 of file GlobalRecHitsAnalyzer.cc.

References recHitDistFromWire().

Referenced by compute().

1578  {
1579  float res = 99999;
1580  const type* theBestRecHit = 0;
1581  // Loop over RecHits within the cell
1582  for(typename std::vector<type>::const_iterator recHit = recHits.begin();
1583  recHit != recHits.end();
1584  recHit++) {
1585  float distTmp = recHitDistFromWire(*recHit, layer);
1586  if(fabs(distTmp-simHitDist) < res) {
1587  res = fabs(distTmp-simHitDist);
1588  theBestRecHit = &(*recHit);
1589  }
1590  } // End of loop over RecHits within the cell
1591 
1592  return theBestRecHit;
1593 }
type
Definition: HCALResponse.h:21
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
std::map< DTWireId, std::vector< DTRecHit1DPair > > GlobalRecHitsAnalyzer::map1DRecHitsPerWire ( const DTRecHitCollection dt1DRecHitPairs)
private

Definition at line 1546 of file GlobalRecHitsAnalyzer.cc.

References run_regression::ret.

Referenced by fillMuon().

1547  {
1548  std::map<DTWireId, std::vector<DTRecHit1DPair> > ret;
1549 
1550  for(DTRecHitCollection::const_iterator rechit = dt1DRecHitPairs->begin();
1551  rechit != dt1DRecHitPairs->end(); rechit++) {
1552  ret[(*rechit).wireId()].push_back(*rechit);
1553  }
1554 
1555  return ret;
1556 }
void GlobalRecHitsAnalyzer::plotResolution ( const PSimHit simHit,
const CSCRecHit2D recHit,
const CSCLayer layer,
int  chamberType 
)
private

Definition at line 1671 of file GlobalRecHitsAnalyzer.cc.

References MonitorElement::Fill(), PSimHit::localPosition(), CSCRecHit2D::localPosition(), mehCSCResRDPhi, PV3DBase< T, PVType, FrameType >::phi(), and GeomDet::toGlobal().

Referenced by fillMuon().

1674  {
1675  GlobalPoint simHitPos = layer->toGlobal(simHit.localPosition());
1676  GlobalPoint recHitPos = layer->toGlobal(recHit.localPosition());
1677 
1678  mehCSCResRDPhi->Fill(recHitPos.phi()-simHitPos.phi());
1679 }
MonitorElement * mehCSCResRDPhi
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:52
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
void Fill(long long x)
Local3DPoint localPosition() const
Definition: PSimHit.h:44
LocalPoint localPosition() const
Definition: CSCRecHit2D.h:50
std::pair< LocalPoint, LocalVector > GlobalRecHitsAnalyzer::projectHit ( const PSimHit hit,
const StripGeomDetUnit stripDet,
const BoundPlane plane 
)
private

Definition at line 1515 of file GlobalRecHitsAnalyzer.cc.

References funct::cos(), dir, PSimHit::localDirection(), PSimHit::localPosition(), pileupReCalc_HLTpaths::scale, funct::sin(), StripGeomDetUnit::specificTopology(), StripTopology::strip(), StripTopology::stripAngle(), GeomDet::surface(), Surface::toGlobal(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by fillTrk().

1518 {
1519 
1520  const StripTopology& topol = stripDet->specificTopology();
1521  GlobalPoint globalpos= stripDet->surface().toGlobal(hit.localPosition());
1522  LocalPoint localHit = plane.toLocal(globalpos);
1523  //track direction
1524  LocalVector locdir=hit.localDirection();
1525  //rotate track in new frame
1526 
1527  GlobalVector globaldir= stripDet->surface().toGlobal(locdir);
1528  LocalVector dir=plane.toLocal(globaldir);
1529  float scale = -localHit.z() / dir.z();
1530 
1531  LocalPoint projectedPos = localHit + scale*dir;
1532 
1533  float selfAngle = topol.stripAngle( topol.strip( hit.localPosition()));
1534 
1535  // vector along strip in hit frame
1536  LocalVector stripDir( sin(selfAngle), cos(selfAngle), 0);
1537 
1538  LocalVector
1539  localStripDir(plane.toLocal(stripDet->surface().toGlobal(stripDir)));
1540 
1541  return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
1542 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
virtual float stripAngle(float strip) const =0
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
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
virtual float strip(const LocalPoint &) const =0
Local3DPoint localPosition() const
Definition: PSimHit.h:44
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
Definition: PSimHit.h:52
dbl *** dir
Definition: mlp_gen.cc:35
float GlobalRecHitsAnalyzer::recHitDistFromWire ( const DTRecHit1DPair hitPair,
const DTLayer layer 
)
private

Definition at line 1597 of file GlobalRecHitsAnalyzer.cc.

References DTEnums::Left, DTRecHit1DPair::localPosition(), DTEnums::Right, and PV3DBase< T, PVType, FrameType >::x().

Referenced by compute(), and findBestRecHit().

1598  {
1599  // Compute the rechit distance from wire
1600  return fabs(hitPair.localPosition(DTEnums::Left).x() -
1601  hitPair.localPosition(DTEnums::Right).x())/2.;
1602 }
T x() const
Definition: PV3DBase.h:62
virtual LocalPoint localPosition() const
float GlobalRecHitsAnalyzer::recHitDistFromWire ( const DTRecHit1D recHit,
const DTLayer layer 
)
private

Definition at line 1606 of file GlobalRecHitsAnalyzer.cc.

References DTRecHit1D::localPosition(), DTLayer::specificTopology(), DTWireId::wire(), DTRecHit1D::wireId(), DTTopology::wirePosition(), and PV3DBase< T, PVType, FrameType >::x().

1607  {
1608  return fabs(recHit.localPosition().x() -
1609  layer->specificTopology().wirePosition(recHit.wireId().wire()));
1610 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:60
int wire() const
Return the wire number.
Definition: DTWireId.h:56
T x() const
Definition: PV3DBase.h:62
DTWireId wireId() const
Return the wireId.
Definition: DTRecHit1D.h:107
float GlobalRecHitsAnalyzer::simHitDistFromWire ( const DTLayer layer,
DTWireId  wireId,
const PSimHit hit 
)
private

Definition at line 1559 of file GlobalRecHitsAnalyzer.cc.

References PSimHit::entryPoint(), PSimHit::exitPoint(), DTLayer::specificTopology(), DTWireId::wire(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by compute().

1561  {
1562  float xwire = layer->specificTopology().wirePosition(wireId.wire());
1563  LocalPoint entryP = hit.entryPoint();
1564  LocalPoint exitP = hit.exitPoint();
1565  float xEntry = entryP.x()-xwire;
1566  float xExit = exitP.x()-xwire;
1567 
1568  //FIXME: check...
1569  return fabs(xEntry - (entryP.z()*(xExit-xEntry))/(exitP.z()-entryP.z()));
1570 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:38
T z() const
Definition: PV3DBase.h:64
int wire() const
Return the wire number.
Definition: DTWireId.h:56
T x() const
Definition: PV3DBase.h:62
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:35

Member Data Documentation

edm::ParameterSet GlobalRecHitsAnalyzer::conf_
private

Definition at line 224 of file GlobalRecHitsAnalyzer.h.

Referenced by fillTrk(), and GlobalRecHitsAnalyzer().

unsigned int GlobalRecHitsAnalyzer::count
private

Definition at line 301 of file GlobalRecHitsAnalyzer.h.

Referenced by analyze().

edm::EDGetTokenT<CrossingFrame<PCaloHit> > GlobalRecHitsAnalyzer::EBHits_Token_
private

Definition at line 197 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalEBSrc_
private

Definition at line 187 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<EBRecHitCollection> GlobalRecHitsAnalyzer::ECalEBSrc_Token_
private

Definition at line 192 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalEESrc_
private

Definition at line 189 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<EERecHitCollection> GlobalRecHitsAnalyzer::ECalEESrc_Token_
private

Definition at line 193 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalESSrc_
private

Definition at line 191 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<ESRecHitCollection> GlobalRecHitsAnalyzer::ECalESSrc_Token_
private

Definition at line 194 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalUncalEBSrc_
private

Definition at line 188 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<EBUncalibratedRecHitCollection> GlobalRecHitsAnalyzer::ECalUncalEBSrc_Token_
private

Definition at line 195 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::ECalUncalEESrc_
private

Definition at line 190 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<EEUncalibratedRecHitCollection> GlobalRecHitsAnalyzer::ECalUncalEESrc_Token_
private

Definition at line 196 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::EDGetTokenT<CrossingFrame<PCaloHit> > GlobalRecHitsAnalyzer::EEHits_Token_
private

Definition at line 198 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

edm::EDGetTokenT<CrossingFrame<PCaloHit> > GlobalRecHitsAnalyzer::ESHits_Token_
private

Definition at line 199 of file GlobalRecHitsAnalyzer.h.

Referenced by fillECal(), and GlobalRecHitsAnalyzer().

std::string GlobalRecHitsAnalyzer::fName
private

Definition at line 173 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

int GlobalRecHitsAnalyzer::frequency
private

Definition at line 175 of file GlobalRecHitsAnalyzer.h.

Referenced by analyze(), and GlobalRecHitsAnalyzer().

bool GlobalRecHitsAnalyzer::getAllProvenances
private

Definition at line 177 of file GlobalRecHitsAnalyzer.h.

Referenced by analyze(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::HCalSrc_
private

Definition at line 206 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<edm::PCaloHitContainer> GlobalRecHitsAnalyzer::HCalSrc_Token_
private

Definition at line 207 of file GlobalRecHitsAnalyzer.h.

Referenced by fillHCal(), and GlobalRecHitsAnalyzer().

std::string GlobalRecHitsAnalyzer::hitsProducer
private

Definition at line 179 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

std::string GlobalRecHitsAnalyzer::label
private
std::vector<PSimHit> GlobalRecHitsAnalyzer::matched
private

Definition at line 219 of file GlobalRecHitsAnalyzer.h.

Referenced by fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehCSCn
private

Definition at line 239 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillMuon().

MonitorElement* GlobalRecHitsAnalyzer::mehCSCResRDPhi
private

Definition at line 242 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and plotResolution().

MonitorElement* GlobalRecHitsAnalyzer::mehDtMuonn
private

Definition at line 238 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillMuon().

MonitorElement* GlobalRecHitsAnalyzer::mehDtMuonRes
private

Definition at line 241 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and compute().

MonitorElement* GlobalRecHitsAnalyzer::mehEcaln[3]
private

Definition at line 184 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillECal().

MonitorElement* GlobalRecHitsAnalyzer::mehEcalRes[3]
private

Definition at line 185 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillECal().

MonitorElement* GlobalRecHitsAnalyzer::mehHcaln[4]
private

Definition at line 203 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillHCal().

MonitorElement* GlobalRecHitsAnalyzer::mehHcalRes[4]
private

Definition at line 204 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillHCal().

MonitorElement* GlobalRecHitsAnalyzer::mehRPCn
private

Definition at line 240 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillMuon().

MonitorElement* GlobalRecHitsAnalyzer::mehRPCResX
private

Definition at line 243 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillMuon().

MonitorElement* GlobalRecHitsAnalyzer::mehSiPixeln[7]
private

Definition at line 228 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiPixelResX[7]
private

Definition at line 229 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiPixelResY[7]
private

Definition at line 230 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiStripn[19]
private

Definition at line 212 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiStripResX[19]
private

Definition at line 213 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

MonitorElement* GlobalRecHitsAnalyzer::mehSiStripResY[19]
private

Definition at line 214 of file GlobalRecHitsAnalyzer.h.

Referenced by bookHistograms(), and fillTrk().

edm::EDGetTokenT<CrossingFrame<PSimHit> > GlobalRecHitsAnalyzer::MuCSCHits_Token_
private

Definition at line 285 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuCSCSrc_
private

Definition at line 283 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<CSCRecHit2DCollection> GlobalRecHitsAnalyzer::MuCSCSrc_Token_
private

Definition at line 284 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuDTSimSrc_
private

Definition at line 246 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<edm::PSimHitContainer> GlobalRecHitsAnalyzer::MuDTSimSrc_Token_
private

Definition at line 248 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuDTSrc_
private

Definition at line 245 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<DTRecHitCollection> GlobalRecHitsAnalyzer::MuDTSrc_Token_
private

Definition at line 247 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuRPCSimSrc_
private

Definition at line 296 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<edm::PSimHitContainer> GlobalRecHitsAnalyzer::MuRPCSimSrc_Token_
private

Definition at line 298 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::MuRPCSrc_
private

Definition at line 295 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<RPCRecHitCollection> GlobalRecHitsAnalyzer::MuRPCSrc_Token_
private

Definition at line 297 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon(), and GlobalRecHitsAnalyzer().

bool GlobalRecHitsAnalyzer::printProvenanceInfo
private

Definition at line 178 of file GlobalRecHitsAnalyzer.h.

Referenced by analyze(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::SiPxlSrc_
private

Definition at line 232 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<SiPixelRecHitCollection> GlobalRecHitsAnalyzer::SiPxlSrc_Token_
private

Definition at line 233 of file GlobalRecHitsAnalyzer.h.

Referenced by fillTrk(), and GlobalRecHitsAnalyzer().

edm::InputTag GlobalRecHitsAnalyzer::SiStripSrc_
private

Definition at line 216 of file GlobalRecHitsAnalyzer.h.

Referenced by GlobalRecHitsAnalyzer().

edm::EDGetTokenT<SiStripMatchedRecHit2DCollection> GlobalRecHitsAnalyzer::SiStripSrc_Token_
private

Definition at line 217 of file GlobalRecHitsAnalyzer.h.

Referenced by fillTrk(), and GlobalRecHitsAnalyzer().

std::map<int, edm::PSimHitContainer> GlobalRecHitsAnalyzer::theMap
private

Definition at line 287 of file GlobalRecHitsAnalyzer.h.

Referenced by fillMuon().

int GlobalRecHitsAnalyzer::verbosity
private