84 Charge_Vs_Path =
new TH3F (
"Charge_Vs_Path" ,
"Charge_Vs_Path" ,
P_NBins,
P_Min,
P_Max,
Path_NBins,
Path_Min,
Path_Max,
Charge_NBins,
Charge_Min,
Charge_Max);
92 vector<GeomDet*>
Det = tkGeom->dets();
93 for(
unsigned int i=0;
i<Det.size();
i++){
94 DetId Detid = Det[
i]->geographicalId();
101 if(!DetUnit)
continue;
104 unsigned int NAPV = Topo.
nstrips()/128;
109 for(
unsigned int j=0;
j<NAPV;
j++){
145 Charge_Vs_Path = (TH3F*)(Input->FindObjectAny(
"Charge_Vs_Path"))->Clone();
156 unsigned int NEvent = 0;
158 printf(
"Openning file %3i/%3i --> %s\n",
i+1, (
int)
VInputFiles.size(), (
char*)(
VInputFiles[
i].c_str())); fflush(stdout);
159 TChain*
tree =
new TChain(
"gainCalibrationTree/tree");
162 TString EventPrefix(
"");
163 TString EventSuffix(
"");
165 TString TrackPrefix(
"track");
166 TString TrackSuffix(
"");
168 TString CalibPrefix(
"GainCalibration");
169 TString CalibSuffix(
"");
171 unsigned int eventnumber = 0; tree->SetBranchAddress(EventPrefix +
"event" + EventSuffix, &eventnumber ,
NULL);
172 unsigned int runnumber = 0; tree->SetBranchAddress(EventPrefix +
"run" + EventSuffix, &runnumber ,
NULL);
173 std::vector<bool>* TrigTech = 0; tree->SetBranchAddress(EventPrefix +
"TrigTech" + EventSuffix, &TrigTech ,
NULL);
175 std::vector<double>* trackchi2ndof = 0; tree->SetBranchAddress(TrackPrefix +
"chi2ndof" + TrackSuffix, &trackchi2ndof ,
NULL);
176 std::vector<float>* trackp = 0; tree->SetBranchAddress(TrackPrefix +
"momentum" + TrackSuffix, &trackp ,
NULL);
177 std::vector<float>* trackpt = 0; tree->SetBranchAddress(TrackPrefix +
"pt" + TrackSuffix, &trackpt ,
NULL);
178 std::vector<double>* tracketa = 0; tree->SetBranchAddress(TrackPrefix +
"eta" + TrackSuffix, &tracketa ,
NULL);
179 std::vector<double>* trackphi = 0; tree->SetBranchAddress(TrackPrefix +
"phi" + TrackSuffix, &trackphi ,
NULL);
180 std::vector<unsigned int>* trackhitsvalid = 0; tree->SetBranchAddress(TrackPrefix +
"hitsvalid" + TrackSuffix, &trackhitsvalid,
NULL);
182 std::vector<int>* trackindex = 0; tree->SetBranchAddress(CalibPrefix +
"trackindex" + CalibSuffix, &trackindex ,
NULL);
183 std::vector<unsigned int>* rawid = 0; tree->SetBranchAddress(CalibPrefix +
"rawid" + CalibSuffix, &rawid ,
NULL);
184 std::vector<unsigned short>* firststrip = 0; tree->SetBranchAddress(CalibPrefix +
"firststrip" + CalibSuffix, &firststrip ,
NULL);
185 std::vector<unsigned short>* nstrips = 0; tree->SetBranchAddress(CalibPrefix +
"nstrips" + CalibSuffix, &nstrips ,
NULL);
186 std::vector<unsigned int>*
charge = 0; tree->SetBranchAddress(CalibPrefix +
"charge" + CalibSuffix, &charge ,
NULL);
187 std::vector<float>*
path = 0; tree->SetBranchAddress(CalibPrefix +
"path" + CalibSuffix, &path ,
NULL);
188 std::vector<unsigned char>* amplitude = 0; tree->SetBranchAddress(CalibPrefix +
"amplitude" + CalibSuffix, &litude ,
NULL);
189 std::vector<double>* gainused = 0; tree->SetBranchAddress(CalibPrefix +
"gainused" + CalibSuffix, &gainused ,
NULL);
191 printf(
"Number of Events = %i + %i = %i\n",NEvent,(
unsigned int)tree->GetEntries(),(
unsigned int)(NEvent+tree->GetEntries()));NEvent+=tree->GetEntries();
192 printf(
"Progressing Bar :0%% 20%% 40%% 60%% 80%% 100%%\n");
193 printf(
"Looping on the Tree :");
194 int TreeStep = tree->GetEntries()/50;
if(TreeStep<=1)TreeStep=1;
195 for (
unsigned int ientry = 0; ientry < tree->GetEntries(); ientry++) {
196 if(ientry%TreeStep==0){printf(
".");fflush(stdout);}
197 tree->GetEntry(ientry);
199 int FirstAmplitude = 0;
200 for(
unsigned int c=0;
c<(*path).size();
c++){
201 FirstAmplitude+=(*nstrips)[
c];
202 int t = (*trackindex)[
c];
203 if((*trackpt)[
t]<5)
continue;
204 if((*trackhitsvalid)[
t]<5)
continue;
209 for(
unsigned int s=0;
s<(*nstrips)[
c];
s++){
210 int StripCharge = (*amplitude)[FirstAmplitude-(*nstrips)[
c]+
s];
212 StripCharge=(int)(StripCharge/APV->
CalibGain);
213 if(StripCharge>=1024){
215 }
else if(StripCharge>=254){
219 Charge += StripCharge;
222 Charge = (*charge)[
c];
226 double ClusterChargeOverPath = ( (double) Charge )/(*path)[
c] ;
270 TChain* t1 =
new TChain(
"SiStripCalib/APVGain");
273 unsigned int tree_DetId;
274 unsigned char tree_APVId;
277 t1->SetBranchAddress(
"DetId" ,&tree_DetId );
278 t1->SetBranchAddress(
"APVId" ,&tree_APVId );
279 t1->SetBranchAddress(
"Gain" ,&tree_Gain );
281 for (
unsigned int ientry = 0; ientry < t1->GetEntries(); ientry++) {
282 t1->GetEntry(ientry);
T getParameter(std::string const &) const
virtual int nstrips() const =0
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
std::vector< std::string > VInputFiles
const Bounds & bounds() const
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const Plane & surface() const
The nominal surface of the GeomDet.
virtual void algoEndJob()
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.)
const TrackerGeometry * m_tracker
PhysicsTools::Calibration::HistogramD3D * getNewObject()
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
virtual void algoBeginJob(const edm::EventSetup &)
void MakeCalibrationMap()
std::string m_calibrationPath
unsigned int MinTrackHits
void algoAnalyzeTheTree()
T const * product() const
__gnu_cxx::hash_map< unsigned int, stAPVInfo *, __gnu_cxx::hash< unsigned int >, isEqual > APVsColl
T transverse() const
Another name for perp()
const BasicVectorType & basicVector() const
DeDxDiscriminatorLearnerFromCalibTree(const edm::ParameterSet &)
virtual void algoAnalyze(const edm::Event &, const edm::EventSetup &)
~DeDxDiscriminatorLearnerFromCalibTree()