25 #include "TLorentzVector.h" 59 histname =
"InvariantMass_";
60 invariantMass_ = iBooker.
book1D(histname + AlgoName, histname + AlgoName, MassBin, MassMin, MassMax);
70 histname =
"TrackPtPositive_";
72 histname + AlgoName, histname + AlgoName, TrackPtPositiveBin, TrackPtPositiveMin, TrackPtPositiveMax);
79 histname =
"TrackPtNegative_";
81 histname + AlgoName, histname + AlgoName, TrackPtNegativeBin, TrackPtNegativeMin, TrackPtNegativeMax);
84 histname =
"TrackQuality_";
97 histname =
"SumCharge_";
98 sumCharge_ = iBooker.
book1D(histname + AlgoName, histname + AlgoName, SumChargeBin, SumChargeMin, SumChargeMax);
101 unsigned int TrackCurvatureBin =
conf_.
getParameter<
unsigned int>(
"TrackCurvatureBin");
105 histname =
"TrackCurvature_";
107 iBooker.
book1D(histname + AlgoName, histname + AlgoName, TrackCurvatureBin, TrackCurvatureMin, TrackCurvatureMax);
116 jetPt_ = iBooker.
book1D(histname + AlgoName, histname + AlgoName, JetPtBin, JetPtMin, JetPtMax);
119 unsigned int MinJetDeltaRBin =
conf_.
getParameter<
unsigned int>(
"MinJetDeltaRBin");
123 histname =
"MinJetDeltaR_";
125 iBooker.
book1D(histname + AlgoName, histname + AlgoName, MinJetDeltaRBin, MinJetDeltaRMin, MinJetDeltaRMax);
132 unsigned int MinTrackDeltaRBin =
conf_.
getParameter<
unsigned int>(
"MinTrackDeltaRBin");
136 histname =
"MinTrackDeltaR_";
138 iBooker.
book1D(histname + AlgoName, histname + AlgoName, MinTrackDeltaRBin, MinTrackDeltaRMin, MinTrackDeltaRMax);
141 unsigned int TrackEfficiencyBin =
conf_.
getParameter<
unsigned int>(
"TrackEfficiencyBin");
145 histname =
"AlCaRecoTrackEfficiency_";
147 histname + AlgoName, histname + AlgoName, TrackEfficiencyBin, TrackEfficiencyMin, TrackEfficiencyMax);
159 histname =
"Hits_ZvsR_";
164 Hits_ZvsR_ = iBooker.
book2D(histname + AlgoName, histname + AlgoName, zBin, -zMax, zMax, rBin, rMin, rMax);
166 histname =
"Hits_XvsY_";
167 Hits_XvsY_ = iBooker.
book2D(histname + AlgoName, histname + AlgoName, rBin, -rMax, rMax, rBin, -rMax, rMax);
170 histname =
"Hits_perDetId_";
177 Hits_perDetId_ = iBooker.
book1D(histname + AlgoName, histname + AlgoName, 16601, -0.5, 16600.5);
197 if (!trackCollection.
isValid()) {
198 edm::LogError(
"Alignment") <<
"invalid trackcollection encountered!";
204 if (!trackCollection.
isValid()) {
205 edm::LogError(
"Alignment") <<
"invalid reference track-collection encountered!";
212 edm::LogError(
"Alignment") <<
"invalid geometry found in event setup!";
217 if (!magneticField.
isValid()) {
218 edm::LogError(
"Alignment") <<
"invalid magnetic field configuration encountered!";
226 edm::LogError(
"Alignment") <<
"no jet collection found in event!";
235 double sumOfCharges = 0;
236 for (reco::TrackCollection::const_iterator
track = (*trackCollection).begin();
track < (*trackCollection).end();
241 for (reco::CaloJetCollection::const_iterator itJet = jets->begin(); itJet != jets->end(); ++itJet) {
253 double minTrackDeltaR = 10;
254 for (reco::TrackCollection::const_iterator track2 = (*trackCollection).begin(); track2 < (*trackCollection).end();
257 if (dR < minTrackDeltaR && dR > 1
e-6)
267 GlobalPoint gPoint((*track).vx(), (*track).vy(), (*track).vz());
268 double B = magneticField->
inTesla(gPoint).
z();
269 double curv = -(*track).charge() * 0.002998 * B / (*track).pt();
272 if ((*track).charge() > 0)
274 if ((*track).charge() < 0)
279 sumOfCharges += (*track).charge();
285 if ((*trackCollection).size() == 2) {
286 TLorentzVector track0(
287 (*trackCollection).at(0).px(),
288 (*trackCollection).at(0).py(),
289 (*trackCollection).at(0).pz(),
291 TLorentzVector track1(
292 (*trackCollection).at(1).px(),
293 (*trackCollection).at(1).py(),
294 (*trackCollection).at(1).pz(),
295 sqrt(((*trackCollection).at(1).p() * (*trackCollection).at(1).p()) + daughterMass_ * daughterMass_));
296 TLorentzVector mother = track0 + track1;
300 edm::LogInfo(
"Alignment") <<
"wrong number of tracks trackcollection encountered: " << (*trackCollection).size();
307 if ((*iHit)->isValid()) {
316 double r =
sqrt(globP.x() * globP.x() + globP.y() * globP.y());
318 r *= globP.y() / fabs(globP.y());
330 std::vector<int> sortedRawIds;
331 for (std::vector<DetId>::const_iterator iDetId = geometry.
detUnitIds().begin(); iDetId != geometry.
detUnitIds().end();
333 sortedRawIds.push_back((*iDetId).rawId());
335 std::sort(sortedRawIds.begin(), sortedRawIds.end());
338 for (std::vector<int>::iterator iRawId = sortedRawIds.begin(); iRawId != sortedRawIds.end(); ++iRawId) {
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
std::map< int, int > binByRawId_
T getParameter(std::string const &) const
static std::string qualityName(TrackQuality)
void analyze(const edm::Event &, const edm::EventSetup &) override
void fillRawIdMap(const TrackerGeometry &geometry)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TrackQuality
track quality
MonitorElement * TrackQuality_
~TkAlCaRecoMonitor() override
MonitorElement * minJetDeltaR_
MonitorElement * Hits_XvsY_
MonitorElement * Hits_ZvsR_
MonitorElement * AlCaRecoTrackEfficiency_
MonitorElement * sumCharge_
#define DEFINE_FWK_MODULE(type)
void setCurrentFolder(std::string const &fullpath)
edm::EDGetTokenT< reco::TrackCollection > trackProducer_
MonitorElement * invariantMass_
MonitorElement * book1D(Args &&...args)
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.
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
MonitorElement * Hits_perDetId_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * book2D(Args &&...args)
MonitorElement * TrackCurvature_
ESHandle< TrackerGeometry > geometry
MonitorElement * minTrackDeltaR_
const TrackerGeomDet * idToDet(DetId) const override
DetId geographicalId() const
edm::EDGetTokenT< reco::TrackCollection > referenceTrackProducer_
MonitorElement * TrackPtPositive_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
TkAlCaRecoMonitor(const edm::ParameterSet &)
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.