GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TGriffin.cxx
Go to the documentation of this file.
1#include "TGriffin.h"
2
3#include <sstream>
4#include <iostream>
5#include <iomanip>
6
7#include "TRandom.h"
8#include "TMath.h"
9#include "TInterpreter.h"
10#include "TMnemonic.h"
11
12#include "TGRSIOptions.h"
13
14////////////////////////////////////////////////////////////
15//
16// TGriffin
17//
18// The TGriffin class defines the observables and algorithms used
19// when analyzing GRIFFIN data. It includes detector positions,
20// add-back methods, etc.
21//
22////////////////////////////////////////////////////////////
23
25{
26 return ((one->GetDetector() == two->GetDetector()) &&
27 (std::fabs(one->GetTime() - two->GetTime()) < TGRSIOptions::AnalysisOptions()->AddbackWindow()));
28}
29
31
33{
34 //return ((hit.GetDetector() == bgoHit.GetDetector() && hit.GetCrystal() == bgoHit.GetCrystal()) &&
35 return ((hit->GetDetector() == bgoHit->GetDetector()) &&
36 (std::fabs(hit->GetTime() - bgoHit->GetTime()) < TGRSIOptions::AnalysisOptions()->SuppressionWindow()) &&
38}
39
41
42bool TGriffin::fSetCoreWave = false;
43
44// This seems unnecessary, and why 17?;// they are static members, and need
45// to be defined outside the header
46// 17 is to have the detectors go from 1-16
47// plus we can use position zero
48// when the detector winds up back in
49// one of the stands like Alex used in the
50// gps run. pcb.
51// Initiallizes the HPGe Clover positions as per the wiki
52// <https://www.triumf.info/wiki/tigwiki/index.php/HPGe_Coordinate_Table>
53// theta phi
54// theta phi
55// theta
56std::array<TVector3, 17> TGriffin::fCloverPosition = {
57 TVector3(TMath::Sin(TMath::DegToRad() * (0.0)) * TMath::Cos(TMath::DegToRad() * (0.0)),
58 TMath::Sin(TMath::DegToRad() * (0.0)) * TMath::Sin(TMath::DegToRad() * (0.0)),
59 TMath::Cos(TMath::DegToRad() * (0.0))),
60 // Downstream lampshade
61 TVector3(TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Cos(TMath::DegToRad() * (67.5)),
62 TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Sin(TMath::DegToRad() * (67.5)),
63 TMath::Cos(TMath::DegToRad() * (45.0))),
64 TVector3(TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Cos(TMath::DegToRad() * (157.5)),
65 TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Sin(TMath::DegToRad() * (157.5)),
66 TMath::Cos(TMath::DegToRad() * (45.0))),
67 TVector3(TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Cos(TMath::DegToRad() * (247.5)),
68 TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Sin(TMath::DegToRad() * (247.5)),
69 TMath::Cos(TMath::DegToRad() * (45.0))),
70 TVector3(TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Cos(TMath::DegToRad() * (337.5)),
71 TMath::Sin(TMath::DegToRad() * (45.0)) * TMath::Sin(TMath::DegToRad() * (337.5)),
72 TMath::Cos(TMath::DegToRad() * (45.0))),
73 // Corona
74 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (22.5)),
75 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (22.5)),
76 TMath::Cos(TMath::DegToRad() * (90.0))),
77 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (67.5)),
78 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (67.5)),
79 TMath::Cos(TMath::DegToRad() * (90.0))),
80 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (112.5)),
81 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (112.5)),
82 TMath::Cos(TMath::DegToRad() * (90.0))),
83 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (157.5)),
84 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (157.5)),
85 TMath::Cos(TMath::DegToRad() * (90.0))),
86 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (202.5)),
87 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (202.5)),
88 TMath::Cos(TMath::DegToRad() * (90.0))),
89 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (247.5)),
90 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (247.5)),
91 TMath::Cos(TMath::DegToRad() * (90.0))),
92 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (292.5)),
93 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (292.5)),
94 TMath::Cos(TMath::DegToRad() * (90.0))),
95 TVector3(TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Cos(TMath::DegToRad() * (337.5)),
96 TMath::Sin(TMath::DegToRad() * (90.0)) * TMath::Sin(TMath::DegToRad() * (337.5)),
97 TMath::Cos(TMath::DegToRad() * (90.0))),
98 // Upstream lampshade
99 TVector3(TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Cos(TMath::DegToRad() * (67.5)),
100 TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Sin(TMath::DegToRad() * (67.5)),
101 TMath::Cos(TMath::DegToRad() * (135.0))),
102 TVector3(TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Cos(TMath::DegToRad() * (157.5)),
103 TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Sin(TMath::DegToRad() * (157.5)),
104 TMath::Cos(TMath::DegToRad() * (135.0))),
105 TVector3(TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Cos(TMath::DegToRad() * (247.5)),
106 TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Sin(TMath::DegToRad() * (247.5)),
107 TMath::Cos(TMath::DegToRad() * (135.0))),
108 TVector3(TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Cos(TMath::DegToRad() * (337.5)),
109 TMath::Sin(TMath::DegToRad() * (135.0)) * TMath::Sin(TMath::DegToRad() * (337.5)),
110 TMath::Cos(TMath::DegToRad() * (135.0)))};
111
113{
114 /// Default ctor. Ignores TObjectStreamer in ROOT < 6
115 Clear();
116}
117
119{
120 /// Copy ctor. Ignores TObjectStreamer in ROOT < 6
121 rhs.Copy(*this);
122}
123
124void TGriffin::Copy(TObject& rhs) const
125{
126 // Copy function.
128
129 // no need to copy hits, this is already taken care of by TDetector::Copy (called by TSuppressed::Copy)
130 // not copying addback or suppressed vectors
131 for(auto& hit : static_cast<TGriffin&>(rhs).fAddbackHits) {
132 delete hit;
133 }
134 for(auto& hit : static_cast<TGriffin&>(rhs).fSuppressedHits) {
135 delete hit;
136 }
137 for(auto& hit : static_cast<TGriffin&>(rhs).fSuppressedAddbackHits) {
138 delete hit;
139 }
140 static_cast<TGriffin&>(rhs).fGriffinBits = 0;
141 static_cast<TGriffin&>(rhs).fAddbackHits.clear();
142 static_cast<TGriffin&>(rhs).fAddbackFrags.clear();
143 static_cast<TGriffin&>(rhs).fSuppressedHits.clear();
144 static_cast<TGriffin&>(rhs).fSuppressedAddbackHits.clear();
145 static_cast<TGriffin&>(rhs).fSuppressedAddbackFrags.clear();
146
147 static_cast<TGriffin&>(rhs).fCycleStart = fCycleStart;
148}
149
151{
152 // Default Destructor
153 // no need to delete hits, this is taken care of by the destructor of TDetector
154 for(auto& hit : fAddbackHits) {
155 delete hit;
156 }
157 for(auto& hit : fSuppressedHits) {
158 delete hit;
159 }
160 for(auto& hit : fSuppressedAddbackHits) {
161 delete hit;
162 }
163}
164
165void TGriffin::Clear(Option_t* opt)
166{
167 // Clears the mother, and all of the hits
168 ClearStatus();
170 // hits cleared by TDetector::Clear
171 for(auto& hit : fAddbackHits) {
172 delete hit;
173 }
174 for(auto& hit : fSuppressedHits) {
175 delete hit;
176 }
177 for(auto& hit : fSuppressedAddbackHits) {
178 delete hit;
179 }
180 fAddbackHits.clear();
181 fAddbackFrags.clear();
182 fSuppressedHits.clear();
185
186 fCycleStart = 0;
187}
188
189void TGriffin::Print(Option_t*) const
190{
191 Print(std::cout);
192}
193
194void TGriffin::Print(std::ostream& out) const
195{
196 std::ostringstream str;
197 str << "Griffin Contains: " << std::endl;
198 str << std::setw(6) << GetMultiplicity() << " hits" << std::endl;
199 //if(TString(opt).Contains("all", TString::ECaseCompare::kIgnoreCase)) {
200 for(const auto& hit : Hits()) {
201 static_cast<TGriffinHit*>(hit)->Print(str);
202 }
203 //}
204
205 if(IsAddbackSet()) {
206 str << std::setw(6) << fAddbackHits.size() << " addback hits" << std::endl;
207 } else {
208 str << std::setw(6) << " "
209 << " Addback not set" << std::endl;
210 }
211
212 str << std::setw(6) << " "
213 << " Cross-talk Set? " << IsCrossTalkSet() << std::endl;
214 str << std::setw(6) << fCycleStart << " cycle start" << std::endl;
215 out << str.str();
216}
217
219{
220 rhs.Copy(*this);
221 return *this;
222}
223
228
233
234void TGriffin::SetAddback(const bool flag) const
235{
237}
238
239void TGriffin::SetCrossTalk(const bool flag) const
240{
242}
243
245{
246 /// Get Griffin hit indicated by index i.
247 /// Throws an out of range exception if the index is out of the range of the hit vector.
248 /// Applies cross-talk corrections if they haven't already been applied and are enabled.
249 /// Note: This is different from using TDetector::GetHit and casting the result to a `TGriffinHit*`
250 /// as in that case no cross-talk corrections are applied.
251 try {
252 if(!IsCrossTalkSet()) {
253 FixCrossTalk();
254 }
255 return static_cast<TGriffinHit*>(Hits().at(i));
256 } catch(const std::out_of_range& oor) {
257 std::cerr << ClassName() << " Hits are out of range: " << oor.what() << std::endl;
258 if(!gInterpreter) {
259 throw grsi::exit_exception(1);
260 }
261 }
262 return nullptr;
263}
264
266{
267 // Automatically builds the addback hits using the fAddbackCriterion (if the size of the fAddbackHits vector is zero)
268 // and return the number of addback hits.
269 if(!IsCrossTalkSet()) {
270 // Calculate Cross Talk on each hit
271 FixCrossTalk();
272 }
273 auto& hitVector = Hits();
274 if(hitVector.empty()) {
275 return 0;
276 }
277 // if the addback has been reset, clear the addback hits
278 if(!IsAddbackSet()) {
279 for(auto& hit : fAddbackHits) {
280 delete hit;
281 }
282 fAddbackHits.clear();
283 fAddbackFrags.clear();
284 }
285 if(fAddbackHits.empty()) {
287 SetAddback(true);
288 }
289
290 return fAddbackHits.size();
291}
292
294{
295 if(i < GetAddbackMultiplicity()) {
296 return static_cast<TGriffinHit*>(fAddbackHits[i]);
297 }
298 std::cerr << "Addback hits are out of range" << std::endl;
299 throw grsi::exit_exception(1);
300 return nullptr;
301}
302
303void TGriffin::AddFragment(const std::shared_ptr<const TFragment>& frag, TChannel* chan)
304{
305 // Builds the GRIFFIN Hits directly from the TFragment. Basically, loops through the hits for an event and sets
306 // observables.
307 // This is done for both GRIFFIN and it's suppressors.
308 if(frag == nullptr || chan == nullptr) {
309 return;
310 }
311 const TMnemonic* mnemonic = chan->GetMnemonic();
312 if(mnemonic == nullptr) {
313 std::cerr << "Trying to add fragment to TGriffin w/o mnemonic in TChannel!" << std::endl;
314 return;
315 }
316
317 if(mnemonic->SubSystem() != TMnemonic::EMnemonic::kG) {
318 std::cerr << __PRETTY_FUNCTION__ << ": not a GRIFFIN detector: " << static_cast<std::underlying_type<TMnemonic::EMnemonic>::type>(mnemonic->SubSystem()) << std::endl; // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
319 return;
320 }
321
322 // only create the hit if we have a HPGe signal (A), not a suppressor (S) or backup HPGe signal (B)
323 switch(mnemonic->OutputSensor()) {
325 auto* hit = new TGriffinHit(*frag);
326 Hits().push_back(hit);
327 } break;
329 break;
330 default:
331 std::cout << "output sensor " << static_cast<std::underlying_type<TMnemonic::EMnemonic>::type>(mnemonic->OutputSensor()) << ", skipping it" << std::endl;
332 break;
333 };
334}
335
336TVector3 TGriffin::GetPosition(int DetNbr, int CryNbr, double dist)
337{
338 // Gets the position vector for a crystal specified by CryNbr within Clover DetNbr at a distance of dist mm away.
339 // This is calculated to the most likely interaction point within the crystal.
340 if(DetNbr > 16) {
341 return {0, 0, 1};
342 }
343
344 TVector3 temp_pos(fCloverPosition[DetNbr]);
345
346 // Interaction points may eventually be set externally. May make these members of each crystal, or pass from
347 // waveforms.
348 Double_t cp = 26.0; // Crystal Center Point mm.
349 Double_t id = 45.0; // 45.0; //Crystal interaction depth mm.
350 // Set Theta's of the center of each DETECTOR face
351 ////Define one Detector position
352 TVector3 shift;
353 switch(CryNbr) {
354 case 0: shift.SetXYZ(-cp, cp, id); break;
355 case 1: shift.SetXYZ(cp, cp, id); break;
356 case 2: shift.SetXYZ(cp, -cp, id); break;
357 case 3: shift.SetXYZ(-cp, -cp, id); break;
358 default: shift.SetXYZ(0, 0, 1); break;
359 };
360 shift.RotateY(temp_pos.Theta());
361 shift.RotateZ(temp_pos.Phi());
362
363 temp_pos.SetMag(dist);
364
365 return (temp_pos + shift);
366}
367
369{
370 // Gets the position vector for a Clover DetNbr.
371 if(DetNbr > 16) {
372 return {0, 0, 1};
373 }
374
375 return fCloverPosition[DetNbr];
376}
377
379{
380 fGriffinBits = 0;
381}
382
384{
385 SetAddback(false);
386 SetCrossTalk(false);
387 for(auto& hit : fAddbackHits) {
388 delete hit;
389 }
390 fAddbackHits.clear();
391 fAddbackFrags.clear();
392}
393
394UShort_t TGriffin::GetNAddbackFrags(const size_t& idx)
395{
396 // Get the number of addback "fragments" contributing to the total addback hit
397 // with index idx.
398 if(idx < fAddbackFrags.size()) {
399 return fAddbackFrags[idx];
400 }
401 return 0;
402}
403
404void TGriffin::SetBitNumber(enum EGriffinBits bit, Bool_t set) const
405{
406 // Used to set the flags that are stored in TGriffin.
407 fGriffinBits.SetBit(bit, set);
408}
409
410Double_t TGriffin::CTCorrectedEnergy(const TGriffinHit* const hit_to_correct, const TGriffinHit* const other_hit,
411 Bool_t time_constraint)
412{
413 if((hit_to_correct == nullptr) || (other_hit == nullptr)) {
414 std::cerr << "One of the hits is invalid in TGriffin::CTCorrectedEnergy" << std::endl;
415 return 0;
416 }
417
418 if(time_constraint) {
419 // Figure out if this passes the selected window
420 if(TMath::Abs(other_hit->GetTime() - hit_to_correct->GetTime()) >
421 TGRSIOptions::AnalysisOptions()->AddbackWindow()) { // placeholder
422 return hit_to_correct->GetEnergy();
423 }
424 }
425
426 if(hit_to_correct->GetDetector() != other_hit->GetDetector()) {
427 return hit_to_correct->GetEnergy();
428 }
429 static std::array<bool, 256> been_warned = {false};
430 double fixed_energy = hit_to_correct->GetEnergy();
431 try {
432 if(hit_to_correct->GetChannel() != nullptr) {
433 fixed_energy -= hit_to_correct->GetChannel()->GetCTCoeff().at(other_hit->GetCrystal()) * other_hit->GetNoCTEnergy();
434 }
435 } catch(const std::out_of_range& oor) {
436 int id = 16 * hit_to_correct->GetDetector() + 4 * hit_to_correct->GetCrystal() + other_hit->GetCrystal();
437 if(!been_warned[id]) {
438 been_warned[id] = true;
439 std::cerr << DRED << "Missing CT correction for Det: " << hit_to_correct->GetDetector()
440 << " Crystals: " << hit_to_correct->GetCrystal() << " " << other_hit->GetCrystal() << " (id " << id << ")" << RESET_COLOR << std::endl;
441 }
442 return hit_to_correct->GetEnergy();
443 }
444
445 return fixed_energy;
446}
447
449{
450 if(!TGRSIOptions::AnalysisOptions()->IsCorrectingCrossTalk()) { return; }
451
452 auto& hitVector = Hits();
453 if(hitVector.size() < 2) {
454 SetCrossTalk(true);
455 return;
456 }
457 for(auto& hit : hitVector) {
458 static_cast<TGriffinHit*>(hit)->ClearEnergy();
459 }
460
461 for(auto& one : hitVector) {
462 for(auto& two : hitVector) {
463 one->SetEnergy(CTCorrectedEnergy(static_cast<TGriffinHit*>(one), static_cast<TGriffinHit*>(two)));
464 }
465 }
466 SetCrossTalk(true);
467}
468
469const char* TGriffin::GetColorFromNumber(int number)
470{
471 switch(number) {
472 case(0): return "B";
473 case(1): return "G";
474 case(2): return "R";
475 case(3): return "W";
476 };
477 return "X";
478}
479
484
489
491{
492 try {
493 if(!IsCrossTalkSet()) {
494 FixCrossTalk();
495 }
496 return static_cast<TGriffinHit*>(fSuppressedHits.at(i));
497 } catch(const std::out_of_range& oor) {
498 std::cerr << ClassName() << " Suppressed hits are out of range: " << oor.what() << std::endl;
499 if(!gInterpreter) {
500 throw grsi::exit_exception(1);
501 }
502 }
503 return nullptr;
504}
505
507{
508 /// Automatically builds the suppressed hits using the fSuppressionCriterion and returns the number of suppressed hits
509 if(!IsCrossTalkSet()) {
510 // Calculate Cross Talk on each hit
511 FixCrossTalk();
512 }
513 auto& hitVector = Hits();
514 if(hitVector.empty()) {
515 return 0;
516 }
517 // if the suppressed has been reset, clear the suppressed hits
518 if(!IsSuppressed()) {
519 for(auto& hit : fSuppressedHits) {
520 delete hit;
521 }
522 fSuppressedHits.clear();
523 }
524 if(fSuppressedHits.empty()) {
525 CreateSuppressed(bgo, hitVector, fSuppressedHits);
526 SetSuppressed(true);
527 }
528
529 return fSuppressedHits.size();
530}
531
532void TGriffin::SetSuppressed(const bool flag) const
533{
535}
536
538{
539 SetSuppressed(false);
540 for(auto& hit : fSuppressedHits) {
541 delete hit;
542 }
543 fSuppressedHits.clear();
544}
545
547{
548 try {
549 if(!IsCrossTalkSet()) {
550 FixCrossTalk();
551 }
552 return static_cast<TGriffinHit*>(fSuppressedAddbackHits.at(i));
553 } catch(const std::out_of_range& oor) {
554 std::cerr << ClassName() << " Suppressed addback hits are out of range: " << oor.what() << std::endl;
555 if(!gInterpreter) {
556 throw grsi::exit_exception(1);
557 }
558 }
559 return nullptr;
560}
561
563{
564 /// Automatically builds the suppressed addback hits using the fAddbackCriterion (if the size of the fAddbackHits vector is zero)
565 /// and return the number of suppressed addback hits.
566 if(!IsCrossTalkSet()) {
567 // Calculate Cross Talk on each hit
568 FixCrossTalk();
569 }
570 auto& hitVector = Hits();
571 if(hitVector.empty()) {
572 return 0;
573 }
574 // if the addback has been reset, clear the addback hits
576 for(auto& hit : fSuppressedAddbackHits) {
577 delete hit;
578 }
581 }
582 if(fSuppressedAddbackHits.empty()) {
585 }
586
587 return fSuppressedAddbackHits.size();
588}
589
590void TGriffin::SetSuppressedAddback(const bool flag) const
591{
593}
594
596{
598 for(auto& hit : fSuppressedAddbackHits) {
599 delete hit;
600 }
603}
604
605UShort_t TGriffin::GetNSuppressedAddbackFrags(const size_t& idx)
606{
607 try {
608 return fSuppressedAddbackFrags.at(idx);
609 } catch(const std::out_of_range& oor) {
610 std::cerr << ClassName() << " Suppressed addback frags are out of range: " << oor.what() << std::endl;
611 if(!gInterpreter) {
612 throw grsi::exit_exception(1);
613 }
614 }
615 return 0;
616}
#define DRED
Definition Globals.h:18
#define RESET_COLOR
Definition Globals.h:5
bool DefaultGriffinAddback(const TDetectorHit *one, const TDetectorHit *two)
Definition TGriffin.cxx:24
bool DefaultGriffinSuppression(const TDetectorHit *hit, const TDetectorHit *bgoHit)
Definition TGriffin.cxx:32
double SuppressionWindow() const
double AddbackWindow() const
double SuppressionEnergy() const
Definition TBgo.h:22
std::vector< double > GetCTCoeff() const
Definition TChannel.h:197
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
Definition TDetector.h:73
std::vector< TDetectorHit * > & Hits()
Definition TDetector.h:78
static TAnalysisOptions * AnalysisOptions()
Double_t GetNoCTEnergy(Option_t *opt="") const
bool IsSuppressedAddbackSet() const
Definition TGriffin.cxx:485
void ResetSuppressedAddback()
Definition TGriffin.cxx:595
static const char * GetColorFromNumber(int number)
Definition TGriffin.cxx:469
std::vector< TDetectorHit * > fSuppressedHits
! The set of suppressed crystal hits
Definition TGriffin.h:111
void Clear(Option_t *opt="all") override
!
Definition TGriffin.cxx:165
TGriffinHit * GetAddbackHit(const int &i)
Definition TGriffin.cxx:293
Short_t GetAddbackMultiplicity()
Definition TGriffin.cxx:265
static std::function< bool(const TDetectorHit *, const TDetectorHit *)> fAddbackCriterion
Definition TGriffin.h:99
std::vector< TDetectorHit * > fSuppressedAddbackHits
! Used to create suppressed addback hits on the fly
Definition TGriffin.h:113
void Print(Option_t *opt="") const override
!
Definition TGriffin.cxx:189
int64_t fCycleStart
! The start of the cycle
Definition TGriffin.h:105
static std::array< TVector3, 17 > fCloverPosition
! Position of each HPGe Clover
Definition TGriffin.h:56
static TVector3 GetPosition(int DetNbr, int CryNbr=5, double dist=110.0)
!
Definition TGriffin.cxx:336
void ResetAddback()
!
Definition TGriffin.cxx:383
void ClearStatus() const
!
Definition TGriffin.h:121
UShort_t GetNSuppressedAddbackFrags(const size_t &idx)
Definition TGriffin.cxx:605
std::vector< TDetectorHit * > fAddbackHits
! Used to create addback hits on the fly
Definition TGriffin.h:108
~TGriffin() override
Definition TGriffin.cxx:150
UShort_t GetNAddbackFrags(const size_t &idx)
Definition TGriffin.cxx:394
TGriffinHit * GetSuppressedAddbackHit(const int &i)
Definition TGriffin.cxx:546
bool IsAddbackSet() const
Definition TGriffin.cxx:224
void ResetFlags() const
Definition TGriffin.cxx:378
TGriffin & operator=(const TGriffin &)
!
Definition TGriffin.cxx:218
TTransientBits< UChar_t > fGriffinBits
Definition TGriffin.h:106
void SetSuppressed(bool flag=true) const
Definition TGriffin.cxx:532
static std::function< bool(const TDetectorHit *, const TDetectorHit *)> fSuppressionCriterion
Definition TGriffin.h:100
Short_t GetSuppressedMultiplicity(const TBgo *bgo)
Definition TGriffin.cxx:506
Short_t GetSuppressedAddbackMultiplicity(const TBgo *bgo)
Definition TGriffin.cxx:562
void SetBitNumber(EGriffinBits bit, Bool_t set) const
Definition TGriffin.cxx:404
void ResetSuppressed()
Definition TGriffin.cxx:537
void FixCrossTalk()
Definition TGriffin.cxx:448
void SetSuppressedAddback(bool flag=true) const
Definition TGriffin.cxx:590
void AddFragment(const std::shared_ptr< const TFragment > &, TChannel *) override
!
Definition TGriffin.cxx:303
bool IsSuppressed() const
Definition TGriffin.cxx:480
TGriffinHit * GetSuppressedHit(const int &i)
!
Definition TGriffin.cxx:490
std::vector< UShort_t > fAddbackFrags
! Number of crystals involved in creating in the addback hit
Definition TGriffin.h:109
void SetAddback(bool flag=true) const
Definition TGriffin.cxx:234
TGriffinHit * GetGriffinHit(const int &i)
!
Definition TGriffin.cxx:244
static Double_t CTCorrectedEnergy(const TGriffinHit *hit_to_correct, const TGriffinHit *other_hit, bool time_constraint=true)
Definition TGriffin.cxx:410
static TVector3 GetDetectorPosition(int DetNbr)
!
Definition TGriffin.cxx:368
Bool_t IsCrossTalkSet() const
Definition TGriffin.cxx:229
Bool_t TestBitNumber(EGriffinBits bit) const
Definition TGriffin.h:123
static bool fSetCoreWave
! Flag for Waveforms ON/OFF
Definition TGriffin.h:103
std::vector< UShort_t > fSuppressedAddbackFrags
! Number of crystals involved in creating in the suppressed addback hit
Definition TGriffin.h:114
void Copy(TObject &) const override
!
Definition TGriffin.cxx:124
void SetCrossTalk(bool flag=true) const
Definition TGriffin.cxx:239
virtual EMnemonic OutputSensor() const
Definition TMnemonic.h:65
virtual EMnemonic SubSystem() const
Definition TMnemonic.h:61
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)
Definition TSuppressed.h:38
void CreateSuppressed(const TBgo *bgo, const std::vector< T * > &hits, std::vector< T * > &suppressedHits)
Definition TSuppressed.h:69
void CreateSuppressedAddback(const TBgo *bgo, const std::vector< T * > &hits, std::vector< T * > &addbacks, std::vector< UShort_t > &nofFragments)
Definition TSuppressed.h:94
void SetBit(T bit, Bool_t flag)