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)))
103#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
104 Class()->IgnoreTObjectStreamer(kTRUE);
112#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
113 Class()->IgnoreTObjectStreamer(kTRUE);
169 std::ostringstream str;
170 str<<
"Fipps Contains: "<<std::endl;
174 str<<std::setw(6)<<
fAddbackHits.size()<<
" addback hits"<<std::endl;
176 str<<std::setw(6)<<
" "<<
" Addback not set"<<std::endl;
179 str<<std::setw(6)<<
" "<<
" Cross-talk Set? "<<
IsCrossTalkSet()<<std::endl;
262 }
catch(
const std::out_of_range& oor) {
263 std::cerr<<ClassName()<<
" Hits are out of range: "<<oor.what()<<std::endl;
278 }
catch(
const std::out_of_range& oor) {
279 std::cerr<<ClassName()<<
"Suppressed hits are out of range: "<<oor.what()<<std::endl;
296 if(hit_vec.empty()) {
301 for(
auto& hit : sup_vec) {
306 if(sup_vec.empty()) {
311 return sup_vec.size();
325 if(hit_vec.empty()) {
331 for(
auto& hit : ab_vec) {
342 return ab_vec.size();
356 if(hit_vec.empty()) {
362 for(
auto& hit : ab_vec) {
373 return ab_vec.size();
384 }
catch(
const std::out_of_range& oor) {
385 std::cerr<<ClassName()<<
" Addback hits are out of range: "<<oor.what()<<std::endl;
400 }
catch(
const std::out_of_range& oor) {
401 std::cerr<<ClassName()<<
" Suppressed addback hits are out of range: "<<oor.what()<<std::endl;
414 if(frag ==
nullptr || chan ==
nullptr) {
422 fHits.push_back(hit);
435 return TVector3(0, 0, 1);
446 Double_t cp = 17.678;
450 TVector3 CrystalPosition;
452 case 0: CrystalPosition.SetXYZ(-cp, cp,
id);
break;
453 case 1: CrystalPosition.SetXYZ(cp, cp,
id);
break;
454 case 2: CrystalPosition.SetXYZ(cp, -cp,
id);
break;
455 case 3: CrystalPosition.SetXYZ(-cp, -cp,
id);
break;
456 default: CrystalPosition.SetXYZ(0, 0, 1);
break;
459 CrystalPosition.RotateY(CloverPosition.Theta());
461 CrystalPosition.RotateZ(CloverPosition.Phi());
463 CloverPosition.SetMag(dist);
465 return (CloverPosition + CrystalPosition);
522 Bool_t time_constraint)
527 if((hit_to_correct ==
nullptr) || (other_hit ==
nullptr)) {
528 std::cerr<<
"One of the hits is invalid in TFipps::CTCorrectedEnergy"<<std::endl;
532 if(time_constraint) {
543 static bool been_warned[256] = {
false};
544 double fixed_energy = hit_to_correct->
GetEnergy();
549 }
catch(
const std::out_of_range& oor) {
551 if(!been_warned[
id]) {
552 been_warned[id] =
true;
553 std::cerr<<
DRED<<
"Missing CT correction for Det: "<<hit_to_correct->
GetDetector()
567 if(hit_vec.size() < 2) {
571 for(
auto& hit : hit_vec) {
572 static_cast<TFippsHit*
>(hit)->ClearEnergy();
576 for(
auto& one : hit_vec) {
577 for(
auto& two : hit_vec) {
578 if(one == two)
continue;
bool DefaultFippsSuppression(const TDetectorHit *hit, const TDetectorHit *bgoHit)
bool DefaultFippsAddback(const TDetectorHit *one, const TDetectorHit *two)
ClassImp(THILMnemonic) void THILMnemonic
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
Double_t GetNoCTEnergy(Option_t *opt="") const
std::vector< TDetectorHit * > & GetAddbackVector()
!
std::vector< UShort_t > & GetAddbackFragVector()
!
UShort_t GetNAddbackFrags(const size_t &idx)
TFipps & operator=(const TFipps &)
!
Bool_t TestBitNumber(EFippsBits bit) const
std::vector< UShort_t > fAddbackFrags
! Number of crystals involved in creating the addback hit
static TVector3 GetPosition(int DetNbr, int CryNbr=5, double dist=90.0)
!
TFippsHit * GetSuppressedHit(const int &i)
std::vector< TDetectorHit * > fSuppressedAddbackHits
! Used to create suppressed addback hits on the fly
static std::function< bool(const TDetectorHit *, const TDetectorHit *)> fSuppressionCriterion
std::vector< UShort_t > fSuppressedAddbackFrags
! Number of crystals involved in creating the suppressed addback hit
void Copy(TObject &) const override
!
TFippsHit * GetAddbackHit(const int &i)
void SetCrossTalk(bool flag=true) const
bool IsAddbackSet() const
TFippsHit * GetFippsHit(const Int_t &i)
Int_t GetSuppressedAddbackMultiplicity(const TBgo *bgo)
void ClearStatus() const
!
TTransientBits< UChar_t > fFippsBits
static const char * GetColorFromNumber(int number)
bool IsSuppressed() const
std::vector< TDetectorHit * > & GetSuppressedAddbackVector()
void ResetSuppressedAddback()
TFippsHit * GetSuppressedAddbackHit(const int &i)
std::vector< TDetectorHit * > & GetSuppressedVector()
void SetBitNumber(EFippsBits bit, Bool_t set) const
void SetSuppressedAddback(bool flag=true) const
bool IsSuppressedAddbackSet() const
Bool_t IsCrossTalkSet() const
static Double_t CTCorrectedEnergy(const TFippsHit *const hit_to_correct, const TFippsHit *const other_hit, Bool_t time_constraint=true)
void SetSuppressed(bool flag=true) const
std::vector< TDetectorHit * > fSuppressedHits
! Used to create suppressed hits on the fly
static TVector3 gCloverPosition[17]
! Position of each HPGe Clover
static std::function< bool(const TDetectorHit *, const TDetectorHit *)> fAddbackCriterion
void SetAddback(bool flag=true) const
Int_t GetSuppressedMultiplicity(const TBgo *bgo)
void Clear(Option_t *opt="all") override
!
std::vector< UShort_t > & GetSuppressedAddbackFragVector()
@ kIsSuppressedAddbackSet
std::vector< TDetectorHit * > fAddbackHits
! Used to create addback hits on the fly
Int_t GetAddbackMultiplicity()
void Print(Option_t *opt="") const override
!
void AddFragment(const std::shared_ptr< const TFragment > &, TChannel *) override
!
static TAnalysisOptions * AnalysisOptions()
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)