25 #include "TLorentzVector.h"
61 histname =
"InvariantMass_";
72 histname =
"TrackPtPositive_";
80 histname =
"TrackPtNegative_";
84 histname =
"TrackQuality_";
97 histname =
"SumCharge_";
101 unsigned int TrackCurvatureBin =
conf_.
getParameter<
unsigned int>(
"TrackCurvatureBin");
105 histname =
"TrackCurvature_";
119 unsigned int MinJetDeltaRBin =
conf_.
getParameter<
unsigned int>(
"MinJetDeltaRBin");
123 histname =
"MinJetDeltaR_";
131 unsigned int MinTrackDeltaRBin =
conf_.
getParameter<
unsigned int>(
"MinTrackDeltaRBin");
135 histname =
"MinTrackDeltaR_";
139 unsigned int TrackEfficiencyBin =
conf_.
getParameter<
unsigned int>(
"TrackEfficiencyBin");
143 histname =
"AlCaRecoTrackEfficiency_";
156 histname =
"Hits_ZvsR_";
163 histname =
"Hits_XvsY_";
167 histname =
"Hits_perDetId_";
191 if (!trackCollection.
isValid()){
192 edm::LogError(
"Alignment")<<
"invalid trackcollection encountered!";
198 if (!trackCollection.
isValid()){
199 edm::LogError(
"Alignment")<<
"invalid reference track-collection encountered!";
206 edm::LogError(
"Alignment")<<
"invalid geometry found in event setup!";
212 edm::LogError(
"Alignment")<<
"invalid magnetic field configuration encountered!";
220 edm::LogError(
"Alignment")<<
"no jet collection found in event!";
228 double sumOfCharges = 0;
229 for( reco::TrackCollection::const_iterator track = (*trackCollection).begin(); track < (*trackCollection).end(); ++track ){
232 double minJetDeltaR = 10;
233 for(reco::CaloJetCollection::const_iterator itJet = jets->begin(); itJet != jets->end() ; ++itJet) {
235 dR =
deltaR((*track),(*itJet));
236 if((*itJet).pt() >
maxJetPt_ && dR < minJetDeltaR)
244 double minTrackDeltaR = 10;
245 for( reco::TrackCollection::const_iterator track2 = (*trackCollection).begin(); track2 < (*trackCollection).end(); ++track2 ){
246 dR =
deltaR((*track),(*track2));
247 if(dR < minTrackDeltaR && dR > 1
e-6)
257 GlobalPoint gPoint((*track).vx(), (*track).vy(), (*track).vz());
258 double B = magneticField->inTesla(gPoint).z();
259 double curv = -(*track).charge()*0.002998*B/(*track).pt();
262 if( (*track).charge() > 0 )
264 if( (*track).charge() < 0 )
269 sumOfCharges += (*track).charge();
275 if((*trackCollection).size() == 2){
276 TLorentzVector track0((*trackCollection).at(0).px(),(*trackCollection).at(0).py(),(*trackCollection).at(0).pz(),
278 TLorentzVector track1((*trackCollection).at(1).px(),(*trackCollection).at(1).py(),(*trackCollection).at(1).pz(),
279 sqrt(((*trackCollection).at(1).p()*(*trackCollection).at(1).p())+daughterMass_*daughterMass_));
280 TLorentzVector mother = track0+track1;
284 edm::LogInfo(
"Alignment")<<
"wrong number of tracks trackcollection encountered: "<<(*trackCollection).size();
292 if( (*iHit)->isValid() ){
300 double r =
sqrt( globP.x()*globP.x() + globP.y()*globP.y() );
302 r*= globP.y() / fabs( globP.y() );
315 std::vector<int> sortedRawIds;
316 for (std::vector<DetId>::const_iterator iDetId = geometry.
detUnitIds().begin();
317 iDetId != geometry.
detUnitIds().end(); ++iDetId) {
318 sortedRawIds.push_back((*iDetId).rawId());
320 std::sort(sortedRawIds.begin(), sortedRawIds.end());
323 for (std::vector<int>::iterator iRawId = sortedRawIds.begin();
324 iRawId != sortedRawIds.end(); ++iRawId){
334 if(outputMEsInRootFile){
T getParameter(std::string const &) const
static std::string qualityName(TrackQuality)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void fillRawIdMap(const TrackerGeometry &geometry)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TrackQuality
track quality
#define DEFINE_FWK_MODULE(type)
MonitorElement * TrackQuality_
MonitorElement * minJetDeltaR_
std::map< int, int > binByRawId_
MonitorElement * Hits_XvsY_
MonitorElement * Hits_ZvsR_
MonitorElement * AlCaRecoTrackEfficiency_
MonitorElement * sumCharge_
virtual void endJob(void)
edm::EDGetTokenT< reco::TrackCollection > trackProducer_
MonitorElement * invariantMass_
MonitorElement * TrackPtNegative_
void fillHitmaps(const reco::Track &track, const TrackerGeometry &geometry)
edm::EDGetTokenT< reco::CaloJetCollection > jetCollection_
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
double deltaR(double eta1, double eta2, double phi1, double phi2)
MonitorElement * Hits_perDetId_
MonitorElement * TrackCurvature_
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
ESHandle< TrackerGeometry > geometry
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
MonitorElement * minTrackDeltaR_
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
DetId geographicalId() const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
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)
void setCurrentFolder(const std::string &fullpath)
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
TkAlCaRecoMonitor(const edm::ParameterSet &)
virtual const TrackerGeomDet * idToDet(DetId) const
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.