9#include "TInterpreter.h"
21 return ((one->GetDetector() == two->GetDetector()) &&
44 TVector3(TMath::Sin(TMath::DegToRad() * (0.0)) * TMath::Cos(TMath::DegToRad() * (0.0)),
45 TMath::Sin(TMath::DegToRad() * (0.0)) * TMath::Sin(TMath::DegToRad() * (0.0)),
46 TMath::Cos(TMath::DegToRad() * (0.0))),
48 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (90.0)),
49 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (90.0)),
50 TMath::Cos(TMath::DegToRad() * (90.0))),
51 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (45.0)),
52 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (45.0)),
53 TMath::Cos(TMath::DegToRad() * (90.0))),
54 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (0.0)),
55 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (0.0)),
56 TMath::Cos(TMath::DegToRad() * (90.0))),
57 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (315.0)),
58 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (315.0)),
59 TMath::Cos(TMath::DegToRad() * (90.0))),
60 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (270.0)),
61 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (270.0)),
62 TMath::Cos(TMath::DegToRad() * (90.0))),
63 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (225.0)),
64 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (225.0)),
65 TMath::Cos(TMath::DegToRad() * (90.0))),
66 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (180.0)),
67 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (180.0)),
68 TMath::Cos(TMath::DegToRad() * (90.0))),
69 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (135.0)),
70 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (135.0)),
71 TMath::Cos(TMath::DegToRad() * (90.0))),
73 TVector3(TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Cos(TMath::DegToRad() * (90.0)),
74 TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Sin(TMath::DegToRad() * (90.0)),
75 TMath::Cos(TMath::DegToRad() * (45.0))),
76 TVector3(TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Cos(TMath::DegToRad() * (0.0)),
77 TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Sin(TMath::DegToRad() * (0.0)),
78 TMath::Cos(TMath::DegToRad() * (45.0))),
79 TVector3(TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Cos(TMath::DegToRad() * (270.0)),
80 TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Sin(TMath::DegToRad() * (270.0)),
81 TMath::Cos(TMath::DegToRad() * (45.0))),
82 TVector3(TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Cos(TMath::DegToRad() * (180.0)),
83 TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Sin(TMath::DegToRad() * (180.0)),
84 TMath::Cos(TMath::DegToRad() * (45.0))),
86 TVector3(TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Cos(TMath::DegToRad() * (90.0)),
87 TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Sin(TMath::DegToRad() * (90.0)),
88 TMath::Cos(TMath::DegToRad() * (135.0))),
89 TVector3(TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Cos(TMath::DegToRad() * (0.0)),
90 TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Sin(TMath::DegToRad() * (0.0)),
91 TMath::Cos(TMath::DegToRad() * (135.0))),
92 TVector3(TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Cos(TMath::DegToRad() * (270.0)),
93 TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Sin(TMath::DegToRad() * (270.0)),
94 TMath::Cos(TMath::DegToRad() * (135.0))),
95 TVector3(TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Cos(TMath::DegToRad() * (180.0)),
96 TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Sin(TMath::DegToRad() * (180.0)),
97 TMath::Cos(TMath::DegToRad() * (135.0)))
104 {gStrongCT[0], 0.0, gWeakCT[0], gWeakCT[0]},
105 {gWeakCT[0], gWeakCT[0], 0.0, gStrongCT[0]},
106 {gWeakCT[0], gWeakCT[0], gStrongCT[0], 0.0}},
107 {{0.0, gStrongCT[1], gWeakCT[1], gWeakCT[1]},
108 {gStrongCT[1], 0.0, gWeakCT[1], gWeakCT[1]},
109 {gWeakCT[1], gWeakCT[1], 0.0, gStrongCT[1]},
110 {gWeakCT[1], gWeakCT[1], gStrongCT[1], 0.0}}};
115#if MAJOR_ROOT_VERSION < 6
116 Class()->IgnoreTObjectStreamer(kTRUE);
124#if MAJOR_ROOT_VERSION < 6
125 Class()->IgnoreTObjectStreamer(kTRUE);
182 std::ostringstream str;
183 str<<
"Ifin Contains: "<<std::endl;
187 str<<std::setw(6)<<
fAddbackHits.size()<<
" addback hits"<<std::endl;
189 str<<std::setw(6)<<
" "<<
" Addback not set"<<std::endl;
192 str<<std::setw(6)<<
" "<<
" Cross-talk Set? "<<
IsCrossTalkSet()<<std::endl;
275 }
catch(
const std::out_of_range& oor) {
276 std::cerr<<ClassName()<<
" Hits are out of range: "<<oor.what()<<std::endl;
291 }
catch(
const std::out_of_range& oor) {
292 std::cerr<<ClassName()<<
"Suppressed hits are out of range: "<<oor.what()<<std::endl;
309 if(hit_vec.empty()) {
314 for(
auto& hit : sup_vec) {
319 if(sup_vec.empty()) {
324 return sup_vec.size();
339 if(hit_vec.empty()) {
345 for(
auto& hit : ab_vec) {
356 return ab_vec.size();
370 if(hit_vec.empty()) {
376 for(
auto& hit : ab_vec) {
387 return ab_vec.size();
398 }
catch(
const std::out_of_range& oor) {
399 std::cerr<<ClassName()<<
" Addback hits are out of range: "<<oor.what()<<std::endl;
414 }
catch(
const std::out_of_range& oor) {
415 std::cerr<<ClassName()<<
" Suppressed addback hits are out of range: "<<oor.what()<<std::endl;
428 if(frag ==
nullptr || chan ==
nullptr) {
436 fHits.push_back(std::move(geHit));
449 return TVector3(0, 0, 1);
460 Double_t cp = 17.678;
464 TVector3 CrystalPosition;
466 case 0: CrystalPosition.SetXYZ(-cp, cp,
id);
break;
467 case 1: CrystalPosition.SetXYZ(cp, cp,
id);
break;
468 case 2: CrystalPosition.SetXYZ(cp, -cp,
id);
break;
469 case 3: CrystalPosition.SetXYZ(-cp, -cp,
id);
break;
470 default: CrystalPosition.SetXYZ(0, 0, 1);
break;
473 CrystalPosition.RotateY(CloverPosition.Theta());
475 CrystalPosition.RotateZ(CloverPosition.Phi());
477 CloverPosition.SetMag(dist);
479 return (CloverPosition + CrystalPosition);
535 Bool_t time_constraint)
540 if((hit_to_correct ==
nullptr) || (other_hit ==
nullptr)) {
541 std::cerr<<
"One of the hits is invalid in TIfin::CTCorrectedEnergy"<<std::endl;
545 if(time_constraint) {
556 static bool been_warned[256] = {
false};
557 double fixed_energy = hit_to_correct->
GetEnergy();
562 }
catch(
const std::out_of_range& oor) {
564 if(!been_warned[
id]) {
565 been_warned[id] =
true;
566 std::cerr<<
DRED<<
"Missing CT correction for Det: "<<hit_to_correct->
GetDetector()
567 <<
" Crystals: "<<hit_to_correct->
GetCrystal()<<
" "<<other_hit->
GetCrystal()<<
" (id "<<
id<<
")"<<std::endl;
578 if(hit_vec.size() < 2) {
582 for(
auto& i : hit_vec) {
587 for(
auto& one : hit_vec) {
588 for(
auto& two : hit_vec) {
589 if(one == two)
continue;
ClassImp(THILMnemonic) void THILMnemonic
bool DefaultIfinSuppression(const TDetectorHit *hit, const TDetectorHit *bgoHit)
bool DefaultIfinAddback(const TDetectorHit *one, const TDetectorHit *two)
double SuppressionWindow() const
double AddbackWindow() const
double SuppressionEnergy() const
std::vector< double > GetCTCoeff() const
const TMnemonic * GetMnemonic() const
virtual double GetEnergy(Option_t *opt="") const
virtual Int_t GetCrystal() const
!
TChannel * GetChannel() const
!
virtual Int_t GetDetector() const
!
virtual Double_t GetTime(const ETimeFlag &correct_flag=ETimeFlag::kAll, Option_t *opt="") const
Returns a time value to the nearest nanosecond!
std::vector< TDetectorHit * > fHits
virtual Short_t GetMultiplicity() const
virtual const std::vector< TDetectorHit * > & GetHitVector() const
static TAnalysisOptions * AnalysisOptions()
Double_t GetNoCTEnergy(Option_t *opt="") const
std::vector< TDetectorHit * > fAddbackHits
! Used to create addback hits on the fly
std::vector< TDetectorHit * > & GetAddbackVector()
!
std::vector< UShort_t > fAddbackFrags
! Number of crystals involved in creating the addback hit
std::vector< UShort_t > & GetSuppressedAddbackFragVector()
std::vector< TDetectorHit * > & GetSuppressedAddbackVector()
@ kIsSuppressedAddbackSet
static const char * GetColorFromNumber(int number)
bool IsAddbackSet() const
UShort_t GetNAddbackFrags(const size_t &idx)
Int_t GetSuppressedAddbackMultiplicity(const TBgo *bgo)
std::vector< UShort_t > & GetAddbackFragVector()
!
Bool_t IsCrossTalkSet() const
TIfin & operator=(const TIfin &)
!
TIfinHit * GetSuppressedAddbackHit(const int &i)
std::vector< TDetectorHit * > fSuppressedAddbackHits
! Used to create suppressed addback hits on the fly
void SetBitNumber(EIfinBits bit, Bool_t set) const
TTransientBits< UChar_t > fIfinBits
static TVector3 gCloverPosition[17]
! Position of each HPGe Clover
bool IsSuppressed() const
void ClearStatus() const
!
std::vector< TDetectorHit * > fSuppressedHits
! Used to create suppressed hits on the fly
bool IsSuppressedAddbackSet() const
TIfinHit * GetAddbackHit(const int &i)
void ResetSuppressedAddback()
Int_t GetAddbackMultiplicity()
void SetSuppressedAddback(bool flag=true) const
std::vector< TDetectorHit * > & GetSuppressedVector()
Int_t GetSuppressedMultiplicity(const TBgo *bgo)
Bool_t TestBitNumber(EIfinBits bit) const
static Double_t CTCorrectedEnergy(const TIfinHit *const hit_to_correct, const TIfinHit *const other_hit, Bool_t time_constraint=true)
static std::function< bool(const TDetectorHit *, const TDetectorHit *)> fSuppressionCriterion
TIfinHit * GetSuppressedHit(const int &i)
static const Double_t gCrossTalkPar[2][4][4]
!
static TVector3 GetPosition(int DetNbr, int CryNbr=5, double dist=90.0)
!
std::vector< UShort_t > fSuppressedAddbackFrags
! Number of crystals involved in creating the suppressed addback hit
TIfinHit * GetIfinHit(const Int_t &i)
static const Double_t gStrongCT[2]
!
void SetAddback(bool flag=true) const
void Clear(Option_t *opt="all") override
!
static const Double_t gWeakCT[2]
!
void SetSuppressed(bool flag=true) const
void AddFragment(const std::shared_ptr< const TFragment > &, TChannel *) override
!
static std::function< bool(const TDetectorHit *, const TDetectorHit *)> fAddbackCriterion
void SetCrossTalk(bool flag=true) const
void Copy(TObject &) const override
!
void Print(Option_t *opt="") const override
!
virtual EMnemonic SubSystem() const
void Clear(Option_t *opt="all") override
!
void Copy(TObject &) const override
!
void CreateAddback(const std::vector< T * > &hits, std::vector< T * > &addbacks, std::vector< UShort_t > &nofFragments)
void CreateSuppressed(const TBgo *bgo, const std::vector< T * > &hits, std::vector< T * > &suppressedHits)
void CreateSuppressedAddback(const TBgo *bgo, const std::vector< T * > &hits, std::vector< T * > &addbacks, std::vector< UShort_t > &nofFragments)
void SetBit(T bit, Bool_t flag)