Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62206
b: refs/heads/l1tmuon-upgrade-dev
c: 690a4df
h: refs/heads/l1tmuon-upgrade-dev
  • Loading branch information
Matthias Edelhoff committed Mar 17, 2009
1 parent 6571343 commit a03719d
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/l1tmuon-upgrade-dev: da4beef1e275ffe4c1fb89e515c14dd436d190b4
refs/heads/l1tmuon-upgrade-dev: 690a4df87fff6b3e45f825c46105474860e3ae0a
5 changes: 5 additions & 0 deletions trunk/DQMOffline/Alignment/interface/TkAlCaRecoMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,17 @@ class TkAlCaRecoMonitor : public edm::EDAnalyzer {
MonitorElement* jetPt_;
MonitorElement* minJetDeltaR_;
MonitorElement* minTrackDeltaR_;
MonitorElement* AlCaRecoTrackEfficiency_;
//2D
MonitorElement* Hits_ZvsR_;
MonitorElement* Hits_XvsY_;

bool fillInvariantMass_;
bool runsOnReco_;
bool useSignedR_;

edm::InputTag trackProducer_;
edm::InputTag referenceTrackProducer_;

};
#endif
45 changes: 39 additions & 6 deletions trunk/DQMOffline/Alignment/python/ALCARECOTkAlDQM_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,15 @@
TrackPtMin = cms.double(0),
TrackPtMax = cms.double(500)
)
ALCARECOTkAlCosmicsCTF0TDQM = cms.Sequence( ALCARECOTkAlCosmicsCTF0TTrackingDQM )
ALCARECOTkAlCosmicsCTF0TTkAlDQM = ALCARECOTkAlMinBiasTkAlDQM.clone(
#names and desigantions
TrackProducer = 'ALCARECO'+__selectionName,
AlgoName = 'ALCARECO'+__selectionName,
FolderName = 'TkAlCosmics',
# margins and settings
useSignedR = cms.bool(True)
)
ALCARECOTkAlCosmicsCTF0TDQM = cms.Sequence( ALCARECOTkAlCosmicsCTF0TTrackingDQM + ALCARECOTkAlCosmicsCTF0TTkAlDQM)

### TkAlCosmicsCosmicTF0T ###
__selectionName = 'TkAlCosmicsCosmicTF0T'
Expand All @@ -153,7 +161,12 @@
TrackProducer = 'ALCARECO'+__selectionName,
AlgoName = 'ALCARECO'+__selectionName
)
ALCARECOTkAlCosmicsCosmicTF0TDQM = cms.Sequence( ALCARECOTkAlCosmicsCosmicTF0TTrackingDQM )
ALCARECOTkAlCosmicsCosmicTF0TTkAlDQM = ALCARECOTkAlCosmicsCTF0TTkAlDQM.clone(
#names and desigantions
TrackProducer = 'ALCARECO'+__selectionName,
AlgoName = 'ALCARECO'+__selectionName
)
ALCARECOTkAlCosmicsCosmicTF0TDQM = cms.Sequence( ALCARECOTkAlCosmicsCosmicTF0TTrackingDQM + ALCARECOTkAlCosmicsCosmicTF0TTkAlDQM )

### TkAlCosmicsRS0T ###
__selectionName = 'TkAlCosmicsRS0T'
Expand All @@ -162,7 +175,12 @@
TrackProducer = 'ALCARECO'+__selectionName,
AlgoName = 'ALCARECO'+__selectionName
)
ALCARECOTkAlCosmicsRS0TDQM = cms.Sequence( ALCARECOTkAlCosmicsRS0TTrackingDQM )
ALCARECOTkAlCosmicsRS0TTkAlDQM = ALCARECOTkAlCosmicsCTF0TTkAlDQM.clone(
#names and desigantions
TrackProducer = 'ALCARECO'+__selectionName,
AlgoName = 'ALCARECO'+__selectionName
)
ALCARECOTkAlCosmicsRS0TDQM = cms.Sequence( ALCARECOTkAlCosmicsRS0TTrackingDQM + ALCARECOTkAlCosmicsRS0TTkAlDQM)

### TkAlCosmicsCTF ###
__selectionName = 'TkAlCosmicsCTF'
Expand All @@ -171,7 +189,12 @@
TrackProducer = 'ALCARECO'+__selectionName,
AlgoName = 'ALCARECO'+__selectionName
)
ALCARECOTkAlCosmicsCTFDQM = cms.Sequence( ALCARECOTkAlCosmicsCTFTrackingDQM )
ALCARECOTkAlCosmicsCTFTkAlDQM = ALCARECOTkAlCosmicsCTF0TTkAlDQM.clone(
#names and desigantions
TrackProducer = 'ALCARECO'+__selectionName,
AlgoName = 'ALCARECO'+__selectionName
)
ALCARECOTkAlCosmicsCTFDQM = cms.Sequence( ALCARECOTkAlCosmicsCTFTrackingDQM + ALCARECOTkAlCosmicsCTFTkAlDQM )

