Skip to content
Snippets Groups Projects
Commit e5cd6d23 authored by Zafar Ahmed's avatar Zafar Ahmed Committed by Stephen A. Wood
Browse files

This is second update for THcCherenkov.cxx class. I have added four more

variables. Total photo electrons, total hits of adc 1, total hits of adc 2
and total hits. With this update we have transformed the FORTRAN code of
file /engine/HTRACKING/h_trans_cer.f to /hcana/ser/THcCherenkov.cxx

NOTE: The pedestal value in ENGINE is an integer but in hcana it is a
flaoting number. So it changes the pedestal substracted vlues of adc 1
and adc 2 and the number of photo electrons of adc 1 and 2 by very small
fraction. The difference of total photo electrons between ENGINE and hcana
is not more than 0.005.
parent 69c8b5a3
No related branches found
No related tags found
No related merge requests found
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
// Eventually need to learn to skip over, or properly analyze // Eventually need to learn to skip over, or properly analyze
// the pedestal events // the pedestal events
run->SetEventRange(1,5000);// Physics Event number, does not run->SetEventRange(1,100000);// Physics Event number, does not
// include scaler or control events // include scaler or control events
// Define the analysis parameters // Define the analysis parameters
......
...@@ -4,7 +4,14 @@ ...@@ -4,7 +4,14 @@
// // // //
// Class for an Cherenkov detector consisting of onw pair of PMT's // // Class for an Cherenkov detector consisting of onw pair of PMT's //
// // // //
// Zafar Ahmed. Second attempt. November 14 2013. // // Zafar Ahmed. Updated on December 24 2013. //
// Four more variables are added. //
// //
// npe Total Number of photo electrons //
// hit_1 Total hits in adc 1 //
// hit_2 Total hits in adc 2 //
// hit Total hits in adc 1 and 2 //
// //
// Comment:No need to cahnge the Map file but may need to change the parameter file // // Comment:No need to cahnge the Map file but may need to change the parameter file //
// // // //
// This code is written for following variables: // // This code is written for following variables: //
...@@ -155,12 +162,16 @@ Int_t THcCherenkov::DefineVariables( EMode mode ) ...@@ -155,12 +162,16 @@ Int_t THcCherenkov::DefineVariables( EMode mode )
// No. They show up in tree as Ndata.H.aero.postdchits for example // No. They show up in tree as Ndata.H.aero.postdchits for example
RVarDef vars[] = { RVarDef vars[] = {
{"adc_1", "Raw First ADC Amplitudes", "fA_1"}, {"adc_1", "Raw First ADC Amplitude", "fA_1"},
{"adc_2", "Raw Second ADC Amplitudes", "fA_2"}, {"adc_2", "Raw Second ADC Amplitude", "fA_2"},
{"adc_p_1", "Raw First ADC Amplitudes", "fA_p_1"}, {"adc_p_1", "Pedestal Subtracted First ADC Amplitude", "fA_p_1"},
{"adc_p_2", "Raw Second ADC Amplitudes", "fA_p_2"}, {"adc_p_2", "Pedestal Subtracted Second ADC Amplitude", "fA_p_2"},
{"npe_1","PEs First Tube", "fNpe_1"}, {"npe_1", "PEs of First Tube", "fNpe_1"},
{"npe_2","PEs Second Tube","fNpe_2"}, {"npe_2", "PEs of Second Tube", "fNpe_2"},
{"npe", "Total number of PEs", "fNpe"},
{"hit_1", "ADC hits First Tube", "fNHits_1"},
{"hit_2", "ADC hits Second Tube", "fNHits_2"},
{"hit", "Total ADC hits", "fNHits"},
{"posadchits", "List of Positive ADC hits","fPosADCHits.THcSignalHit.GetPaddleNumber()"}, {"posadchits", "List of Positive ADC hits","fPosADCHits.THcSignalHit.GetPaddleNumber()"},
{ 0 } { 0 }
}; };
...@@ -184,6 +195,10 @@ void THcCherenkov::Clear(Option_t* opt) ...@@ -184,6 +195,10 @@ void THcCherenkov::Clear(Option_t* opt)
fA_p_2 = 0; fA_p_2 = 0;
fNpe_1 = 0; fNpe_1 = 0;
fNpe_2 = 0; fNpe_2 = 0;
fNpe = 0;
fNHits_1 = 0;
fNHits_2 = 0;
fNHits = 0;
} }
...@@ -259,6 +274,7 @@ Int_t THcCherenkov::CoarseProcess( TClonesArray& ) //tracks ...@@ -259,6 +274,7 @@ Int_t THcCherenkov::CoarseProcess( TClonesArray& ) //tracks
enddo enddo
------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------
*/ */
for(Int_t ihit=0; ihit < fNhits; ihit++) { for(Int_t ihit=0; ihit < fNhits; ihit++) {
THcCherenkovHit* hit = (THcCherenkovHit *) fRawHitList->At(ihit); // nhit = 1, hcer_tot_hits THcCherenkovHit* hit = (THcCherenkovHit *) fRawHitList->At(ihit); // nhit = 1, hcer_tot_hits
...@@ -280,6 +296,7 @@ Int_t THcCherenkov::CoarseProcess( TClonesArray& ) //tracks ...@@ -280,6 +296,7 @@ Int_t THcCherenkov::CoarseProcess( TClonesArray& ) //tracks
fA_p_1 = hit->fADC_pos - fPosPedMean[npmt]; fA_p_1 = hit->fADC_pos - fPosPedMean[npmt];
if ( ( fA_p_1 > 50 ) && ( hit->fADC_pos < 8000 ) ) { if ( ( fA_p_1 > 50 ) && ( hit->fADC_pos < 8000 ) ) {
fNpe_1 = fPosGain[npmt]*fA_p_1; fNpe_1 = fPosGain[npmt]*fA_p_1;
fNHits_1 ++;
} else if ( hit->fADC_pos > 8000 ) { } else if ( hit->fADC_pos > 8000 ) {
fNpe_1 = 100.0; fNpe_1 = 100.0;
} else { } else {
...@@ -292,14 +309,26 @@ Int_t THcCherenkov::CoarseProcess( TClonesArray& ) //tracks ...@@ -292,14 +309,26 @@ Int_t THcCherenkov::CoarseProcess( TClonesArray& ) //tracks
fA_p_2 = hit->fADC_pos - fPosPedMean[npmt]; fA_p_2 = hit->fADC_pos - fPosPedMean[npmt];
if ( ( fA_p_2 > 50 ) && ( hit->fADC_pos < 8000 ) ) { if ( ( fA_p_2 > 50 ) && ( hit->fADC_pos < 8000 ) ) {
fNpe_2 = fPosGain[npmt]*fA_p_2; fNpe_2 = fPosGain[npmt]*fA_p_2;
fNHits_2 ++;
} else if ( hit->fADC_pos > 8000 ) { } else if ( hit->fADC_pos > 8000 ) {
fNpe_2 = 100.0; fNpe_2 = 100.0;
} else { } else {
fNpe_2 = 0.0; fNpe_2 = 0.0;
} }
} }
if ( npmt == 0 ) {
fNpe += fNpe_1;
fNHits += fNHits_1;
}
if ( npmt == 1 ) {
fNpe += fNpe_2;
fNHits += fNHits_2;
}
} }
ApplyCorrections(); ApplyCorrections();
return 0; return 0;
......
...@@ -52,14 +52,16 @@ class THcCherenkov : public THaNonTrackingDetector, public THcHitList { ...@@ -52,14 +52,16 @@ class THcCherenkov : public THaNonTrackingDetector, public THcHitList {
Float_t* fT_Pos; // [fNelem] Array of TDCs Float_t* fT_Pos; // [fNelem] Array of TDCs
Float_t* fT_Neg; // [fNelem] Array of TDCs Float_t* fT_Neg; // [fNelem] Array of TDCs
Float_t fA_1; // Ahmed Double_t fA_1; // Ahmed
Float_t fA_2; // Ahmed Double_t fA_2; // Ahmed
Float_t fA_p_1; // Ahmed Double_t fNHits_1; // Ahmed
Float_t fA_p_2; // Ahmed Double_t fNHits_2; // Ahmed
Double_t fNpe_1; // Ahmed Double_t fNHits; // Ahmed
Double_t fNpe_2; // Ahmed Double_t fA_p_1; // Ahmed
Int_t fNHits_1; // Ahmed Double_t fA_p_2; // Ahmed
Int_t fNHits_2; // Ahmed Double_t fNpe_1; // Ahmed
Double_t fNpe_2; // Ahmed
Double_t fNpe; // Ahmed
Double_t fPosNpeSum; Double_t fPosNpeSum;
Double_t fNegNpeSum; Double_t fNegNpeSum;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment