32 produces<reco::DeDxDataValueMap>(
"energyLossPixHits");
33 produces<reco::DeDxDataValueMap>(
"energyLossStrHits");
34 produces<reco::DeDxDataValueMap>(
"energyLossAllHits");
36 resultFile =
new TFile(
"energyLoss.root",
"recreate");
52 std::vector<double> ldeBins;
53 static float ldeMin =
log(1);
54 static float ldeMax =
log(100);
55 static float ldeWidth = (ldeMax - ldeMin)/250;
56 for(
double lde = ldeMin; lde < ldeMax + ldeWidth/2; lde += ldeWidth)
57 ldeBins.push_back(lde);
59 hnor =
new TH2F(
"hnor",
"hnor", ldeBins.size()-1, &ldeBins[0],
60 ldeBins.size()-1, &ldeBins[0]);
88 <<
"[EnergyLossProducer]";
93 const std::vector<Trajectory> & trajeCollection =
100 std::vector<reco::DeDxData> estimatePix;
101 std::vector<reco::DeDxData> estimateStr;
102 std::vector<reco::DeDxData> estimateAll;
106 for(std::vector<Trajectory>::const_iterator traje = trajeCollection.begin();
107 traje!= trajeCollection.end();
111 std::vector<std::pair<int,double> > arithmeticMean, weightedMean;
112 theEloss.
estimate(&(*traje), arithmeticMean, weightedMean);
116 weightedMean[0].
first));
118 weightedMean[1].first));
120 weightedMean[2].first));
123 if(weightedMean[0].first >= 3 &&
124 weightedMean[1].first >= 3)
125 hnor->Fill(
log(weightedMean[0].second),
126 log(weightedMean[1].second));
129 fillerPix.
insert(trackHandle, estimatePix.begin(), estimatePix.end());
130 fillerStr.
insert(trackHandle, estimateStr.begin(), estimateStr.end());
131 fillerAll.
insert(trackHandle, estimateAll.begin(), estimateAll.end());
138 ev.
put(outputPix,
"energyLossPixHits");
139 ev.
put(outputStr,
"energyLossStrHits");
140 ev.
put(outputAll,
"energyLossAllHits");
T getParameter(std::string const &) const
std::string trackProducer
double pixelToStripMultiplier
void insert(const H &h, I begin, I end)
virtual void produce(edm::Event &ev, const edm::EventSetup &es)
const TrackerGeometry * theTracker
EnergyLossProducer(const edm::ParameterSet &ps)
int estimate(const Trajectory *trajectory, std::vector< std::pair< int, double > > &arithmeticMean, std::vector< std::pair< int, double > > &truncatedMean)
U second(std::pair< T, U > const &p)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
double pixelToStripExponent
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T const * product() const
T const * product() const
void beginRun(edm::Run &run, const edm::EventSetup &es)