diff --git a/examples/hitmaps.C b/examples/hitmaps_hms.C similarity index 100% rename from examples/hitmaps.C rename to examples/hitmaps_hms.C diff --git a/examples/hitmaps_sos.C b/examples/hitmaps_sos.C new file mode 100644 index 0000000000000000000000000000000000000000..2e7f220bbfd77141423f860348b00a76bcd0da21 --- /dev/null +++ b/examples/hitmaps_sos.C @@ -0,0 +1,39 @@ +{ + TFile* f = new TFile("hodtest.root"); + + TCanvas *c1 = new TCanvas("c1", "SOS Scintillator Hit Maps", 800, 800); + c1->Divide(2, 4); + + TH1F* h[16]; + + h[0] = spostdc1; + h[1] = snegtdc1; + h[4] = spostdc2; + h[5] = snegtdc2; + h[8] = spostdc3; + h[9] = snegtdc3; + h[12] = spostdc4; + h[13] = snegtdc4; + + h[2] = sposadc1; + h[3] = snegadc1; + h[6] = sposadc2; + h[7] = snegadc2; + h[10] = sposadc3; + h[11] = snegadc3; + h[14] = sposadc4; + h[15] = snegadc4; + + for(Int_t ipad=1;ipad<=8;ipad++) { + TPad *pt = c1->cd(ipad); + Int_t ihp = 2*(ipad-1); + Int_t ihn = ihp+1; + h[ihp]->SetFillColor(kGreen); + h[ihp]->SetFillStyle(3345); + h[ihp]->Draw(); + h[ihn]->SetFillColor(kBlue); + h[ihn]->SetFillStyle(3354); + h[ihn]->Draw("same"); + } + +} diff --git a/examples/hodtest.C b/examples/hodtest.C index dcf776a5d6a3e067cd6d3eb4296829624ed51cf0..9a09d917c57cc757ae4bf717e62b81826ac6d5bb 100644 --- a/examples/hodtest.C +++ b/examples/hodtest.C @@ -72,7 +72,7 @@ // Eventually need to learn to skip over, or properly analyze // 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 // Define the analysis parameters diff --git a/examples/output.def b/examples/output.def index 1f5853b69544d0e7997f44aa39ee3a6e88edba8c..39c60f174f0a828985af15839ba75e83e7a0b73f 100644 --- a/examples/output.def +++ b/examples/output.def @@ -177,6 +177,26 @@ TH1F hs2yfptime 'HODO s2y fptime' H.hod.2y.fptime 80 0 80 H.hod.hgoodstarttime TH1F starttime 'HODO start time' H.hod.starttime 80 0 80 H.hod.hgoodstarttime #SOS +# TDC hits per paddle +TH1F spostdc1 'SOS s1x+ TDC hits' S.hod.1x.postdchits 9 0.5 9.5 +TH1F snegtdc1 'SOS s1x- TDC hits' S.hod.1x.negtdchits 9 0.5 9.5 +TH1F spostdc2 'SOS s1y+ TDC hits' S.hod.1y.postdchits 9 0.5 9.5 +TH1F snegtdc2 'SOS s1y- TDC hits' S.hod.1y.negtdchits 9 0.5 9.5 +TH1F spostdc3 'SOS s2x+ TDC hits' S.hod.2x.postdchits 16 0.5 16.5 +TH1F snegtdc3 'SOS s2x- TDC hits' S.hod.2x.negtdchits 16 0.5 16.5 +TH1F spostdc4 'SOS s2y+ TDC hits' S.hod.2y.postdchits 9 0.5 9.5 +TH1F snegtdc4 'SOS s2y- TDC hits' S.hod.2y.negtdchits 9 0.5 9.5 + +# ADC hits per paddle +TH1F sposadc1 'SOS s1x+ ADC hits' S.hod.1x.posadchits 9 0.5 9.5 +TH1F snegadc1 'SOS s1x- ADC hits' S.hod.1x.negadchits 9 0.5 9.5 +TH1F sposadc2 'SOS s1y+ ADC hits' S.hod.1y.posadchits 9 0.5 9.5 +TH1F snegadc2 'SOS s1y- ADC hits' S.hod.1y.negadchits 9 0.5 9.5 +TH1F sposadc3 'SOS s2x+ ADC hits' S.hod.2x.posadchits 16 0.5 16.5 +TH1F snegadc3 'SOS s2x- ADC hits' S.hod.2x.negadchits 16 0.5 16.5 +TH1F sposadc4 'SOS s2y+ ADC hits' S.hod.2y.posadchits 9 0.5 9.5 +TH1F snegadc4 'SOS s2y- ADC hits' S.hod.2y.negadchits 9 0.5 9.5 + TH1F sdc1u1_wm 'SDC 1U1 Wiremap' S.dc.1u1.tdchits 48 0.5 48.5 TH1F sdc1u2_wm 'SDC 1U2 Wiremap' S.dc.1u2.tdchits 48 0.5 48.5 TH1F sdc1x1_wm 'SDC 1X1 Wiremap' S.dc.1x1.tdchits 64 0.5 64.5 diff --git a/src/THcCherenkov.cxx b/src/THcCherenkov.cxx index c486b2a2108852e7444590d093a0b8a12dd176a3..2db648b6e83b1100106b6bcb58ce88916bf1188c 100644 --- a/src/THcCherenkov.cxx +++ b/src/THcCherenkov.cxx @@ -4,7 +4,14 @@ // // // 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 // // // // This code is written for following variables: // @@ -155,12 +162,16 @@ Int_t THcCherenkov::DefineVariables( EMode mode ) // No. They show up in tree as Ndata.H.aero.postdchits for example RVarDef vars[] = { - {"adc_1", "Raw First ADC Amplitudes", "fA_1"}, - {"adc_2", "Raw Second ADC Amplitudes", "fA_2"}, - {"adc_p_1", "Raw First ADC Amplitudes", "fA_p_1"}, - {"adc_p_2", "Raw Second ADC Amplitudes", "fA_p_2"}, - {"npe_1","PEs First Tube", "fNpe_1"}, - {"npe_2","PEs Second Tube","fNpe_2"}, + {"adc_1", "Raw First ADC Amplitude", "fA_1"}, + {"adc_2", "Raw Second ADC Amplitude", "fA_2"}, + {"adc_p_1", "Pedestal Subtracted First ADC Amplitude", "fA_p_1"}, + {"adc_p_2", "Pedestal Subtracted Second ADC Amplitude", "fA_p_2"}, + {"npe_1", "PEs of First Tube", "fNpe_1"}, + {"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()"}, { 0 } }; @@ -184,6 +195,10 @@ void THcCherenkov::Clear(Option_t* opt) fA_p_2 = 0; fNpe_1 = 0; fNpe_2 = 0; + fNpe = 0; + fNHits_1 = 0; + fNHits_2 = 0; + fNHits = 0; } @@ -259,6 +274,7 @@ Int_t THcCherenkov::CoarseProcess( TClonesArray& ) //tracks enddo ------------------------------------------------------------------------------------------------------------------ */ + for(Int_t ihit=0; ihit < fNhits; ihit++) { THcCherenkovHit* hit = (THcCherenkovHit *) fRawHitList->At(ihit); // nhit = 1, hcer_tot_hits @@ -280,6 +296,7 @@ Int_t THcCherenkov::CoarseProcess( TClonesArray& ) //tracks fA_p_1 = hit->fADC_pos - fPosPedMean[npmt]; if ( ( fA_p_1 > 50 ) && ( hit->fADC_pos < 8000 ) ) { fNpe_1 = fPosGain[npmt]*fA_p_1; + fNHits_1 ++; } else if ( hit->fADC_pos > 8000 ) { fNpe_1 = 100.0; } else { @@ -292,14 +309,26 @@ Int_t THcCherenkov::CoarseProcess( TClonesArray& ) //tracks fA_p_2 = hit->fADC_pos - fPosPedMean[npmt]; if ( ( fA_p_2 > 50 ) && ( hit->fADC_pos < 8000 ) ) { fNpe_2 = fPosGain[npmt]*fA_p_2; + fNHits_2 ++; } else if ( hit->fADC_pos > 8000 ) { fNpe_2 = 100.0; } else { fNpe_2 = 0.0; } } + + if ( npmt == 0 ) { + fNpe += fNpe_1; + fNHits += fNHits_1; + } + + if ( npmt == 1 ) { + fNpe += fNpe_2; + fNHits += fNHits_2; + } + } - + ApplyCorrections(); return 0; diff --git a/src/THcCherenkov.h b/src/THcCherenkov.h index 135a8b6705f26706096b8dc9806f90df460272ed..4040a56e54056154d27831e17dd32c1e4e026c10 100644 --- a/src/THcCherenkov.h +++ b/src/THcCherenkov.h @@ -52,14 +52,16 @@ class THcCherenkov : public THaNonTrackingDetector, public THcHitList { Float_t* fT_Pos; // [fNelem] Array of TDCs Float_t* fT_Neg; // [fNelem] Array of TDCs - Float_t fA_1; // Ahmed - Float_t fA_2; // Ahmed - Float_t fA_p_1; // Ahmed - Float_t fA_p_2; // Ahmed - Double_t fNpe_1; // Ahmed - Double_t fNpe_2; // Ahmed - Int_t fNHits_1; // Ahmed - Int_t fNHits_2; // Ahmed + Double_t fA_1; // Ahmed + Double_t fA_2; // Ahmed + Double_t fNHits_1; // Ahmed + Double_t fNHits_2; // Ahmed + Double_t fNHits; // Ahmed + Double_t fA_p_1; // Ahmed + Double_t fA_p_2; // Ahmed + Double_t fNpe_1; // Ahmed + Double_t fNpe_2; // Ahmed + Double_t fNpe; // Ahmed Double_t fPosNpeSum; Double_t fNegNpeSum; diff --git a/src/THcHodoscope.cxx b/src/THcHodoscope.cxx index ec2ae404beeec901017f62ce8052573a17cc4812..a2c401064566f04d9b2771af18d799d2f856e1c0 100644 --- a/src/THcHodoscope.cxx +++ b/src/THcHodoscope.cxx @@ -162,12 +162,12 @@ THaAnalysisObject::EStatus THcHodoscope::Init( const TDatime& date ) // }; // memcpy( fDataDest, tmp, NDEST*sizeof(DataDest) ); - // Will need to determine which apparatus it belongs to and use the - // appropriate detector ID in the FillMap call - if( gHcDetectorMap->FillMap(fDetMap, "HSCIN") < 0 ) { + char EngineDID[]="xSCIN"; + EngineDID[0] = toupper(GetApparatus()->GetName()[0]); + if( gHcDetectorMap->FillMap(fDetMap, EngineDID) < 0 ) { static const char* const here = "Init()"; Error( Here(here), "Error filling detectormap for %s.", - "HSCIN"); + EngineDID); return kInitError; }