49 produces<ValueMap<DeDxData> >();
52 string estimatorName = iConfig.
getParameter<
string>(
"estimator");
66 MeVperADCPixel = iConfig.
getParameter<
double>(
"MeVperADCPixel");
67 MeVperADCStrip = iConfig.
getParameter<
double>(
"MeVperADCStrip");
70 useCalibration = iConfig.
getParameter<
bool>(
"UseCalibration");
71 m_calibrationPath = iConfig.
getParameter<
string>(
"calibrationPath");
73 if(!usePixel && !useStrip)
74 edm::LogWarning(
"DeDxHitsProducer") <<
"Pixel Hits AND Strip Hits will not be used to estimate dEdx --> BUG, Please Update the config file";
88 if(MODsColl.size()!=0)
return;
94 vector<GeomDet*>
Det = tkGeom->dets();
95 for(
unsigned int i=0;
i<Det.size();
i++){
96 DetId Detid = Det[
i]->geographicalId();
102 double Thick=-1, Dist=-1, Norma=-1;
106 Norma = MeVperADCStrip/Thick;
108 }
else if(PixelDetUnit){
111 Norma = MeVperADCPixel/Thick;
120 MODsColl[MOD->
DetId] = MOD;
123 MakeCalibrationMap();
140 iEvent.
getByLabel(m_trajTrackAssociationTag, trackCollHandle);
143 size_t n = trackColl.size();
144 std::vector<DeDxData> dedxEstimate(n);
147 for(
unsigned int j=0;
j<trackColl.size();
j++){
151 vector<DeDxTools::RawHits> hits;
155 int NClusterSaturating = 0;
156 for(
unsigned int h=0;
h<track->recHitsSize();
h++){
162 if(
const SiPixelRecHit* pixelHit=dynamic_cast<const SiPixelRecHit*>(recHit)){
163 if(!usePixel)
continue;
165 unsigned int detid = pixelHit->geographicalId();
168 double cosine = (track->px()*MOD->
Normal.
x()+track->py()*MOD->
Normal.
y()+track->pz()*MOD->
Normal.
z())/track->p();
179 sort(dedxHits.begin(),dedxHits.end(),less<DeDxHit>());
180 std::pair<float,float> val_and_error = m_estimator->dedx(dedxHits);
184 val_and_error.second = NClusterSaturating;
186 dedxEstimate[
j] =
DeDxData(val_and_error.first, val_and_error.second, dedxHits.size() );
188 filler.
insert(trackCollHandle, dedxEstimate.begin(), dedxEstimate.end());
193 iEvent.
put(trackDeDxEstimateAssociation);
200 if(!useCalibration)
return;
202 TChain* t1 =
new TChain(
"SiStripCalib/APVGain");
203 t1->Add(m_calibrationPath.c_str());
205 unsigned int tree_DetId;
206 unsigned char tree_APVId;
209 t1->SetBranchAddress(
"DetId" ,&tree_DetId );
210 t1->SetBranchAddress(
"APVId" ,&tree_APVId );
211 t1->SetBranchAddress(
"Gain" ,&tree_Gain );
215 for (
unsigned int ientry = 0; ientry < t1->GetEntries(); ientry++) {
216 t1->GetEntry(ientry);
218 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()
#define DEFINE_FWK_MODULE(type)
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
const Bounds & bounds() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
T const * product() const
const BoundPlane & surface() const
The nominal surface of the GeomDet.