50 produces<ValueMap<DeDxData> >();
53 string estimatorName = iConfig.
getParameter<
string>(
"estimator");
67 MeVperADCPixel = iConfig.
getParameter<
double>(
"MeVperADCPixel");
68 MeVperADCStrip = iConfig.
getParameter<
double>(
"MeVperADCStrip");
71 useCalibration = iConfig.
getParameter<
bool>(
"UseCalibration");
72 m_calibrationPath = iConfig.
getParameter<
string>(
"calibrationPath");
74 if(!usePixel && !useStrip)
75 edm::LogWarning(
"DeDxHitsProducer") <<
"Pixel Hits AND Strip Hits will not be used to estimate dEdx --> BUG, Please Update the config file";
89 if(MODsColl.size()!=0)
return;
95 vector<GeomDet*>
Det = tkGeom->dets();
96 for(
unsigned int i=0;
i<Det.size();
i++){
97 DetId Detid = Det[
i]->geographicalId();
103 double Thick=-1, Dist=-1, Norma=-1;
107 Norma = MeVperADCStrip/Thick;
109 }
else if(PixelDetUnit){
112 Norma = MeVperADCPixel/Thick;
121 MODsColl[MOD->
DetId] = MOD;
124 MakeCalibrationMap();
141 iEvent.
getByLabel(m_trajTrackAssociationTag, trackCollHandle);
144 size_t n = trackColl.size();
145 std::vector<DeDxData> dedxEstimate(n);
148 for(
unsigned int j=0;
j<trackColl.size();
j++){
152 vector<DeDxTools::RawHits> hits;
156 int NClusterSaturating = 0;
157 for(
unsigned int h=0;
h<track->recHitsSize();
h++){
163 if(
const SiPixelRecHit* pixelHit=dynamic_cast<const SiPixelRecHit*>(recHit)){
164 if(!usePixel)
continue;
166 unsigned int detid = pixelHit->geographicalId();
169 double cosine = (track->px()*MOD->
Normal.
x()+track->py()*MOD->
Normal.
y()+track->pz()*MOD->
Normal.
z())/track->p();
180 sort(dedxHits.begin(),dedxHits.end(),less<DeDxHit>());
181 std::pair<float,float> val_and_error = m_estimator->dedx(dedxHits);
185 val_and_error.second = NClusterSaturating;
187 dedxEstimate[
j] =
DeDxData(val_and_error.first, val_and_error.second, dedxHits.size() );
189 filler.
insert(trackCollHandle, dedxEstimate.begin(), dedxEstimate.end());
194 iEvent.
put(trackDeDxEstimateAssociation);
201 if(!useCalibration)
return;
203 TChain* t1 =
new TChain(
"SiStripCalib/APVGain");
204 t1->Add(m_calibrationPath.c_str());
206 unsigned int tree_DetId;
207 unsigned char tree_APVId;
210 t1->SetBranchAddress(
"DetId" ,&tree_DetId );
211 t1->SetBranchAddress(
"APVId" ,&tree_APVId );
212 t1->SetBranchAddress(
"Gain" ,&tree_Gain );
216 for (
unsigned int ientry = 0; ientry < t1->GetEntries(); ientry++) {
217 t1->GetEntry(ientry);
219 MOD->
Gain = tree_Gain;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual void beginRun(edm::Run &run, const edm::EventSetup &)
void MakeCalibrationMap()
GlobalVector normalVector() const
void insert(const H &h, I begin, I end)
std::vector< Track > TrackCollection
collection of Tracks
std::vector< DeDxHit > DeDxHitCollection
virtual void produce(edm::Event &, const edm::EventSetup &)
uint32_t rawId() const
get the raw id
virtual float thickness() const =0
const Surface::PositionType & position() const
The position (origin of the R.F.)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
DeDxEstimatorProducerPixelTripplet(const edm::ParameterSet &)
~DeDxEstimatorProducerPixelTripplet()
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
DEFINE_FWK_MODULE(CosmicTrackingParticleSelector)
const Bounds & bounds() const
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
T const * product() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.