-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 76727 b: "refs/heads/CMSSW_7_1_X" c: 3a2fef5 h: "refs/heads/CMSSW_7_1_X" i: 76725: 20ca22b 76723: 6fe42a4 76719: b670e95 v: v3
- Loading branch information
Burt Betchart
committed
Oct 30, 2009
1 parent
cd162e0
commit c2b6fe1
Showing
3 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e | ||
"refs/heads/CMSSW_7_1_X": cf2a76b8a24d06d20913afae977a10280241765b | ||
"refs/heads/CMSSW_7_1_X": 3a2fef5e9e2c8da0caf22d49aa92db23d67233f0 |
52 changes: 52 additions & 0 deletions
52
trunk/CalibTracker/SiStripCommon/plugins/RzSimhitsCountFilter.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include "FWCore/Framework/interface/EDFilter.h" | ||
#include "FWCore/Framework/interface/ESHandle.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" | ||
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" | ||
#include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h" | ||
#include "Geometry/CommonTopologies/interface/StripTopology.h" | ||
#include "SimDataFormats/TrackingHit/interface/PSimHit.h" | ||
#include "boost/foreach.hpp" | ||
|
||
#include "FWCore/PluginManager/interface/ModuleDef.h" | ||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
|
||
class RzSimhitCountFilter : public edm::EDFilter | ||
{ | ||
public: | ||
explicit RzSimhitCountFilter(const edm::ParameterSet& cfg) : | ||
inputTags_(cfg.getParameter<std::vector<edm::InputTag> >("InputTags")), | ||
max_radius_(cfg.getParameter<double>("MaxRadius")), | ||
max_z_(cfg.getParameter<double>("MaxZ")), | ||
min_hits_(cfg.getParameter<uint32_t>("MinHits")) | ||
{ } | ||
|
||
private: | ||
|
||
const std::vector<edm::InputTag> inputTags_; | ||
const double max_radius_, max_z_; | ||
const unsigned min_hits_; | ||
|
||
|
||
bool filter(edm::Event& evt, const edm::EventSetup& es) { | ||
edm::ESHandle<TrackerGeometry> theTrackerGeometry; | ||
es.get<TrackerDigiGeometryRecord>().get( theTrackerGeometry ); | ||
|
||
unsigned count = 0; | ||
BOOST_FOREACH(edm::InputTag input, inputTags_) { edm::Handle<std::vector<PSimHit> > simhits; evt.getByLabel(input, simhits); | ||
BOOST_FOREACH( const PSimHit hit, *simhits ) { | ||
const StripGeomDetUnit* sgdu = dynamic_cast<const StripGeomDetUnit*>( theTrackerGeometry->idToDet( hit.detUnitId() ) ); | ||
const GlobalPoint position = sgdu->toGlobal(hit.localPosition()); | ||
|
||
if( position.transverse() < max_radius_ && fabs(position.z()) < max_z_ ) count++; | ||
if( count >= min_hits_ ) return true; | ||
} | ||
} | ||
return false; | ||
} | ||
}; | ||
|
||
DEFINE_FWK_MODULE( RzSimhitCountFilter ); |
16 changes: 16 additions & 0 deletions
16
trunk/CalibTracker/SiStripCommon/python/RzSimhitCountFilter_cfi.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
rzSimhitCountFilter = cms.EDFilter("RzSimhitCountFilter", | ||
MaxRadius = cms.double(1000), #Much bigger than actual tracker | ||
MaxZ = cms.double(1000), #Much bigger than actual tracker | ||
MinHits = cms.uint32(4), | ||
InputTags = cms.VInputTag( | ||
cms.InputTag('g4SimHits:TrackerHitsTECHighTof'), | ||
cms.InputTag('g4SimHits:TrackerHitsTECLowTof'), | ||
cms.InputTag('g4SimHits:TrackerHitsTIDHighTof'), | ||
cms.InputTag('g4SimHits:TrackerHitsTIDLowTof'), | ||
cms.InputTag('g4SimHits:TrackerHitsTIBHighTof'), | ||
cms.InputTag('g4SimHits:TrackerHitsTIBLowTof'), | ||
cms.InputTag('g4SimHits:TrackerHitsTOBHighTof'), | ||
cms.InputTag('g4SimHits:TrackerHitsTOBLowTof') | ||
)) |