38 fPosAdcTimeWindowMin(0), fNegAdcTimeWindowMin(0),
39 fPosAdcTimeWindowMax(0), fNegAdcTimeWindowMax(0),
40 fPedPosDefault(0),fPedNegDefault(0),
41 fShPosPedLimit(0), fShNegPedLimit(0), fPosGain(0), fNegGain(0),
42 fClusterList(0), fLayerNames(0), fLayerZPos(0), BlockThick(0),
43 fNBlocks(0), fXPos(0), fYPos(0), fZPos(0), fPlanes(0), fArray(0)
56 fPosAdcTimeWindowMin(0), fNegAdcTimeWindowMin(0),
57 fPosAdcTimeWindowMax(0), fNegAdcTimeWindowMax(0),
58 fPedPosDefault(0),fPedNegDefault(0),
59 fShPosPedLimit(0), fShNegPedLimit(0), fPosGain(0), fNegGain(0),
60 fClusterList(0), fLayerNames(0), fLayerZPos(0), BlockThick(0),
61 fNBlocks(0), fXPos(0), fYPos(0), fZPos(0), fPlanes(0), fArray(0)
79 {
"cal_layer_names", &layernamelist, kString},
88 vector<string> layer_names = Podd::vsplit(layernamelist);
91 cout <<
"THcShower::Setup ERROR: Number of layers " <<
fNTotLayers
92 <<
" doesn't agree with number of layer names "
93 << layer_names.size() << endl;
99 fLayerNames[i] =
new char[layer_names[i].length()+1];
103 char *desc =
new char[strlen(description)+100];
107 strcpy(desc, description);
108 strcat(desc,
" Plane ");
115 strcpy(desc, description);
116 strcat(desc,
" Array ");
129 cout <<
"From THcShower::Setup: created Shower planes for "
150 char EngineDID[] =
"xCAL";
153 static const char*
const here =
"Init()";
154 Error(
Here(here),
"Error filling detectormap for %s.", EngineDID );
264 cout <<
"---------------------------------------------------------------\n";
265 cout <<
"Debug output from THcShower::ReadDatabase for "
268 cout <<
" Number of neg. columns = " <<
fNegCols << endl;
269 cout <<
" Slop parameter = " <<
fSlop << endl;
270 cout <<
" Fiducial volume test flag = " <<
fvTest << endl;
271 cout <<
" Fiducial volume excl. width = " <<
fvDelta << endl;
272 cout <<
" Initialize debug flag = " <<
fdbg_init_cal << endl;
273 cout <<
" Raw hit debug flag = " <<
fdbg_raw_cal << endl;
293 cout <<
" Coordinate correction constants:\n";
294 cout <<
" fAcor = " <<
fAcor << endl;
295 cout <<
" fBcor = " <<
fBcor << endl;
296 cout <<
" fCcor = " <<
fCcor[0] <<
", " <<
fCcor[1] << endl;
297 cout <<
" fDcor = " <<
fDcor[0] <<
", " <<
fDcor[1] << endl;
332 cout <<
" Plane " <<
fLayerNames[i] <<
":" << endl;
333 cout <<
" Block thickness: " <<
BlockThick[i] << endl;
334 cout <<
" NBlocks : " <<
fNBlocks[i] << endl;
335 cout <<
" Z Position : " <<
fLayerZPos[i] << endl;
336 cout <<
" Y Positions : " <<
fYPos[2*i] <<
", " <<
fYPos[2*i+1]
338 cout <<
" X Positions :";
340 cout <<
" " <<
fXPos[i][j];
356 cout <<
" Fiducial volume limits:" << endl;
357 cout <<
" Xmin = " <<
fvXmin <<
" Xmax = " <<
fvXmax << endl;
358 cout <<
" Ymin = " <<
fvYmin <<
" Ymax = " <<
fvYmax << endl;
368 cout <<
" Total number of blocks in the layers of calorimeter: " << dec
429 cout <<
" hcal_pos_cal_const:" << endl;
433 cout << hcal_pos_cal_const[j*
fNBlocks[j]+i] <<
" ";
438 cout <<
" fShPosPedLimit:" << endl;
447 cout <<
" hcal_pos_gain_cor:" << endl;
451 cout << hcal_pos_gain_cor[j*
fNBlocks[j]+i] <<
" ";
456 cout <<
" hcal_neg_cal_const:" << endl;
460 cout << hcal_neg_cal_const[j*
fNBlocks[j]+i] <<
" ";
465 cout <<
" fShNegPedLimit:" << endl;
474 cout <<
" hcal_neg_gain_cor:" << endl;
478 cout << hcal_neg_gain_cor[j*
fNBlocks[j]+i] <<
" ";
488 fPosGain[i] = hcal_pos_cal_const[i] * hcal_pos_gain_cor[i];
489 fNegGain[i] = hcal_neg_cal_const[i] * hcal_neg_gain_cor[i];
495 cout <<
" fPosGain:" << endl;
504 cout <<
" fNegGain:" << endl;
526 cout <<
" Origin of the Calorimeter:" << endl;
527 cout <<
" Xorig = " <<
GetOrigin().
X() << endl;
528 cout <<
" Yorig = " <<
GetOrigin().
Y() << endl;
529 cout <<
" Zorig = " <<
GetOrigin().
Z() << endl;
530 cout <<
"---------------------------------------------------------------\n";
554 {
"nhits",
"Number of hits",
"fNhits" },
555 {
"nclust",
"Number of layer clusters",
"fNclust" },
556 {
"nclusttrack",
"Number of layer cluster which matched best track",
"fNclustTrack" },
557 {
"xclusttrack",
"X pos of layer cluster which matched best track",
"fXclustTrack" },
558 {
"xtrack",
"X pos of track which matched layer cluster",
"fXTrack" },
559 {
"yclusttrack",
"Y pos of layer cluster which matched best track",
"fYclustTrack" },
560 {
"ytrack",
"Y pos of track which matched layer cluster",
"fYTrack" },
561 {
"etot",
"Total energy",
"fEtot" },
562 {
"etotnorm",
"Total energy divided by Central Momentum",
"fEtotNorm" },
563 {
"etrack",
"Track energy",
"fEtrack" },
564 {
"etracknorm",
"Total energy divided by track momentum",
"fEtrackNorm" },
565 {
"eprtrack",
"Track Preshower energy",
"fEPRtrack" },
566 {
"eprtracknorm",
"Preshower energy divided by track momentum",
"fEPRtrackNorm" },
567 {
"etottracknorm",
"Total energy divided by track momentum",
"fETotTrackNorm" },
568 {
"ntracks",
"Number of shower tracks",
"fNtracks" },
574 RVarDef array_vars[] = {
575 {
"sizeclustarray",
"Number of block in array cluster that matches track",
"fSizeClustArray" },
576 {
"nclustarraytrack",
"Number of cluster for Fly's eye which matched best track",
"fNclustArrayTrack" },
577 {
"nblock_high_ene",
"Block number in array with highest energy which matched best track",
"fNblockHighEnergy" },
578 {
"xclustarraytrack",
"X pos of cluster which matched best track",
"fXclustArrayTrack" },
579 {
"xtrackarray",
"X pos of track which matched cluster",
"fXTrackArray" },
580 {
"yclustarraytrack",
"Y pos of cluster which matched best track",
"fYclustArrayTrack" },
581 {
"ytrackarray",
"Y pos of track which matched cluster",
"fYTrackArray" },
604 Podd::DeleteContainer(**i);
686 Podd::DeleteContainer(**i);
779 if (Eneg>0)
y =
fYPos[2*j]/2 ;
780 if (Epos>0)
y =
fYPos[2*j+1]/2 ;
781 if (Epos>0 && Eneg>0)
y = 0. ;
800 cout <<
"---------------------------------------------------------------\n";
801 cout <<
"Debug output from THcShower::CoarseProcess for "
804 cout <<
" event = " <<
fEvent << endl;
805 cout <<
" List of unclustered hits. Total hits: " <<
fNhits << endl;
808 cout <<
" hit " << i <<
": ";
816 assert( HitSet.empty() );
818 fNclust = (*fClusterList).size();
824 cout <<
" event = " <<
fEvent <<
" Clustered hits. Number of clusters: " <<
fNclust << endl;
828 ppcl != (*fClusterList).end(); ++ppcl) {
830 cout <<
" Cluster #" << i++
831 <<
": E=" <<
clE(*ppcl)
832 <<
" Epr=" <<
clEpr(*ppcl)
833 <<
" X=" <<
clX(*ppcl)
834 <<
" Z=" <<
clZ(*ppcl)
835 <<
" size=" << (**ppcl).size()
841 cout <<
" hit " << j++ <<
": ";
847 cout <<
"---------------------------------------------------------------\n";
857 for (
Int_t itrk=0; itrk<Ntracks; itrk++) {
878 while (HitSet.size() != 0) {
883 (*cluster).insert(*(--it));
886 bool clustered =
true;
897 if ((**i).isNeighbour(*k)) {
898 (*cluster).insert(*i);
904 if (clustered)
break;
907 if (clustered)
break;
912 ClusterList->push_back(cluster);
923 return x +
h->hitE();
927 return x +
h->hitE() *
h->hitX();
931 return x +
h->hitE() *
h->hitY();
935 return x +
h->hitE() *
h->hitZ();
939 return h->hitColumn() == 0 ?
x +
h->hitE() :
x;
943 return x +
h->hitEpos();
947 return x +
h->hitEneg();
955 Double_t Etot = accumulate((*cluster).begin(),(*cluster).end(),0.,
addE);
957 accumulate((*cluster).begin(),(*cluster).end(),0.,
addY)/Etot : -100.);
964 Double_t Etot = accumulate((*cluster).begin(),(*cluster).end(),0.,
addE);
966 accumulate((*cluster).begin(),(*cluster).end(),0.,
addX)/Etot : -100.);
974 Double_t Etot = accumulate((*cluster).begin(),(*cluster).end(),0.,
addE);
976 accumulate((*cluster).begin(),(*cluster).end(),0.,
addZ)/Etot : 0.);
982 return accumulate((*cluster).begin(),(*cluster).end(),0.,
addE);
988 return accumulate((*cluster).begin(),(*cluster).end(),0.,
addEpr);
999 if (side!=0&&side!=1&&side!=2) {
1000 cout <<
"*** Wrong Side in clEplane:" << side <<
" ***" << endl;
1005 for (
THcShowerHitIt it=(*cluster).begin(); it!=(*cluster).end(); ++it) {
1006 if ((*it)->hitColumn() == iplane) pcluster.insert(*it);
1012 Eplane = accumulate(pcluster.begin(),pcluster.end(),0.,
addEpos);
1015 Eplane = accumulate(pcluster.begin(),pcluster.end(),0.,
addEneg);
1018 Eplane = accumulate(pcluster.begin(),pcluster.end(),0.,
addE);
1070 inFidVol = (XTrFront <=
fvXmax) && (XTrFront >=
fvXmin) &&
1106 cout <<
"---------------------------------------------------------------\n";
1107 cout <<
"Debug output from THcShower::MatchCluster for "
1109 cout <<
" event = " <<
fEvent << endl;
1111 cout <<
" Track at DC:"
1112 <<
" X = " <<
Track->GetX()
1113 <<
" Y = " <<
Track->GetY()
1114 <<
" Theta = " <<
Track->GetTheta()
1115 <<
" Phi = " <<
Track->GetPhi()
1117 cout <<
" Track at the front of Calorimeter:"
1118 <<
" X = " << XTrFront
1119 <<
" Y = " << YTrFront
1120 <<
" Pathl = " << pathl
1123 cout <<
" Fiducial volume test: inFidVol = " << inFidVol << endl;
1125 cout <<
" Matched cluster #" << mclust <<
", delatX= " << deltaX
1127 cout <<
"---------------------------------------------------------------\n";
1162 for (
UInt_t ip=L0; ip<L0+NLayers; ip++) {
1172 if (prefix ==
'H') {
1173 corpos =
Ycor(Ytr,0);
1174 corneg =
Ycor(Ytr,1);
1187 Etrk +=
clEplane(cluster,ip,0) * corpos;
1188 Etrk +=
clEplane(cluster,ip,1) * corneg;
1197 cout <<
"---------------------------------------------------------------\n";
1198 cout <<
"Debug output from THcShower::GetShEnergy for "
1200 cout <<
" event = " <<
fEvent << endl;
1202 cout <<
" Track at the calorimeter: X = " << Xtr <<
" Y = " << Ytr;
1204 cout <<
", matched cluster #" << mclust <<
"." << endl;
1206 cout <<
", no matched cluster found." << endl;
1208 cout <<
" Layers from " << L0+1 <<
" to " << L0+NLayers <<
".\n";
1209 cout <<
" Coordinate corrected track energy = " << Etrk <<
"." << endl;
1210 cout <<
"---------------------------------------------------------------\n";
1226 for (
Int_t itrk=0; itrk<Ntracks; itrk++) {
1268 cout <<
"---------------------------------------------------------------\n";
1269 cout <<
"Debug output from THcShower::FineProcess for "
1271 cout <<
" event = " <<
fEvent << endl;
1272 cout <<
" Number of tracks = " << Ntracks << endl;
1274 cout <<
" matching cluster info " << endl;
1279 for (
Int_t itrk=0; itrk<Ntracks; itrk++) {
1281 cout <<
" Track " << itrk <<
": "
1282 <<
" X = " << theTrack->
GetX()
1283 <<
" Y = " << theTrack->
GetY()
1284 <<
" Theta = " << theTrack->
GetTheta()
1285 <<
" Phi = " << theTrack->
GetPhi()
1286 <<
" Energy = " << theTrack->
GetEnergy()
1290 cout <<
"---------------------------------------------------------------\n";
Option_t Option_t TPoint TPoint const char mode
R__EXTERN class THaVarList * gHaVars
R__EXTERN class THaCutList * gHaCuts
ClassImp(VDC::AnalyticTTDConv) using namespace std
R__EXTERN class THcParmList * gHcParms
R__EXTERN class THcDetectorMap * gHcDetectorMap
THcShowerClusterList::iterator THcShowerClusterListIt
THcShowerHitSet::iterator THcShowerHitIt
THcShowerCluster::iterator THcShowerClusterIt
THcShowerHitSet THcShowerCluster
vector< THcShowerCluster * > THcShowerClusterList
set< THcShowerHit * > THcShowerHitSet
Double_t addZ(Double_t x, THcShowerHit *h)
Double_t addE(Double_t x, THcShowerHit *h)
Double_t addY(Double_t x, THcShowerHit *h)
Double_t clE(THcShowerCluster *cluster)
Double_t addEpos(Double_t x, THcShowerHit *h)
Double_t clEplane(THcShowerCluster *cluster, Int_t iplane, Int_t side)
Double_t addEneg(Double_t x, THcShowerHit *h)
Double_t clX(THcShowerCluster *cluster)
Double_t addX(Double_t x, THcShowerHit *h)
Double_t clEpr(THcShowerCluster *cluster)
Double_t clZ(THcShowerCluster *cluster)
Double_t addEpr(Double_t x, THcShowerHit *h)
Double_t clY(THcShowerCluster *cluster)
Double_t clE(THcShowerCluster *cluster)
Double_t clEplane(THcShowerCluster *cluster, Int_t iplane, Int_t side)
Double_t clX(THcShowerCluster *cluster)
Double_t clEpr(THcShowerCluster *cluster)
Double_t clZ(THcShowerCluster *cluster)
Double_t clY(THcShowerCluster *cluster)
char * Form(const char *fmt,...)
static Int_t DefineVarsFromList(const void *list, EType type, EMode mode, const char *def_prefix, const TObject *obj, const char *prefix, const char *here, const char *comment_subst="")
virtual const char * Here(const char *) const
virtual Int_t Result(const char *cutname="", EWarnMode mode=kWarn)
UInt_t GetTotNumChan() const
virtual void DefineAxes(Double_t rotation_angle)
const TVector3 & GetOrigin() const
THaApparatus * GetApparatus() const
Bool_t CalcTrackIntercept(THaTrack *track, Double_t &pathl, Double_t &xdet, Double_t &ydet)
Double_t GetEnergy() const
Double_t GetTheta() const
void SetEnergy(Double_t energy)
virtual THaVar * Find(const char *name) const
const void * GetValuePointer() const
virtual Int_t FillMap(THaDetMap *detmap, const char *detectorname)
A standard Hall C spectrometer apparatus.
virtual Int_t DecodeToHitList(const THaEvData &evdata, Bool_t suppress=kFALSE)
Populate the hitlist from the raw event data.
TClonesArray * fRawHitList
void CreateMissReportParms(const char *prefix) const
void InitHitList(THaDetMap *detmap, const char *hitclass, Int_t maxhits, Int_t tdcref_cut=0, Int_t adcref_cut=0)
Save the electronics module to detector mapping and initialize a hit array of hits of class hitclass.
void MissReport(const char *name) const
Int_t LoadParmValues(const DBRequest *list, const char *prefix="")
Retrieve parameter values from the parameter cache.
virtual Int_t CoarseProcessHits()
Double_t GetClMaxEnergyBlock()
virtual void Clear(Option_t *opt="")
virtual Int_t CoarseProcess(TClonesArray &tracks)
virtual EStatus Init(const TDatime &run_time)
virtual Int_t AccumulatePedestals(TClonesArray *rawhits, Int_t nexthit)
virtual void CalculatePedestals()
Float_t GetShEnergy(THaTrack *)
Int_t AccumulateStat(TClonesArray &tracks)
virtual Int_t ProcessHits(TClonesArray *rawhits, Int_t nexthit)
Int_t MatchCluster(THaTrack *, Double_t &, Double_t &)
One plane of shower blocks with side readout.
virtual Int_t CoarseProcessHits()
virtual void Clear(Option_t *opt="")
Double_t GetEpos(Int_t i)
Double_t GetEneg(Int_t i)
virtual Int_t ProcessHits(TClonesArray *rawhits, Int_t nexthit)
Double_t GetEmean(Int_t i)
Double_t GetAnegP(Int_t i)
virtual Int_t AccumulatePedestals(TClonesArray *rawhits, Int_t nexthit)
virtual void CalculatePedestals()
Generic segmented shower detector.
Double_t * fPosAdcTimeWindowMax
Int_t MatchCluster(THaTrack *, Double_t &, Double_t &)
Float_t YcorPr(Double_t y, Int_t side)
virtual Int_t End(THaRunBase *r=0)
void Setup(const char *name, const char *description)
virtual EStatus Init(const TDatime &run_time)
Double_t fYclustArrayTrack
virtual Int_t ReadDatabase(const TDatime &date)
Double_t * fNegAdcTimeWindowMin
Float_t GetShEnergy(THaTrack *, UInt_t NLayers, UInt_t L0=0)
void ClusterHits(THcShowerHitSet &HitSet, THcShowerClusterList *ClusterList)
THcShowerPlane ** fPlanes
virtual Int_t FineProcess(TClonesArray &tracks)
friend class THcShowerPlane
THcShowerClusterList * fClusterList
Double_t * fPosAdcTimeWindowMin
static const Int_t kADCDynamicPedestal
Double_t fXclustArrayTrack
Double_t * fNegAdcTimeWindowMax
virtual Int_t CoarseProcess(TClonesArray &tracks)
virtual void Clear(Option_t *opt="")
virtual Int_t Decode(const THaEvData &)
friend class THcShowerArray
virtual Int_t DefineVariables(EMode mode=kDefine)
Int_t fdbg_sparsified_cal
const char * GetName() const override
const char * GetTitle() const override
virtual void Error(const char *method, const char *msgfmt,...) const
void SetXYZ(Double_t x, Double_t y, Double_t z)
Double_t Min(Double_t a, Double_t b)
Double_t Max(Double_t a, Double_t b)