23 #include "TLorentzVector.h"
58 histname =
"InvariantMass_";
59 invariantMass_ = iBooker.
book1D(histname + AlgoName, histname + AlgoName, MassBin, MassMin, MassMax);
69 histname =
"TrackPtPositive_";
71 histname + AlgoName, histname + AlgoName, TrackPtPositiveBin, TrackPtPositiveMin, TrackPtPositiveMax);
78 histname =
"TrackPtNegative_";
80 histname + AlgoName, histname + AlgoName, TrackPtNegativeBin, TrackPtNegativeMin, TrackPtNegativeMax);
83 histname =
"TrackQuality_";
96 histname =
"SumCharge_";
97 sumCharge_ = iBooker.
book1D(histname + AlgoName, histname + AlgoName, SumChargeBin, SumChargeMin, SumChargeMax);
100 unsigned int TrackCurvatureBin =
conf_.
getParameter<
unsigned int>(
"TrackCurvatureBin");
104 histname =
"TrackCurvature_";
106 iBooker.
book1D(histname + AlgoName, histname + AlgoName, TrackCurvatureBin, TrackCurvatureMin, TrackCurvatureMax);
115 jetPt_ = iBooker.
book1D(histname + AlgoName, histname + AlgoName, JetPtBin, JetPtMin, JetPtMax);
118 unsigned int MinJetDeltaRBin =
conf_.
getParameter<
unsigned int>(
"MinJetDeltaRBin");
122 histname =
"MinJetDeltaR_";
124 iBooker.
book1D(histname + AlgoName, histname + AlgoName, MinJetDeltaRBin, MinJetDeltaRMin, MinJetDeltaRMax);
131 unsigned int MinTrackDeltaRBin =
conf_.
getParameter<
unsigned int>(
"MinTrackDeltaRBin");
135 histname =
"MinTrackDeltaR_";
137 iBooker.
book1D(histname + AlgoName, histname + AlgoName, MinTrackDeltaRBin, MinTrackDeltaRMin, MinTrackDeltaRMax);
140 unsigned int TrackEfficiencyBin =
conf_.
getParameter<
unsigned int>(
"TrackEfficiencyBin");
144 histname =
"AlCaRecoTrackEfficiency_";
146 histname + AlgoName, histname + AlgoName, TrackEfficiencyBin, TrackEfficiencyMin, TrackEfficiencyMax);
158 histname =
"Hits_ZvsR_";
163 Hits_ZvsR_ = iBooker.
book2D(histname + AlgoName, histname + AlgoName, zBin, -zMax, zMax, rBin, rMin, rMax);
165 histname =
"Hits_XvsY_";
166 Hits_XvsY_ = iBooker.
book2D(histname + AlgoName, histname + AlgoName, rBin, -rMax, rMax, rBin, -rMax, rMax);
169 histname =
"Hits_perDetId_";
176 Hits_perDetId_ = iBooker.
book1D(histname + AlgoName, histname + AlgoName, 16601, -0.5, 16600.5);
196 if (!trackCollection.
isValid()) {
197 edm::LogError(
"Alignment") <<
"invalid trackcollection encountered!";
203 if (!trackCollection.
isValid()) {
204 edm::LogError(
"Alignment") <<
"invalid reference track-collection encountered!";
210 edm::LogError(
"Alignment") <<
"invalid geometry found in event setup!";
215 edm::LogError(
"Alignment") <<
"invalid magnetic field configuration encountered!";
223 edm::LogError(
"Alignment") <<
"no jet collection found in event!";
232 double sumOfCharges = 0;
233 for (reco::TrackCollection::const_iterator
track = (*trackCollection).begin();
track < (*trackCollection).end();
238 for (reco::CaloJetCollection::const_iterator itJet = jets->begin(); itJet != jets->end(); ++itJet) {
250 double minTrackDeltaR = 10;
251 for (reco::TrackCollection::const_iterator track2 = (*trackCollection).begin(); track2 < (*trackCollection).end();
254 if (dR < minTrackDeltaR && dR > 1
e-6)
264 GlobalPoint gPoint((*track).vx(), (*track).vy(), (*track).vz());
266 double curv = -(*track).charge() * 0.002998 * B / (*track).pt();
269 if ((*track).charge() > 0)
271 if ((*track).charge() < 0)
276 sumOfCharges += (*track).charge();
282 if ((*trackCollection).size() == 2) {
283 TLorentzVector track0(
284 (*trackCollection).at(0).px(),
285 (*trackCollection).at(0).py(),
286 (*trackCollection).at(0).pz(),
288 TLorentzVector track1(
289 (*trackCollection).at(1).px(),
290 (*trackCollection).at(1).py(),
291 (*trackCollection).at(1).pz(),
292 sqrt(((*trackCollection).at(1).p() * (*trackCollection).at(1).p()) + daughterMass_ * daughterMass_));
293 TLorentzVector mother = track0 + track1;
297 edm::LogInfo(
"Alignment") <<
"wrong number of tracks trackcollection encountered: " << (*trackCollection).size();
304 if ((*iHit)->isValid()) {
313 double r =
sqrt(globP.x() * globP.x() + globP.y() * globP.y());
315 r *= globP.y() / fabs(globP.y());
327 std::vector<int> sortedRawIds;
328 for (std::vector<DetId>::const_iterator iDetId = geometry.
detUnitIds().begin(); iDetId != geometry.
detUnitIds().end();
330 sortedRawIds.push_back((*iDetId).rawId());
332 std::sort(sortedRawIds.begin(), sortedRawIds.end());
335 for (std::vector<int>::iterator iRawId = sortedRawIds.begin(); iRawId != sortedRawIds.end(); ++iRawId) {
std::map< int, int > binByRawId_
static std::string qualityName(TrackQuality)
void analyze(const edm::Event &, const edm::EventSetup &) override
virtual void setCurrentFolder(std::string const &fullpath)
void fillRawIdMap(const TrackerGeometry &geometry)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TrackQuality
track quality
#define DEFINE_FWK_MODULE(type)
MonitorElement * TrackQuality_
~TkAlCaRecoMonitor() override
MonitorElement * minJetDeltaR_
Log< level::Error, false > LogError
MonitorElement * Hits_XvsY_
MonitorElement * Hits_ZvsR_
MonitorElement * AlCaRecoTrackEfficiency_
MonitorElement * sumCharge_
edm::EDGetTokenT< reco::TrackCollection > trackProducer_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
MonitorElement * invariantMass_
MonitorElement * TrackPtNegative_
void fillHitmaps(const reco::Track &track, const TrackerGeometry &geometry)
edm::EDGetTokenT< reco::CaloJetCollection > jetCollection_
static const std::string B
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
const TrackerGeomDet * idToDet(DetId) const override
Log< level::Info, false > LogInfo
MonitorElement * Hits_perDetId_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * TrackCurvature_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
T getParameter(std::string const &) const
MonitorElement * minTrackDeltaR_
DetId geographicalId() const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
edm::EDGetTokenT< reco::TrackCollection > referenceTrackProducer_
MonitorElement * TrackPtPositive_
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
TkAlCaRecoMonitor(const edm::ParameterSet &)
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)