Skip to content
Snippets Groups Projects
Commit 54823e0b authored by Stephen A. Wood's avatar Stephen A. Wood Committed by Stephen A. Wood
Browse files

Complete Aerogel hit map code and example.

parent 0e4285e0
No related branches found
No related tags found
No related merge requests found
...@@ -23,3 +23,5 @@ raddeg=3.14159265/180 ...@@ -23,3 +23,5 @@ raddeg=3.14159265/180
#include "PARAM/shodo.pos" #include "PARAM/shodo.pos"
#include "PARAM/scal.pos" #include "PARAM/scal.pos"
#include "PARAM/hhodo.param" #include "PARAM/hhodo.param"
#include "PARAM/haero.param"
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
HMS->AddDetector( new THcHodoscope("hod", "Hodoscope" )); HMS->AddDetector( new THcHodoscope("hod", "Hodoscope" ));
HMS->AddDetector( new THcShower("Cal", "Shower" )); HMS->AddDetector( new THcShower("Cal", "Shower" ));
HMS->AddDetector( new THcDriftChamber("dc", "Drift Chambers" )); HMS->AddDetector( new THcDriftChamber("dc", "Drift Chambers" ));
HMS->AddDetector( new THcAerogel("aero", "Aerogel Cerenkov" ));
// Set up the analyzer - we use the standard one, // Set up the analyzer - we use the standard one,
// but this could be an experiment-specific one as well. // but this could be an experiment-specific one as well.
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
block H.dc.* block H.dc.*
block H.hod.* block H.hod.*
block H.Cal.* block H.Cal.*
block H.aero.*
block g.evtyp block g.evtyp
# TDC hits per paddle # TDC hits per paddle
......
...@@ -10,12 +10,15 @@ ...@@ -10,12 +10,15 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include "THcAerogel.h" #include "THcAerogel.h"
#include "TClonesArray.h"
#include "THcSignalHit.h"
#include "THaEvData.h" #include "THaEvData.h"
#include "THaDetMap.h" #include "THaDetMap.h"
#include "THcDetectorMap.h" #include "THcDetectorMap.h"
#include "THcGlobals.h" #include "THcGlobals.h"
#include "THaCutList.h" #include "THaCutList.h"
#include "THcParmList.h" #include "THcParmList.h"
#include "THcHitList.h"
#include "VarDef.h" #include "VarDef.h"
#include "VarType.h" #include "VarType.h"
#include "THaTrack.h" #include "THaTrack.h"
...@@ -36,7 +39,12 @@ THcAerogel::THcAerogel( const char* name, const char* description, ...@@ -36,7 +39,12 @@ THcAerogel::THcAerogel( const char* name, const char* description,
THaApparatus* apparatus ) : THaApparatus* apparatus ) :
THaNonTrackingDetector(name,description,apparatus) THaNonTrackingDetector(name,description,apparatus)
{ {
// Constructor // Normal constructor with name and description
fPosTDCHits = new TClonesArray("THcSignalHit",16);
fNegTDCHits = new TClonesArray("THcSignalHit",16);
fPosADCHits = new TClonesArray("THcSignalHit",16);
fNegADCHits = new TClonesArray("THcSignalHit",16);
// fTrackProj = new TClonesArray( "THaTrackProj", 5 ); // fTrackProj = new TClonesArray( "THaTrackProj", 5 );
} }
...@@ -47,31 +55,12 @@ THcAerogel::THcAerogel( ) : ...@@ -47,31 +55,12 @@ THcAerogel::THcAerogel( ) :
// Constructor // Constructor
} }
//_____________________________________________________________________________
void THcAerogel::Setup(const char* name, const char* description)
{
// Do we need this for the Aerogel? It is just one plane.
// static const char* const here = "Setup()";
// static const char* const message =
// "Must construct %s detector with valid name! Object construction failed.";
cout << "In THcAerogel::Setup()" << endl;
// Base class constructor failed?
if( IsZombie()) return;
fDebug = 1; // Keep this at one while we're working on the code
}
//_____________________________________________________________________________ //_____________________________________________________________________________
THaAnalysisObject::EStatus THcAerogel::Init( const TDatime& date ) THaAnalysisObject::EStatus THcAerogel::Init( const TDatime& date )
{ {
static const char* const here = "Init()"; static const char* const here = "Init()";
cout << "THcAerogel::Init " << GetName() << endl; cout << "THcAerogel::Init " << GetName() << endl;
Setup(GetName(), GetTitle());
// Should probably put this in ReadDatabase as we will know the // Should probably put this in ReadDatabase as we will know the
// maximum number of hits after setting up the detector map // maximum number of hits after setting up the detector map
...@@ -159,8 +148,11 @@ Int_t THcAerogel::DefineVariables( EMode mode ) ...@@ -159,8 +148,11 @@ Int_t THcAerogel::DefineVariables( EMode mode )
inline inline
void THcAerogel::Clear(Option_t* opt) void THcAerogel::Clear(Option_t* opt)
{ {
// Reset per-event data. // Clears the hit lists
// fTrackProj->Clear(); fPosTDCHits->Clear();
fNegTDCHits->Clear();
fPosADCHits->Clear();
fNegADCHits->Clear();
} }
//_____________________________________________________________________________ //_____________________________________________________________________________
...@@ -184,7 +176,47 @@ Int_t THcAerogel::Decode( const THaEvData& evdata ) ...@@ -184,7 +176,47 @@ Int_t THcAerogel::Decode( const THaEvData& evdata )
fAnalyzePedestals = 0; // Don't analyze pedestals next event fAnalyzePedestals = 0; // Don't analyze pedestals next event
} }
return nhits; Int_t nPosTDCHits=0;
Int_t nNegTDCHits=0;
Int_t nPosADCHits=0;
Int_t nNegADCHits=0;
fPosTDCHits->Clear();
fNegTDCHits->Clear();
fPosADCHits->Clear();
fNegADCHits->Clear();
Int_t ihit = 0;
while(ihit < nhits) {
THcAerogelHit* hit = (THcAerogelHit *) fRawHitList->At(ihit);
// TDC positive hit
if(hit->fTDC_pos > 0) {
THcSignalHit *sighit = (THcSignalHit*) fPosTDCHits->ConstructedAt(nPosTDCHits++);
sighit->Set(hit->fCounter, hit->fTDC_pos);
}
// TDC negative hit
if(hit->fTDC_neg > 0) {
THcSignalHit *sighit = (THcSignalHit*) fNegTDCHits->ConstructedAt(nNegTDCHits++);
sighit->Set(hit->fCounter, hit->fTDC_neg);
}
// ADC positive hit
if(hit->fADC_pos > 0) {
THcSignalHit *sighit = (THcSignalHit*) fPosADCHits->ConstructedAt(nPosADCHits++);
sighit->Set(hit->fCounter, hit->fADC_pos);
}
// ADC negative hit
if(hit->fADC_neg > 0) {
THcSignalHit *sighit = (THcSignalHit*) fNegADCHits->ConstructedAt(nNegADCHits++);
sighit->Set(hit->fCounter, hit->fADC_neg);
}
ihit++;
}
return ihit;
} }
//_____________________________________________________________________________ //_____________________________________________________________________________
......
...@@ -41,6 +41,13 @@ class THcAerogel : public THaNonTrackingDetector, public THcHitList { ...@@ -41,6 +41,13 @@ class THcAerogel : public THaNonTrackingDetector, public THcHitList {
Double_t* fPosGain; Double_t* fPosGain;
Double_t* fNegGain; Double_t* fNegGain;
// Hits
TClonesArray* fPosTDCHits;
TClonesArray* fNegTDCHits;
TClonesArray* fPosADCHits;
TClonesArray* fNegADCHits;
// Pedestals
Int_t fNPedestalEvents; Int_t fNPedestalEvents;
Int_t fMinPeds; Int_t fMinPeds;
Int_t *fPosPedSum; /* Accumulators for pedestals */ Int_t *fPosPedSum; /* Accumulators for pedestals */
......
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