KaliVeda
Toolkit for HIC analysis
KVDetector.h
1 /***************************************************************************
2  kvdetector.h - description
3  -------------------
4  begin : Thu May 16 2002
5  copyright : (C) 2002 by J.D. Frankland
6  email : frankland@ganil.fr
7 
8 $Id: KVDetector.h,v 1.71 2009/05/22 14:45:40 ebonnet Exp $
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  ***************************************************************************/
19 
20 #ifndef KVDETECTOR_H
21 #define KVDETECTOR_H
22 
23 #ifndef KVD_RECPRC_CNXN
24 #define KVD_RECPRC_CNXN 1
25 #endif
26 #ifndef KVD_NORECPRC_CNXN
27 #define KVD_NORECPRC_CNXN 0
28 #endif
29 
30 #include "KVMaterial.h"
31 #include "KVPosition.h"
32 #include "KVList.h"
33 #include "KVUnownedList.h"
34 #include "KVNucleus.h"
35 #include "KVGeoDetectorNode.h"
36 #include "KVUniqueNameList.h"
37 #include "KVDetectorSignal.h"
38 #include "KVEvent.h"
39 
40 class KVGeoStrucElement;
41 class KVGroup;
42 class KVCalibrator;
43 class TGeoVolume;
44 class TTree;
45 class TGraph;
47 
160 class KVDetector: public KVMaterial, public KVPosition {
161 
162 private:
169 
170  enum {
171  kIsAnalysed = BIT(14), //for reconstruction of particles
172  kActiveSet = BIT(15), //internal - flag set true when SetActiveLayer called
173  kUnidentifiedParticle = BIT(16), //set if detector is in an unidentified particle's list
174  kIdentifiedParticle = BIT(17), //set if detector is in an identified particle's list
175  };
176 
179 
183  void SetMatrix(const TGeoHMatrix* m) override
184  {
186  }
187  void SetShape(TGeoBBox* s) override
188  {
190  }
191  TGeoHMatrix* GetMatrix() const override
192  {
193  return KVPosition::GetMatrix();
194  }
195  TGeoBBox* GetShape() const override
196  {
197  return KVPosition::GetShape();
198  }
200  {
202  }
203  TVector3 GetSurfaceCentre() const override
204  {
206  }
207  TVector3 GetVolumeCentre() const override
208  {
210  }
211  TVector3 GetSurfaceNormal() const override
212  {
214  }
215  Double_t GetSurfaceArea(int npoints = 100000) const override
216  {
217  return KVPosition::GetSurfaceArea(npoints);
218  }
220  {
222  }
223 
226 
228 
229  template<typename AbsorberStack>
230  Double_t get_corrected_energy(AbsorberStack* stack, KVNucleus* nuc, Double_t e, Bool_t transmission)
231  {
232  auto z = nuc->GetZ();
233  auto a = nuc->GetA();
234  enum SolType solution = kEmax;
235  if (!transmission) solution = kEmin;
236  Double_t EINC, ERES = GetEResAfterDetector();
237  if (transmission && ERES > 0.) { // if residual energy is known we use it to calculate EINC.
238 
239  EINC = stack->GetIncidentEnergyFromERes(z, a, ERES);
240  if (EINC < stack->GetEIncOfMaxDeltaE(z, a)) {// if EINC < max of dE curve, we change solution
241  solution = kEmin;
242  } // we could keep the EINC value calculated using ERES, but then the corrected dE of this detector would not depend on the measured dE !
243  }
244  EINC = stack->GetIncidentEnergy(z, a, e, solution);
245  if (EINC < 0) {
247  return EINC;
248  }
249  ERES = stack->GetERes(z, a, EINC);
250 
252  return (EINC - ERES);
253  }
254 
255 protected:
256 
261 
263  Double_t EResDet(Double_t* x, Double_t* par);
265 
269 
271 
275 
277 
279  {
283  ds->SetDetector(this);
284  fDetSignals.Add(ds);
285  }
287  {
288  return true;
289  }
290 
291 public:
292  KVDetector();
293  KVDetector(const Char_t* type, const Float_t thick = 0.0);
294  KVDetector(const Char_t* gas, const Double_t thick, const Double_t pressure, const Double_t temperature = 19.0);
295  KVDetector(const KVDetector&);
296  void init();
297  virtual ~ KVDetector();
298 
299  void Copy(TObject& obj) const override;
300 
301  void SetMaterial(const Char_t* type) override;
302  void AddAbsorber(KVMaterial*);
304  {
305  fActiveLayer = actif;
307  }
309  {
311  if (auto mat = GetAbsorber(i)) SetActiveLayer(mat);
312  }
313  KVMaterial* GetActiveLayer() const override
314  {
316  return fActiveLayer;
317  }
318  KVMaterial* GetAbsorber(Int_t i) const;
319  KVMaterial* GetAbsorber(const Char_t* name) const
320  {
323  }
324  const KVList* GetListOfAbsorbers() const
325  {
326  return &fAbsorbers;
327  }
329  {
330  return fAbsorbers.GetEntries();
331  }
332  void RemoveAllAbsorbers();
333 
335  {
338 
339  double fTotThickness = 0;
340  TIter next(&fAbsorbers);
341  KVMaterial* mat;
342  while ((mat = (KVMaterial*)next())) fTotThickness += mat->GetThickness();
343  return fTotThickness;
344  }
346  {
347  return &fNode;
348  }
349 
350  const Char_t* GetMaterialName() const
351  {
352  if (GetActiveLayer())
353  return GetActiveLayer()->GetName();
354  return KVMaterial::GetName();
355  }
356  void DetectParticle(KVNucleus*, TVector3* norm = 0) override;
357  Double_t GetELostByParticle(KVNucleus*, TVector3* norm = 0) override;
358  Double_t GetParticleEIncFromERes(KVNucleus*, TVector3* norm = 0) override;
359 
361  {
363  return GetDetectorSignalValue("Energy");
364  }
365  virtual Double_t GetEnergy() const
366  {
370  if (IsSimMode()) return ELoss; // in simulation mode, return calculated energy loss in active layer
371  if (ELoss > 0) return ELoss;
372  ELoss = GetCalibratedEnergy();
373  if (ELoss < 0) ELoss = 0;
374  SetEnergy(ELoss);
375  return ELoss;
376  }
377  virtual void SetEnergy(Double_t e) const
378  {
384  }
385  Double_t GetEnergyLoss() const override
386  {
387  return GetEnergy();
388  }
389  void SetEnergyLoss(Double_t e) const override
390  {
391  SetEnergy(e);
392  }
394  -1., Bool_t transmission = kTRUE);
395  virtual Int_t FindZmin(Double_t ELOSS = -1., Char_t mass_formula = -1);
396 
397  Bool_t AddCalibrator(KVCalibrator* cal, const KVNameValueList& opts = "");
398  Bool_t ReplaceCalibrator(const Char_t* type, KVCalibrator* cal, const KVNameValueList& opts = "");
399  KVCalibrator* GetCalibrator(const Char_t* name,
400  const Char_t* type) const;
401  KVCalibrator* GetCalibrator(const Char_t* type) const;
403  {
404  return fCalibrators;
405  }
407  {
409  return (IsSimMode() && IsDetecting()) || (HasDetectorSignal("Energy") && IsOK());
410  }
411  Bool_t IsCalibrated(const KVNameValueList& params) const;
412 
413  void Clear(Option_t* opt = "") override;
414  virtual void Reset(Option_t* opt = "")
415  {
416  Clear(opt);
417  }
418  void Print(Option_t* option = "") const override;
419 
420  void AddHit(KVNucleus* part)
421  {
423 
424  fParticles.Add(part);
425  }
426 
427  auto RemoveHit(KVNucleus* part)
428  {
432 
433  auto p = fParticles.Remove(part);
435  return p;
436  }
437 
438  void ClearHits()
439  {
441  fParticles.Clear();
442  }
444  Int_t GetNHits() const
445  {
446  return fParticles.GetEntries();
447  }
448 
450  {
451  return TestBit(kIsAnalysed);
452  }
453  void SetAnalysed(Bool_t b = kTRUE)
454  {
455  SetBit(kIsAnalysed, b);
456  }
457  virtual Bool_t Fired(Option_t* opt = "any") const
458  {
473 
474  if (!IsDetecting()) return kFALSE; //detector not working, no answer at all
475  if (IsSimMode()) return (GetActiveLayer() ? GetActiveLayer()->GetEnergyLoss() > 0. : KVMaterial::GetEnergyLoss() > 0.); // simulation mode: detector fired if energy lost in active layer
476 
477  TString OPT(opt);
478  OPT.ToLower();
479  Bool_t all = (OPT == "all");
480 
481  TIter raw_it(&GetListOfDetectorSignals());
482  KVDetectorSignal* ds;
483  int count_raw = 0;
484  while ((ds = (KVDetectorSignal*)raw_it())) {
485  if (ds->IsRaw()) {
486  ++count_raw;
487  if (ds->IsFired()) {
488  if (!all) return kTRUE;
489  }
490  else {
491  if (all) return kFALSE;
492  }
493  }
494  }
495  return all && count_raw;
496  }
497  virtual void RemoveCalibrators();
498 
499  Double_t GetDetectorSignalValue(const KVString& type, const KVNameValueList& params = "") const
500  {
508 
510  return (s ? s->GetValue(params) : 0);
511  }
512  void SetDetectorSignalValue(const KVString& type, Double_t val) const
513  {
519 
521  if (s) s->SetValue(val);
522  }
523  Double_t GetInverseDetectorSignalValue(const KVString& output, Double_t value, const KVString& input, const KVNameValueList& params = "") const
524  {
535 
536  KVDetectorSignal* s = GetDetectorSignal(output);
537  return (s ? s->GetInverseValue(value, input, params) : 0);
538  }
539  virtual KVDetectorSignal* GetDetectorSignal(const KVString& type) const
540  {
545 
547  }
548  Bool_t HasDetectorSignal(const KVString& type) const
549  {
552  return (GetDetectorSignal(type) != nullptr);
553  }
554 
556  {
557  fUnidentP += n;
558  fUnidentP = (fUnidentP > 0) * fUnidentP;
560  }
562  {
563  fIdentP += n;
564  fIdentP = (fIdentP > 0) * fIdentP;
566  }
568  {
570  }
572  {
574  }
575 
576  static KVDetector* MakeDetector(const Char_t* name, Float_t thick);
577 
580  {
583  return GetSurfaceCentre();
584  }
586  {
589  }
591  {
593  return GetShape();
594  }
596  {
598  return GetMatrix();
599  }
600 
601  Double_t GetMaxDeltaE(Int_t Z, Int_t A) override;
602  Double_t GetEIncOfMaxDeltaE(Int_t Z, Int_t A) override;
603  Double_t GetDeltaE(Int_t Z, Int_t A, Double_t Einc, Double_t = 0.) override;
604  virtual Double_t GetTotalDeltaE(Int_t Z, Int_t A, Double_t Einc);
605  Double_t GetERes(Int_t Z, Int_t A, Double_t Einc, Double_t = 0.) override;
607  -1.0, enum SolType type = kEmax) override;
608  /*virtual Double_t GetEResFromDeltaE(...) - DON'T IMPLEMENT, CALLS GETINCIDENTENERGY*/
609  Double_t GetDeltaEFromERes(Int_t Z, Int_t A, Double_t Eres) override;
611  Double_t GetRange(Int_t Z, Int_t A, Double_t Einc) override;
612  Double_t GetLinearRange(Int_t Z, Int_t A, Double_t Einc) override;
613  Double_t GetPunchThroughEnergy(Int_t Z, Int_t A) override;
616 
617  virtual TF1* GetEResFunction(Int_t Z, Int_t A);
618  virtual TF1* GetELossFunction(Int_t Z, Int_t A);
619  virtual TF1* GetRangeFunction(Int_t Z, Int_t A);
620 
621  virtual Double_t GetSmallestEmaxValid(Int_t Z, Int_t A) const;
622 
624  {
625  fEResforEinc = e;
626  }
628  {
629  return fEResforEinc;
630  }
631 
632  virtual void ReadDefinitionFromFile(const Char_t*);
633 
634  virtual void SetSimMode(Bool_t on = kTRUE)
635  {
641  fSimMode = on;
642  }
643  virtual Bool_t IsSimMode() const
644  {
650  return fSimMode;
651  }
652 
653  virtual Bool_t IsPresent() const
654  {
656  return fPresent;
657  }
658  void SetPresent(Bool_t yes = kTRUE)
659  {
660  fPresent = yes;
661  }
662  virtual Bool_t IsDetecting() const
663  {
665  return fDetecting;
666  }
667  void SetDetecting(Bool_t yes = kTRUE)
668  {
669  fDetecting = yes;
670  }
671 
672  virtual Bool_t IsOK() const
673  {
675  return (fPresent && fDetecting);
676  }
677 
678  KVGroup* GetGroup() const;
680 
683  KVGeoStrucElement* GetParentStructure(const Char_t* type, const Char_t* name = "") const;
684 
685  void SetActiveLayerMatrix(const TGeoHMatrix*);
690  {
693  return fEWPosition;
694  }
696  {
701  }
702  Double_t GetSolidAngle() const override
703  {
705  if (ROOTGeo()) return fEWPosition.GetSolidAngle();
706  return KVPosition::GetSolidAngle();
707  }
708  TVector3 GetRandomDirection(Option_t* t = "isotropic") override
709  {
711  if (ROOTGeo()) return fEWPosition.GetRandomDirection(t);
713  }
714  void GetRandomAngles(Double_t& th, Double_t& ph, Option_t* t = "isotropic") override
715  {
717  if (ROOTGeo()) fEWPosition.GetRandomAngles(th, ph, t);
718  else KVPosition::GetRandomAngles(th, ph, t);
719  }
721  {
723  if (ROOTGeo()) return fEWPosition.GetDirection();
724  return KVPosition::GetDirection();
725  }
726  Double_t GetDistance() const override
727  {
729  if (ROOTGeo()) return fEWPosition.GetDistance();
730  return KVPosition::GetDistance();
731  }
732  Double_t GetTheta() const override
733  {
735  if (ROOTGeo()) return fEWPosition.GetTheta();
736  return KVPosition::GetTheta();
737  }
738  Double_t GetSinTheta() const override
739  {
741  if (ROOTGeo()) return fEWPosition.GetSinTheta();
742  return KVPosition::GetSinTheta();
743  }
744  Double_t GetCosTheta() const override
745  {
747  if (ROOTGeo()) return fEWPosition.GetCosTheta();
748  return KVPosition::GetCosTheta();
749  }
750  Double_t GetPhi() const override
751  {
753  if (ROOTGeo()) return fEWPosition.GetPhi();
754  return KVPosition::GetPhi();
755  }
756 
757  void SetThickness(Double_t thick) override;
759  {
761  return fSingleLayer;
762  }
764  {
766  return !IsSingleLayer();
767  }
769  {
771  return IsGas();
772  }
773  Bool_t HasSameStructureAs(const KVDetector*) const;
774  void SetNameOfArray(const TString& n)
775  {
776  fNameOfArray = n;
777  }
778  const Char_t* GetNameOfArray() const
779  {
781  return fNameOfArray;
782  }
783 
785  {
786  return fDetSignals;
787  }
789  {
793 
795  {
796  for(auto s : fDetSignals)
797  {
798  auto sig = dynamic_cast<KVDetectorSignal*>(s);
799  if(use_signal_for_raw_data_tree(sig->GetName()))
801  }
802  }
803  return fDetSignalsForRawTree;
804  }
807  Bool_t AddDetectorSignalExpression(const KVString& type, const KVString& _expr);
808 
809  virtual Int_t GetIndex() const
810  {
814 
815  return 0;
816  }
817 
818  void SetPressure(Double_t P) override;
819  void SetTemperature(Double_t T) override;
820 
821  virtual Bool_t IsSegmented() const
822  {
823  return kFALSE;
824  }
825  virtual void AddEnergyLossInSubDetector(int, double) {}
826 
827  ClassDefOverride(KVDetector, 10) //Base class for the description of detectors in multidetector arrays
828 };
829 
831  const Char_t* type) const
832 {
833  if (fCalibrators)
835  return 0;
836 }
837 
839 {
840  if (fCalibrators)
842  return 0;
843 }
844 #endif
int Int_t
unsigned int UInt_t
#define OPT
#define e(i)
bool Bool_t
char Char_t
float Float_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
const char Option_t
#define BIT(n)
#define ClassDefOverride(name, id)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Base class for all detector calibrations.
Definition: KVCalibrator.h:99
Detector signal waveform.
Base class for output signal data produced by a detector.
virtual Bool_t IsFired() const
virtual Bool_t IsRaw() const
void SetDetector(const KVDetector *d)
Base class for detector geometry description, interface to energy-loss calculations.
Definition: KVDetector.h:160
void SetDetectorSignalValue(const KVString &type, Double_t val) const
Definition: KVDetector.h:512
void SetNameOfArray(const TString &n)
Definition: KVDetector.h:774
KVMaterial * GetAbsorber(const Char_t *name) const
Definition: KVDetector.h:319
Double_t GetInverseDetectorSignalValue(const KVString &output, Double_t value, const KVString &input, const KVNameValueList &params="") const
Definition: KVDetector.h:523
static KVDetector * MakeDetector(const Char_t *name, Float_t thick)
TGeoHMatrix * GetActiveLayerMatrix() const
Definition: KVDetector.h:595
void SetThickness(Double_t thick) override
void IncrementIdentifiedParticles(Int_t n=1)
Definition: KVDetector.h:561
virtual Bool_t IsSimMode() const
Definition: KVDetector.h:643
virtual Bool_t IsOK() const
Definition: KVDetector.h:672
virtual Bool_t use_signal_for_raw_data_tree(const TString &) const
Definition: KVDetector.h:286
KVPosition fEWPosition
position of entrance window i.e. first volume in detector geometry
Definition: KVDetector.h:163
virtual void SetSimMode(Bool_t on=kTRUE)
Definition: KVDetector.h:634
Double_t GetMisalignmentAngle() const override
Definition: KVDetector.h:219
const Char_t * GetMaterialName() const
Definition: KVDetector.h:350
KVMaterial * GetActiveLayer() const override
Definition: KVDetector.h:313
KVUniqueNameList fParentStrucList
list of geometry structures which directly contain this detector
Definition: KVDetector.h:164
Int_t GetNumberOfAbsorberLayers() const
Definition: KVDetector.h:328
void IncrementUnidentifiedParticles(Int_t n=1)
Definition: KVDetector.h:555
Double_t GetSurfaceArea(int npoints=100000) const override
Definition: KVDetector.h:215
auto RemoveHit(KVNucleus *part)
Definition: KVDetector.h:427
virtual void AddEnergyLossInSubDetector(int, double)
Definition: KVDetector.h:825
void SetMaterial(const Char_t *type) override
Definition: KVDetector.cpp:169
Double_t ELossActive(Double_t *x, Double_t *par)
Definition: KVDetector.cpp:918
virtual KVDrawable< TGraph > DrawPunchThroughEnergyVsZ(Int_t massform=KVNucleus::kBetaMass)
void SetTemperature(Double_t T) override
KVList * fCalibrators
list of associated calibrator objects
Definition: KVDetector.h:258
KVGeoStrucElement * GetParentStructure(const Char_t *type, const Char_t *name="") const
KVGroup * GetGroup() const
void AddDetectorSignal(KVDetectorSignal *ds)
Definition: KVDetector.h:278
Double_t GetRange(Int_t Z, Int_t A, Double_t Einc) override
Double_t GetIncidentEnergyFromERes(Int_t Z, Int_t A, Double_t Eres) override
virtual ~ KVDetector()
Bool_t fDetecting
=kTRUE if detector is "detecting", =kFALSE if not
Definition: KVDetector.h:274
Bool_t ReplaceCalibrator(const Char_t *type, KVCalibrator *cal, const KVNameValueList &opts="")
Definition: KVDetector.cpp:517
virtual Double_t GetTotalDeltaE(Int_t Z, Int_t A, Double_t Einc)
virtual Double_t GetEnergy() const
Definition: KVDetector.h:365
Int_t GetNHits() const
Return the number of particles hitting this detector in an event.
Definition: KVDetector.h:444
virtual TF1 * GetEResFunction(Int_t Z, Int_t A)
KVList * GetListOfCalibrators() const
Definition: KVDetector.h:402
const KVSeqCollection & GetListOfDetectorSignalsForRawTree() const
Definition: KVDetector.h:788
static Int_t fDetCounter
Definition: KVDetector.h:166
void AddAbsorber(KVMaterial *)
Definition: KVDetector.cpp:607
KVDetectorSignalTrace * AddDetectorSignalTrace()
virtual Double_t GetEResAfterDetector() const
Definition: KVDetector.h:627
TVector3 GetSurfaceCentre() const override
Definition: KVDetector.h:203
Double_t GetIncidentEnergy(Int_t Z, Int_t A, Double_t delta_e=-1.0, enum SolType type=kEmax) override
Double_t GetPunchThroughEnergy(Int_t Z, Int_t A) override
Bool_t IsMultiLayer() const
Definition: KVDetector.h:763
void AddParentStructure(KVGeoStrucElement *elem)
Bool_t IsSingleLayer() const
Definition: KVDetector.h:758
Double_t GetDeltaE(Int_t Z, Int_t A, Double_t Einc, Double_t=0.) override
Double_t fEResforEinc
used by GetIncidentEnergy & GetCorrectedEnergy
Definition: KVDetector.h:270
void Print(Option_t *option="") const override
Definition: KVDetector.cpp:356
TVector3 GetSurfaceNormal() const override
Definition: KVDetector.h:211
virtual KVDrawable< TGraph > DrawPunchThroughEsurAVsZ(Int_t massform=KVNucleus::kBetaMass)
TVector3 GetVolumeCentre() const override
Definition: KVDetector.h:207
virtual Int_t GetIndex() const
Definition: KVDetector.h:809
virtual Int_t FindZmin(Double_t ELOSS=-1., Char_t mass_formula=-1)
Definition: KVDetector.cpp:848
Double_t GetSinTheta() const override
Definition: KVDetector.h:738
TF1 * fELossF
parametric function dE in active layer vs. incident energy
Definition: KVDetector.h:266
Double_t GetLinearRange(Int_t Z, Int_t A, Double_t Einc) override
const KVPosition & GetEntranceWindow() const
Definition: KVDetector.h:689
Bool_t HasDetectorSignal(const KVString &type) const
Definition: KVDetector.h:548
KVMaterial * GetAbsorber(Int_t i) const
Returns pointer to the i-th absorber in the detector (i=0 first absorber, i=1 second,...
Definition: KVDetector.cpp:623
@ kIdentifiedParticle
Definition: KVDetector.h:174
@ kUnidentifiedParticle
Definition: KVDetector.h:173
void ClearHits()
Definition: KVDetector.h:438
void SetEnergyLoss(Double_t e) const override
Definition: KVDetector.h:389
void remove_signal_for_calibrator(KVCalibrator *K)
Definition: KVDetector.cpp:677
TF1 * fEResF
parametric function Eres residual energy after all layers of detector
Definition: KVDetector.h:267
TVector3 GetActiveLayerSurfaceCentre() const
Definition: KVDetector.h:579
Bool_t HasSameStructureAs(const KVDetector *) const
virtual Bool_t Fired(Option_t *opt="any") const
Definition: KVDetector.h:457
UInt_t GetGroupNumber()
Double_t GetPhi() const override
Definition: KVDetector.h:750
virtual KVDetectorSignal * GetDetectorSignal(const KVString &type) const
Definition: KVDetector.h:539
virtual void ReadDefinitionFromFile(const Char_t *)
Bool_t IsCalibrated() const
Definition: KVDetector.h:406
Double_t GetEnergyLoss() const override
Definition: KVDetector.h:385
void SetShape(TGeoBBox *s) override
Definition: KVDetector.h:187
void Copy(TObject &obj) const override
Definition: KVDetector.cpp:130
void SetDetecting(Bool_t yes=kTRUE)
Definition: KVDetector.h:667
virtual TF1 * GetELossFunction(Int_t Z, Int_t A)
KVUnownedList fParticles
list of particles hitting detector in an event
Definition: KVDetector.h:259
void SetActiveLayer(KVMaterial *actif)
Definition: KVDetector.h:303
KVDetector()
default ctor
Definition: KVDetector.cpp:59
TGeoHMatrix * GetMatrix() const override
Definition: KVDetector.h:191
Double_t GetSolidAngle() const override
Definition: KVDetector.h:702
Bool_t BelongsToUnidentifiedParticle() const
Definition: KVDetector.h:567
void DetectParticle(KVNucleus *, TVector3 *norm=0) override
Definition: KVDetector.cpp:195
Double_t RangeDet(Double_t *x, Double_t *par)
Definition: KVDetector.cpp:956
const Char_t * GetNameOfArray() const
Definition: KVDetector.h:778
Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=0) override
Definition: KVDetector.cpp:320
virtual void RemoveCalibrators()
Definition: KVDetector.cpp:699
virtual Double_t GetEntranceWindowSurfaceArea()
Return surface area of first layer of detector in cm2.
TGeoBBox * GetShape() const override
Definition: KVDetector.h:195
const KVList * GetListOfAbsorbers() const
Definition: KVDetector.h:324
KVUniqueNameList fDetSignals
list of signals associated with detector
Definition: KVDetector.h:224
Bool_t IsGasDetector() const
Definition: KVDetector.h:768
Double_t get_corrected_energy(AbsorberStack *stack, KVNucleus *nuc, Double_t e, Bool_t transmission)
Definition: KVDetector.h:230
Int_t fUnidentP
temporary counters, determine state of identified/unidentified particle flags
Definition: KVDetector.h:178
TF1 * fRangeF
parametric function range of particles in detector
Definition: KVDetector.h:268
Bool_t AddDetectorSignalExpression(const KVString &type, const KVString &_expr)
Double_t GetDetectorSignalValue(const KVString &type, const KVNameValueList &params="") const
Definition: KVDetector.h:499
virtual void SetEnergy(Double_t e) const
Definition: KVDetector.h:377
virtual void SetEResAfterDetector(Double_t e)
Definition: KVDetector.h:623
virtual Double_t GetCalibratedEnergy() const
Definition: KVDetector.h:360
KVGeoDetectorNode fNode
positioning information relative to other detectors
Definition: KVDetector.h:165
void SetActiveLayerMatrix(const TGeoHMatrix *)
Set ROOT geometry global matrix transformation to coordinate frame of active layer volume.
Double_t GetERes(Int_t Z, Int_t A, Double_t Einc, Double_t=0.) override
virtual Bool_t IsDetecting() const
Definition: KVDetector.h:662
virtual Bool_t IsSegmented() const
Definition: KVDetector.h:821
void SetActiveLayer(Int_t i)
Definition: KVDetector.h:308
Double_t GetMaxDeltaE(Int_t Z, Int_t A) override
Bool_t IsAnalysed()
Definition: KVDetector.h:449
TVector3 GetRandomDirection(Option_t *t="isotropic") override
Definition: KVDetector.h:708
void RemoveParentStructure(KVGeoStrucElement *elem)
virtual Double_t GetSmallestEmaxValid(Int_t Z, Int_t A) const
const KVSeqCollection & GetListOfDetectorSignals() const
Definition: KVDetector.h:784
KVUniqueNameList fDetSignalsForRawTree
list of signals used for raw data TTree
Definition: KVDetector.h:225
KVGeoDetectorNode * GetNode()
Definition: KVDetector.h:345
TVector3 GetRandomPointOnSurface() const override
Definition: KVDetector.h:199
Bool_t fSimMode
=kTRUE when using to simulate detector response, =kFALSE when analysing data
Definition: KVDetector.h:272
Double_t GetDeltaEFromERes(Int_t Z, Int_t A, Double_t Eres) override
TString fNameOfArray
name of multidetector array this detector is part of
Definition: KVDetector.h:168
Bool_t BelongsToIdentifiedParticle() const
Definition: KVDetector.h:571
void SetMatrix(const TGeoHMatrix *m) override
Definition: KVDetector.h:183
void SetEntranceWindowMatrix(const TGeoHMatrix *)
Set ROOT geometry global matrix transformation to coordinate frame of entrance window.
Double_t EResDet(Double_t *x, Double_t *par)
TGeoBBox * GetActiveLayerShape() const
Definition: KVDetector.h:590
virtual void Reset(Option_t *opt="")
Definition: KVDetector.h:414
TVector3 GetActiveLayerVolumeCentre() const
Definition: KVDetector.h:585
const TVector3 GetCentreOfEntranceWindow() const
Definition: KVDetector.h:695
KVMaterial * fActiveLayer
The active absorber in the detector.
Definition: KVDetector.h:167
void AddHit(KVNucleus *part)
Definition: KVDetector.h:420
void RemoveAllAbsorbers()
Definition: KVDetector.cpp:646
Double_t GetEIncOfMaxDeltaE(Int_t Z, Int_t A) override
Double_t GetTotalThicknessInCM() const
Definition: KVDetector.h:334
KVCalibrator * GetCalibrator(const Char_t *name, const Char_t *type) const
Definition: KVDetector.h:830
Int_t fIdentP
temporary counters, determine state of identified/unidentified particle flags
Definition: KVDetector.h:177
void SetPressure(Double_t P) override
Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=0) override
Definition: KVDetector.cpp:268
virtual Bool_t IsPresent() const
Definition: KVDetector.h:653
void SetEntranceWindowShape(TGeoBBox *)
Set ROOT geometry shape of entrance window.
Bool_t fPresent
=kTRUE if detector is present, =kFALSE if it has been removed
Definition: KVDetector.h:273
void GetRandomAngles(Double_t &th, Double_t &ph, Option_t *t="isotropic") override
Definition: KVDetector.h:714
void SetActiveLayerShape(TGeoBBox *)
Set ROOT geometry shape of active layer volume.
TVector3 GetDirection() override
Definition: KVDetector.h:720
void SetAnalysed(Bool_t b=kTRUE)
Definition: KVDetector.h:453
TString fFName
dynamically generated full name of detector
Definition: KVDetector.h:257
Bool_t fSingleLayer
=kTRUE if detector has a single absorber layer
Definition: KVDetector.h:276
virtual TF1 * GetRangeFunction(Int_t Z, Int_t A)
Double_t GetDistance() const override
Definition: KVDetector.h:726
virtual Double_t GetCorrectedEnergy(KVNucleus *, Double_t e=-1., Bool_t transmission=kTRUE)
Definition: KVDetector.cpp:749
void init()
default initialisations
Definition: KVDetector.cpp:32
void Clear(Option_t *opt="") override
Definition: KVDetector.cpp:565
KVList fAbsorbers
list of absorbers making up the detector
Definition: KVDetector.h:260
Bool_t AddCalibrator(KVCalibrator *cal, const KVNameValueList &opts="")
Definition: KVDetector.cpp:439
Double_t GetCosTheta() const override
Definition: KVDetector.h:744
void SetPresent(Bool_t yes=kTRUE)
Definition: KVDetector.h:658
Double_t GetTheta() const override
Definition: KVDetector.h:732
Simple wrapper for objects which can be drawn (graphs, histograms)
Definition: KVDrawable.h:29
Information on relative positions of detectors & particle trajectories.
Base class describing elements of array geometry.
Group of detectors which can be treated independently of all others in array.
Definition: KVGroup.h:20
Extended TList class which owns its objects by default.
Definition: KVList.h:22
Description of physical materials used to construct detectors & targets; interface to range tables.
Definition: KVMaterial.h:90
virtual void SetEnergyLoss(Double_t e) const
Definition: KVMaterial.h:150
virtual Double_t GetThickness() const
Definition: KVMaterial.cpp:484
Bool_t IsGas() const
Definition: KVMaterial.cpp:371
virtual Double_t GetEnergyLoss() const
Definition: KVMaterial.h:140
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:123
Int_t GetA() const
Definition: KVNucleus.cpp:796
Int_t GetZ() const
Return the number of proton / atomic number.
Definition: KVNucleus.cpp:767
Base class used for handling geometry in a multidetector array.
Definition: KVPosition.h:91
virtual void GetRandomAngles(Double_t &th, Double_t &ph, Option_t *t="isotropic")
Definition: KVPosition.cpp:280
virtual TVector3 GetRandomDirection(Option_t *t="isotropic")
Definition: KVPosition.cpp:242
virtual void SetShape(TGeoBBox *)
Definition: KVPosition.cpp:758
virtual Double_t GetSolidAngle(void) const
Definition: KVPosition.cpp:591
virtual Double_t GetTheta() const
Definition: KVPosition.h:169
virtual TVector3 GetSurfaceCentre() const
Definition: KVPosition.cpp:901
virtual TGeoHMatrix * GetMatrix() const
Definition: KVPosition.cpp:792
virtual Double_t GetPhi() const
Definition: KVPosition.h:181
virtual Double_t GetDistance(void) const
Definition: KVPosition.h:199
virtual TVector3 GetVolumeCentre() const
Definition: KVPosition.cpp:930
virtual Double_t GetSurfaceArea(int npoints=100000) const
Definition: KVPosition.cpp:989
virtual Double_t GetSinTheta() const
Definition: KVPosition.h:173
virtual TVector3 GetSurfaceNormal() const
Definition: KVPosition.cpp:960
virtual Double_t GetMisalignmentAngle() const
virtual void SetMatrix(const TGeoHMatrix *)
Definition: KVPosition.cpp:717
virtual TGeoBBox * GetShape() const
Definition: KVPosition.cpp:805
virtual Double_t GetCosTheta() const
Definition: KVPosition.h:177
virtual Bool_t ROOTGeo() const
Definition: KVPosition.h:210
virtual TVector3 GetDirection()
Definition: KVPosition.cpp:487
virtual TVector3 GetRandomPointOnSurface() const
Definition: KVPosition.cpp:828
KaliVeda extensions to ROOT collection classes.
T * get_object(const TString &name) const
TObject * Remove(TObject *obj) override
Remove object from list.
void Add(TObject *obj) override
TObject * FindObject(const char *name) const override
void Clear(Option_t *option="") override
virtual TObject * FindObjectByType(const Char_t *) const
virtual TObject * FindObjectWithNameAndType(const Char_t *name, const Char_t *type) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
Optimised list in which named objects can only be placed once.
void Add(TObject *obj) override
Extended TList class which does not own its objects by default.
Definition: KVUnownedList.h:20
virtual Int_t GetEntries() const
virtual Bool_t IsEmpty() const
const char * GetName() const override
void SetBit(UInt_t f)
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
const Int_t n
TMarker m
TArc a