### TkAlCosmicsCosmicTF ###
__selectionName = 'TkAlCosmicsCosmicTF'
Expand All @@ -180,7 +203,12 @@
TrackProducer = 'ALCARECO'+__selectionName,
AlgoName = 'ALCARECO'+__selectionName
)
ALCARECOTkAlCosmicsCosmicTFDQM = cms.Sequence( ALCARECOTkAlCosmicsCosmicTFTrackingDQM )
ALCARECOTkAlCosmicsCosmicTFTkAlDQM = ALCARECOTkAlCosmicsCTF0TTkAlDQM.clone(
#names and desigantions
TrackProducer = 'ALCARECO'+__selectionName,
AlgoName = 'ALCARECO'+__selectionName
)
ALCARECOTkAlCosmicsCosmicTFDQM = cms.Sequence( ALCARECOTkAlCosmicsCosmicTFTrackingDQM + ALCARECOTkAlCosmicsCosmicTFTkAlDQM)

### TkAlCosmicsRS ###
__selectionName = 'TkAlCosmicsRS'
Expand All @@ -189,4 +217,9 @@
TrackProducer = 'ALCARECO'+__selectionName,
AlgoName = 'ALCARECO'+__selectionName
)
ALCARECOTkAlCosmicsRSDQM = cms.Sequence( ALCARECOTkAlCosmicsRSTrackingDQM )
ALCARECOTkAlCosmicsRSTkAlDQM = ALCARECOTkAlCosmicsCTF0TTkAlDQM.clone(
#names and desigantions
TrackProducer = 'ALCARECO'+__selectionName,
AlgoName = 'ALCARECO'+__selectionName
)
ALCARECOTkAlCosmicsRSDQM = cms.Sequence( ALCARECOTkAlCosmicsRSTrackingDQM + ALCARECOTkAlCosmicsRSTkAlDQM )
13 changes: 12 additions & 1 deletion trunk/DQMOffline/Alignment/python/TkAlCaRecoMonitor_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

TkAlCaRecoMonitor = cms.EDAnalyzer("TkAlCaRecoMonitor",
TrackProducer= cms.InputTag( "generalTracks" ),
ReferenceTrackProducer= cms.InputTag( "generalTracks" ),
CaloJetCollection= cms.InputTag( "kt6CaloJets" ),
AlgoName = cms.string("testTkAlCaReco"),
MeasurementState = cms.string("default"),#All/OuterSurface/InnerSurface/ImpactPoint/default(track)
runsOnReco = cms.bool(False),
fillInvariantMass = cms.bool(False),
useSignedR = cms.bool(False),
#
TrackEfficiencyBin =cms.uint32(101),
TrackEfficiencyMin = cms.double(0.),
TrackEfficiencyMax = cms.double(1.01),
#
maxJetPt = cms.double(10), #GeV
#
Expand All @@ -26,8 +32,13 @@
MinTrackDeltaRMin = cms.double(0),
MinTrackDeltaRMax = cms.double(3.2),
#
HitMapsZBin = cms.uint32(300),
HitMapZMax = cms.double(300.), #cm
HitMapsRBin = cms.uint32(120),
HitMapRMax = cms.double(120.), #cm
#
FolderName = cms.string("TkAlCaRecoMonitor"),
OutputMEsInRootFile = cms.bool(False),
OutputMEsInRootFile = cms.bool(True),
OutputFileName = cms.string("MonitorTrack.root")
)

