9#include "TInterpreter.h"
39 TVector3(TMath::Sin(TMath::DegToRad() * (0.0)) * TMath::Cos(TMath::DegToRad() * (0.0)),
40 TMath::Sin(TMath::DegToRad() * (0.0)) * TMath::Sin(TMath::DegToRad() * (0.0)),
41 TMath::Cos(TMath::DegToRad() * (0.0))),
43 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (90.0)),
44 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (90.0)),
45 TMath::Cos(TMath::DegToRad() * (90.0))),
46 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (45.0)),
47 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (45.0)),
48 TMath::Cos(TMath::DegToRad() * (90.0))),
49 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (0.0)),
50 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (0.0)),
51 TMath::Cos(TMath::DegToRad() * (90.0))),
52 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (315.0)),
53 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (315.0)),
54 TMath::Cos(TMath::DegToRad() * (90.0))),
55 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (270.0)),
56 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (270.0)),
57 TMath::Cos(TMath::DegToRad() * (90.0))),
58 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (225.0)),
59 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (225.0)),
60 TMath::Cos(TMath::DegToRad() * (90.0))),
61 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (180.0)),
62 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (180.0)),
63 TMath::Cos(TMath::DegToRad() * (90.0))),
64 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (135.0)),
65 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (135.0)),
66 TMath::Cos(TMath::DegToRad() * (90.0))),
68 TVector3(TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Cos(TMath::DegToRad() * (90.0)),
69 TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Sin(TMath::DegToRad() * (90.0)),
70 TMath::Cos(TMath::DegToRad() * (45.0))),
71 TVector3(TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Cos(TMath::DegToRad() * (0.0)),
72 TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Sin(TMath::DegToRad() * (0.0)),
73 TMath::Cos(TMath::DegToRad() * (45.0))),
74 TVector3(TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Cos(TMath::DegToRad() * (270.0)),
75 TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Sin(TMath::DegToRad() * (270.0)),
76 TMath::Cos(TMath::DegToRad() * (45.0))),
77 TVector3(TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Cos(TMath::DegToRad() * (180.0)),
78 TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Sin(TMath::DegToRad() * (180.0)),
79 TMath::Cos(TMath::DegToRad() * (45.0))),
81 TVector3(TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Cos(TMath::DegToRad() * (90.0)),
82 TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Sin(TMath::DegToRad() * (90.0)),
83 TMath::Cos(TMath::DegToRad() * (135.0))),
84 TVector3(TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Cos(TMath::DegToRad() * (0.0)),
85 TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Sin(TMath::DegToRad() * (0.0)),
86 TMath::Cos(TMath::DegToRad() * (135.0))),
87 TVector3(TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Cos(TMath::DegToRad() * (270.0)),
88 TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Sin(TMath::DegToRad() * (270.0)),
89 TMath::Cos(TMath::DegToRad() * (135.0))),
90 TVector3(TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Cos(TMath::DegToRad() * (180.0)),
91 TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Sin(TMath::DegToRad() * (180.0)),
92 TMath::Cos(TMath::DegToRad() * (135.0)))
98#if ROOT_VERSION_CODE < ROOT_VERSION(6, 0, 0)
99 Class()->IgnoreTObjectStreamer(kTRUE);
107#if ROOT_VERSION_CODE < ROOT_VERSION(6, 0, 0)
108 Class()->IgnoreTObjectStreamer(kTRUE);
164 std::ostringstream str;
165 str <<
"Fipps Contains: " << std::endl;
169 str << std::setw(6) <<
fAddbackHits.size() <<
" addback hits" << std::endl;
171 str << std::setw(6) <<
" "
172 <<
" Addback not set" << std::endl;
175 str << std::setw(6) <<
" "
258 }
catch(
const std::out_of_range& oor) {
259 std::cerr << ClassName() <<
" Hits are out of range: " << oor.what() << std::endl;
274 }
catch(
const std::out_of_range& oor) {
275 std::cerr << ClassName() <<
"Suppressed hits are out of range: " << oor.what() << std::endl;
292 if(hit_vec.empty()) {
297 for(
auto& hit : sup_vec) {
302 if(sup_vec.empty()) {
307 return sup_vec.size();
321 if(hit_vec.empty()) {
327 for(
auto& hit : ab_vec) {
338 return ab_vec.size();
352 if(hit_vec.empty()) {
358 for(
auto& hit : ab_vec) {
369 return ab_vec.size();
379 }
catch(
const std::out_of_range& oor) {
380 std::cerr << ClassName() <<
" Addback hits are out of range: " << oor.what() << std::endl;
395 }
catch(
const std::out_of_range& oor) {
396 std::cerr << ClassName() <<
" Suppressed addback hits are out of range: " << oor.what() << std::endl;
409 if(frag ==
nullptr || chan ==
nullptr) {
416 Hits().push_back(hit);
428 return TVector3(0, 0, 1);
439 Double_t cp = 17.678;
443 TVector3 CrystalPosition;
445 case 0: CrystalPosition.SetXYZ(-cp, cp,
id);
break;
446 case 1: CrystalPosition.SetXYZ(cp, cp,
id);
break;
447 case 2: CrystalPosition.SetXYZ(cp, -cp,
id);
break;
448 case 3: CrystalPosition.SetXYZ(-cp, -cp,
id);
break;
449 default: CrystalPosition.SetXYZ(0, 0, 1);
break;
452 CrystalPosition.RotateY(CloverPosition.Theta());
454 CrystalPosition.RotateZ(CloverPosition.Phi());
456 CloverPosition.SetMag(dist);
458 return (CloverPosition + CrystalPosition);
514 Bool_t time_constraint)
519 if((hit_to_correct ==
nullptr) || (other_hit ==
nullptr)) {
520 std::cerr <<
"One of the hits is invalid in TFipps::CTCorrectedEnergy" << std::endl;
524 if(time_constraint) {
535 static bool been_warned[256] = {
false};
536 double fixed_energy = hit_to_correct->
GetEnergy();
541 }
catch(
const std::out_of_range& oor) {
543 if(!been_warned[
id]) {
544 been_warned[id] =
true;
545 std::cerr <<
DRED <<
"Missing CT correction for Det: " << hit_to_correct->
GetDetector()
559 if(hit_vec.size() < 2) {
563 for(
auto& hit : hit_vec) {
564 static_cast<TFippsHit*
>(hit)->ClearEnergy();
568 for(
auto& one : hit_vec) {
569 for(
auto& two : hit_vec) {
570 if(one == two)
continue;
bool DefaultFippsSuppression(const TDetectorHit *hit, const TDetectorHit *bgoHit)
bool DefaultFippsAddback(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!
virtual Short_t GetMultiplicity() const
virtual const std::vector< TDetectorHit * > & GetHitVector() const
std::vector< TDetectorHit * > & Hits()
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)