69 <<
" Energy Max " << energyMax;
79 if (!
tfile.isAvailable())
81 <<
"please add it to config file";
85 for (
int i = 0;
i < 4;
i++) {
86 sprintf(
name,
"Hits%d",
i);
87 sprintf(
title,
"Number of hits (%s)",
types[
i].c_str());
90 meNHit_[
i]->GetYaxis()->SetTitle(
"Events");
91 sprintf(
name,
"E1T0%d",
i);
92 sprintf(
title,
"E1 (Loss %s) in GeV",
types[
i].c_str());
95 meE1T0_[
i]->GetYaxis()->SetTitle(
"Events");
96 sprintf(
name,
"E9T0%d",
i);
97 sprintf(
title,
"E9 (Loss %s) in GeV",
types[
i].c_str());
100 meE9T0_[
i]->GetYaxis()->SetTitle(
"Events");
101 sprintf(
name,
"E1T1%d",
i);
102 sprintf(
title,
"E1 (Loss %s with t < 400 ns) in GeV",
types[
i].c_str());
105 meE1T1_[
i]->GetYaxis()->SetTitle(
"Events");
106 sprintf(
name,
"E9T1%d",
i);
107 sprintf(
title,
"E9 (Loss %s with t < 400 ns) in GeV",
types[
i].c_str());
110 meE9T1_[
i]->GetYaxis()->SetTitle(
"Events");
112 sprintf(
name,
"PDGType");
113 sprintf(
title,
"PDG ID of first level secondary");
116 mType_->GetYaxis()->SetTitle(
"Tracks");
121 edm::LogVerbatim(
"CherenkovAnalysis") <<
"XtalDedxAnalysis::Run = " <<
e.id().run() <<
" Event = " <<
e.id().event();
123 std::vector<PCaloHit> caloHits;
127 std::vector<SimTrack> theSimTracks;
131 std::vector<SimVertex> theSimVertex;
136 caloHits.insert(caloHits.end(), pCaloHits->begin(), pCaloHits->end());
138 edm::LogVerbatim(
"CherenkovAnalysis") <<
"XtalDedxAnalysis: Hit buffer " << caloHits.size();
147 edm::SimTrackContainer::const_iterator simTrkItr;
148 int nHit =
hits.size();
149 double e10[4], e90[4], e11[4], e91[4],
hit[4];
150 for (
int i = 0;
i < 4;
i++)
151 e10[
i] = e90[
i] = e11[
i] = e91[
i] =
hit[
i] = 0;
152 for (
int i = 0;
i < nHit;
i++) {
155 unsigned int id_ =
hits[
i].id();
156 int trackID =
hits[
i].geantTrackId();
158 for (simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
159 if (trackID == (
int)(simTrkItr->trackId())) {
160 int thePID = simTrkItr->type();
163 else if (thePID != -13 && thePID != 13)
186 <<
" time " <<
time <<
" track " << trackID <<
" type " <<
type;
189 for (
int i = 0;
i < 4;
i++) {
191 edm::LogVerbatim(
"CherenkovAnalysis") <<
"XtalDedxAnalysis:Type(" <<
i <<
") Hit " <<
hit[
i] <<
" E10 " << e10[
i]
192 <<
" E11 " << e11[
i] <<
" E90 " << e90[
i] <<
" E91 " << e91[
i];
202 int nvtx = 0, ntrk = 0, k1 = 0;
203 edm::SimVertexContainer::const_iterator simVtxItr;
204 for (simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++)
206 for (simVtxItr = SimVtx->begin(); simVtxItr != SimVtx->end(); simVtxItr++)
209 edm::LogVerbatim(
"CherenkovAnalysis") <<
"XtalDedxAnalysis: " << ntrk <<
" tracks and " << nvtx <<
" vertices";
211 for (simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++, ++k1) {
213 edm::LogVerbatim(
"CherenkovAnalysis") <<
"Track " << k1 <<
" PDGId " << simTrkItr->type() <<
" Vertex ID "
214 << simTrkItr->vertIndex() <<
" Generator " << simTrkItr->noGenpart();
216 if (simTrkItr->noGenpart()) {
217 int vertIndex = simTrkItr->vertIndex();
218 if (vertIndex >= 0 && vertIndex < nvtx) {
219 simVtxItr = SimVtx->begin();
220 for (
int iv = 0; iv < vertIndex; iv++)
222 int parent = simVtxItr->parentIndex(), k2 = 0;
223 for (edm::SimTrackContainer::const_iterator trkItr = SimTk->begin(); trkItr != SimTk->end(); trkItr++, ++k2) {
225 edm::LogVerbatim(
"CherenkovAnalysis") <<
"XtalDedxAnalysis::Track " << k2 <<
" ID " << trkItr->trackId()
226 <<
" (" <<
parent <<
") Generator " << trkItr->noGenpart();
228 if ((
int)trkItr->trackId() ==
parent) {
229 if (!trkItr->noGenpart()) {
231 edm::LogVerbatim(
"CherenkovAnalysis") <<
"XtalDedxAnalysis::Track found with ID " << simTrkItr->type();
233 mType_->Fill(simTrkItr->type());