53 changes: 37 additions & 16 deletions trunk/DQMOffline/Alignment/src/TkAlCaRecoMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ void TkAlCaRecoMonitor::beginJob(edm::EventSetup const& iSetup) {

std::string histname; //for naming the histograms according to algorithm used

trackProducer_ = conf_.getParameter<edm::InputTag>("TrackProducer");
referenceTrackProducer_ = conf_.getParameter<edm::InputTag>("ReferenceTrackProducer");

std::string AlgoName = conf_.getParameter<std::string>("AlgoName");
std::string MEFolderName = conf_.getParameter<std::string>("FolderName");

Expand All @@ -43,6 +46,7 @@ void TkAlCaRecoMonitor::beginJob(edm::EventSetup const& iSetup) {
dqmStore_->setCurrentFolder(MEFolderName);
fillInvariantMass_ = conf_.getParameter<bool>("fillInvariantMass");
runsOnReco_ = conf_.getParameter<bool>("runsOnReco");
useSignedR_ = conf_.getParameter<bool>("useSignedR");
//
unsigned int MassBin = conf_.getParameter<unsigned int>("MassBin");
double MassMin = conf_.getParameter<double>("MassMin");
Expand Down Expand Up @@ -77,15 +81,27 @@ void TkAlCaRecoMonitor::beginJob(edm::EventSetup const& iSetup) {
histname = "MinTrackDeltaR_";
minTrackDeltaR_ = dqmStore_->book1D(histname+AlgoName, histname+AlgoName, MinTrackDeltaRBin, MinTrackDeltaRMin, MinTrackDeltaRMax);
minTrackDeltaR_->setAxisTitle("minimal Track #DeltaR / rad");

unsigned int TrackEfficiencyBin = conf_.getParameter<unsigned int>("TrackEfficiencyBin");
double TrackEfficiencyMin = conf_.getParameter<double>("TrackEfficiencyMin");
double TrackEfficiencyMax = conf_.getParameter<double>("TrackEfficiencyMax");

histname = "AlCaRecoTrackEfficiency_";
AlCaRecoTrackEfficiency_ = dqmStore_->book1D(histname+AlgoName, histname+AlgoName, TrackEfficiencyBin, TrackEfficiencyMin, TrackEfficiencyMax);
AlCaRecoTrackEfficiency_->setAxisTitle("n("+trackProducer_.label()+") / n("+referenceTrackProducer_.label()+")");

int zBin = conf_.getParameter<unsigned int>("HitMapsZBin"); //300
double zMax = conf_.getParameter<double>("HitMapZMax"); //300.0; //cm

int zBin = 300;
double zMax = 300.0; //cm

int rBin = 120;
double rMax = 120.0; //cm
int rBin = conf_.getParameter<unsigned int>("HitMapsRBin");//120;
double rMax = conf_.getParameter<double>("HitMapRMax"); //120.0; //cm

histname = "Hits_ZvsR_";
Hits_ZvsR_ = dqmStore_->book2D(histname+AlgoName, histname+AlgoName, zBin, -zMax, zMax, rBin, 0.0, rMax);
double rMin = 0.0;
if( useSignedR_ )
rMin = -rMax;

Hits_ZvsR_ = dqmStore_->book2D(histname+AlgoName, histname+AlgoName, zBin, -zMax, zMax, rBin, rMin, rMax);

histname = "Hits_XvsY_";
Hits_XvsY_ = dqmStore_->book2D(histname+AlgoName, histname+AlgoName, rBin, -rMax, rMax, rBin, -rMax, rMax);
Expand All @@ -97,19 +113,19 @@ void TkAlCaRecoMonitor::beginJob(edm::EventSetup const& iSetup) {
void TkAlCaRecoMonitor::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
using namespace edm;

InputTag trackProducer = conf_.getParameter<edm::InputTag>("TrackProducer");

Handle<reco::TrackCollection> trackCollection;
iEvent.getByLabel(trackProducer, trackCollection);
iEvent.getByLabel(trackProducer_, trackCollection);
if (!trackCollection.isValid()){
LogError("Alignment")<<"invalid trackcollection encountered!";
return;
}

// std::string recHitBuilderName = "WithTrackAngle";
// edm::ESHandle<TransientTrackingRecHitBuilder> recHitBuilderHandle;
//
// iSetup.get<TransientRecHitRecord>().get(recHitBuilderName,recHitBuilderHandle);

Handle<reco::TrackCollection> referenceTrackCollection;
iEvent.getByLabel(referenceTrackProducer_, referenceTrackCollection);
if (!trackCollection.isValid()){
LogError("Alignment")<<"invalid reference track-collection encountered!";
return;
}

edm::ESHandle<TrackerGeometry> geometry;
iSetup.get<TrackerDigiGeometryRecord>().get(geometry);
Expand All @@ -125,6 +141,8 @@ void TkAlCaRecoMonitor::analyze(const edm::Event& iEvent, const edm::EventSetup&
LogError("Alignment")<<"no jets found in event!";
}
}

AlCaRecoTrackEfficiency_->Fill( static_cast<double>((*trackCollection).size()) / (*referenceTrackCollection).size() );

for( reco::TrackCollection::const_iterator track = (*trackCollection).begin(); track < (*trackCollection).end(); ++track ){
double dR = 0;
Expand All @@ -151,6 +169,7 @@ void TkAlCaRecoMonitor::analyze(const edm::Event& iEvent, const edm::EventSetup&
fillHitmaps( *track, *geometry );
//, recHitBuilderHandle
}

if(fillInvariantMass_){
if((*trackCollection).size() == 2){
double theDaughterMass = 0.10565836;
Expand Down Expand Up @@ -181,8 +200,10 @@ void TkAlCaRecoMonitor::fillHitmaps(const reco::Track &track, const TrackerGeome
// The alternative would be the coarse estimation or a refit.
//const GlobalPoint globP( gd->toGlobal( hit->localPosition() ) );
const GlobalPoint globP( gd->toGlobal( Local3DPoint(0.,0.,0.) ) );

Hits_ZvsR_->Fill( globP.z(), sqrt( globP.x()*globP.x() + globP.y()*globP.y() ) );
double r = sqrt( globP.x()*globP.x() + globP.y()*globP.y() );
if( useSignedR_ )
r*= globP.y() / fabs( globP.y() );
Hits_ZvsR_->Fill( globP.z(), r );
Hits_XvsY_->Fill( globP.x(), globP.y() );

}
Expand Down

0 comments on commit a03719d

Please sign in to comment.