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 "KVNucleus.h"
34 #include "KVGeoDetectorNode.h"
35 #include "KVUniqueNameList.h"
36 #include "KVDetectorSignal.h"
37 #include "KVEvent.h"
38 
39 class KVGeoStrucElement;
40 class KVGroup;
41 class KVCalibrator;
42 class TGeoVolume;
43 class TTree;
44 class TGraph;
45 
158 class KVDetector: public KVMaterial, public KVPosition {
159 
160 private:
167 
168  enum {
169  kIsAnalysed = BIT(14), //for reconstruction of particles
170  kActiveSet = BIT(15), //internal - flag set true when SetActiveLayer called
171  kUnidentifiedParticle = BIT(16), //set if detector is in an unidentified particle's list
172  kIdentifiedParticle = BIT(17), //set if detector is in an identified particle's list
173  };
174 
177 
181  void SetMatrix(const TGeoHMatrix* m) override
182  {
184  }
185  void SetShape(TGeoBBox* s) override
186  {
188  }
189  TGeoHMatrix* GetMatrix() const override
190  {
191  return KVPosition::GetMatrix();
192  }
193  TGeoBBox* GetShape() const override
194  {
195  return KVPosition::GetShape();
196  }
198  {
200  }
201  TVector3 GetSurfaceCentre() const override
202  {
204  }
205  TVector3 GetVolumeCentre() const override
206  {
208  }
209  TVector3 GetSurfaceNormal() const override
210  {
212  }
213  Double_t GetSurfaceArea(int npoints = 100000) const override
214  {
215  return KVPosition::GetSurfaceArea(npoints);
216  }
218  {
220  }
221 
224 
226 
227  template<typename AbsorberStack>
228  Double_t get_corrected_energy(AbsorberStack* stack, KVNucleus* nuc, Double_t e, Bool_t transmission)
229  {
230  auto z = nuc->GetZ();
231  auto a = nuc->GetA();
232  enum SolType solution = kEmax;
233  if (!transmission) solution = kEmin;
234  Double_t EINC, ERES = GetEResAfterDetector();
235  if (transmission && ERES > 0.) { // if residual energy is known we use it to calculate EINC.
236 
237  EINC = stack->GetIncidentEnergyFromERes(z, a, ERES);
238  if (EINC < stack->GetEIncOfMaxDeltaE(z, a)) {// if EINC < max of dE curve, we change solution
239  solution = kEmin;
240  } // we could keep the EINC value calculated using ERES, but then the corrected dE of this detector would not depend on the measured dE !
241  }
242  EINC = stack->GetIncidentEnergy(z, a, e, solution);
243  if (EINC < 0) {
245  return EINC;
246  }
247  ERES = stack->GetERes(z, a, EINC);
248 
250  return (EINC - ERES);
251  }
252 
253 protected:
254 
259 
261  Double_t EResDet(Double_t* x, Double_t* par);
263 
267 
269 
273 
275 
277  {
281  ds->SetDetector(this);
282  fDetSignals.Add(ds);
284  }
286  {
287  return true;
288  }
289 
290 public:
291  KVDetector();
292  KVDetector(const Char_t* type, const Float_t thick = 0.0);
293  KVDetector(const Char_t* gas, const Double_t thick, const Double_t pressure, const Double_t temperature = 19.0);
294  KVDetector(const KVDetector&);
295  void init();
296  virtual ~ KVDetector();
297 
298  void Copy(TObject& obj) const override;
299 
300  void SetMaterial(const Char_t* type) override;
301  void AddAbsorber(KVMaterial*);
303  {
304  fActiveLayer = actif;
306  }
308  {
310  if (auto mat = GetAbsorber(i)) SetActiveLayer(mat);
311  }
312  KVMaterial* GetActiveLayer() const override
313  {
315  return fActiveLayer;
316  }
317  KVMaterial* GetAbsorber(Int_t i) const;
318  KVMaterial* GetAbsorber(const Char_t* name) const
319  {
322  }
323  const KVList* GetListOfAbsorbers() const
324  {
325  return &fAbsorbers;
326  }
328  {
329  return fAbsorbers.GetEntries();
330  }
331  void RemoveAllAbsorbers();
332 
334  {
337 
338  double fTotThickness = 0;
339  TIter next(&fAbsorbers);
340  KVMaterial* mat;
341  while ((mat = (KVMaterial*)next())) fTotThickness += mat->GetThickness();
342  return fTotThickness;
343  }
345  {
346  return &fNode;
347  }
348 
349  const Char_t* GetMaterialName() const
350  {
351  if (GetActiveLayer())
352  return GetActiveLayer()->GetName();
353  return KVMaterial::GetName();
354  }
355  void DetectParticle(KVNucleus*, TVector3* norm = 0) override;
356  Double_t GetELostByParticle(KVNucleus*, TVector3* norm = 0) override;
357  Double_t GetParticleEIncFromERes(KVNucleus*, TVector3* norm = 0) override;
358 
360  {
362  return GetDetectorSignalValue("Energy");
363  }
364  virtual Double_t GetEnergy() const
365  {
369  if (IsSimMode()) return ELoss; // in simulation mode, return calculated energy loss in active layer
370  if (ELoss > 0) return ELoss;
371  ELoss = GetCalibratedEnergy();
372  if (ELoss < 0) ELoss = 0;
373  SetEnergy(ELoss);
374  return ELoss;
375  }
376  virtual void SetEnergy(Double_t e) const
377  {
383  }
384  Double_t GetEnergyLoss() const override
385  {
386  return GetEnergy();
387  }
388  void SetEnergyLoss(Double_t e) const override
389  {
390  SetEnergy(e);
391  }
393  -1., Bool_t transmission = kTRUE);
394  virtual Int_t FindZmin(Double_t ELOSS = -1., Char_t mass_formula = -1);
395 
396  Bool_t AddCalibrator(KVCalibrator* cal, const KVNameValueList& opts = "");
397  Bool_t ReplaceCalibrator(const Char_t* type, KVCalibrator* cal, const KVNameValueList& opts = "");
398  KVCalibrator* GetCalibrator(const Char_t* name,
399  const Char_t* type) const;
400  KVCalibrator* GetCalibrator(const Char_t* type) const;
402  {
403  return fCalibrators;
404  }
406  {
408  return (IsSimMode() && IsDetecting()) || (HasDetectorSignal("Energy") && IsOK());
409  }
410  Bool_t IsCalibrated(const KVNameValueList& params) const;
411 
412  void Clear(Option_t* opt = "") override;
413  virtual void Reset(Option_t* opt = "")
414  {
415  Clear(opt);
416  }
417  void Print(Option_t* option = "") const override;
418 
419  void AddHit(KVNucleus* part)
420  {
422 
423  if (!fParticles) {
424  fParticles = new KVList(kFALSE);
426  }
427  fParticles->Add(part);
428  }
429 
430  void RemoveHit(KVNucleus* part)
431  {
433 
434  fParticles->Remove(part);
436  }
437 
439  KVList* GetHits() const
440  {
441  return fParticles;
442  }
443  void ClearHits()
444  {
446  if (fParticles) fParticles->Clear();
447  }
449  Int_t GetNHits() const
450  {
451  return (fParticles ? fParticles->GetEntries() : 0);
452  }
453 
455  {
456  return TestBit(kIsAnalysed);
457  }
458  void SetAnalysed(Bool_t b = kTRUE)
459  {
460  SetBit(kIsAnalysed, b);
461  }
462  virtual Bool_t Fired(Option_t* opt = "any") const
463  {
478 
479  if (!IsDetecting()) return kFALSE; //detector not working, no answer at all
480  if (IsSimMode()) return (GetActiveLayer() ? GetActiveLayer()->GetEnergyLoss() > 0. : KVMaterial::GetEnergyLoss() > 0.); // simulation mode: detector fired if energy lost in active layer
481 
482  TString OPT(opt);
483  OPT.ToLower();
484  Bool_t all = (OPT == "all");
485 
486  TIter raw_it(&GetListOfDetectorSignals());
487  KVDetectorSignal* ds;
488  int count_raw = 0;
489  while ((ds = (KVDetectorSignal*)raw_it())) {
490  if (ds->IsRaw()) {
491  ++count_raw;
492  if (ds->IsFired()) {
493  if (!all) return kTRUE;
494  }
495  else {
496  if (all) return kFALSE;
497  }
498  }
499  }
500  return all && count_raw;
501  }
502  virtual void RemoveCalibrators();
503 
504  Double_t GetDetectorSignalValue(const KVString& type, const KVNameValueList& params = "") const
505  {
513 
515  return (s ? s->GetValue(params) : 0);
516  }
517  void SetDetectorSignalValue(const KVString& type, Double_t val) const
518  {
524 
526  if (s) s->SetValue(val);
527  }
528  Double_t GetInverseDetectorSignalValue(const KVString& output, Double_t value, const KVString& input, const KVNameValueList& params = "") const
529  {
540 
541  KVDetectorSignal* s = GetDetectorSignal(output);
542  return (s ? s->GetInverseValue(value, input, params) : 0);
543  }
544  virtual KVDetectorSignal* GetDetectorSignal(const KVString& type) const
545  {
550 
552  }
553  Bool_t HasDetectorSignal(const KVString& type) const
554  {
557  return (GetDetectorSignal(type) != nullptr);
558  }
559 
561  {
562  fUnidentP += n;
563  fUnidentP = (fUnidentP > 0) * fUnidentP;
565  }
567  {
568  fIdentP += n;
569  fIdentP = (fIdentP > 0) * fIdentP;
571  }
573  {
575  }
577  {
579  }
580 
581  static KVDetector* MakeDetector(const Char_t* name, Float_t thick);
582 
585  {
588  return GetSurfaceCentre();
589  }
591  {
594  }
596  {
598  return GetShape();
599  }
601  {
603  return GetMatrix();
604  }
605 
606  Double_t GetMaxDeltaE(Int_t Z, Int_t A) override;
607  Double_t GetEIncOfMaxDeltaE(Int_t Z, Int_t A) override;
608  Double_t GetDeltaE(Int_t Z, Int_t A, Double_t Einc, Double_t = 0.) override;
609  virtual Double_t GetTotalDeltaE(Int_t Z, Int_t A, Double_t Einc);
610  Double_t GetERes(Int_t Z, Int_t A, Double_t Einc, Double_t = 0.) override;
612  -1.0, enum SolType type = kEmax) override;
613  /*virtual Double_t GetEResFromDeltaE(...) - DON'T IMPLEMENT, CALLS GETINCIDENTENERGY*/
614  Double_t GetDeltaEFromERes(Int_t Z, Int_t A, Double_t Eres) override;
616  Double_t GetRange(Int_t Z, Int_t A, Double_t Einc) override;
617  Double_t GetLinearRange(Int_t Z, Int_t A, Double_t Einc) override;
618  Double_t GetPunchThroughEnergy(Int_t Z, Int_t A) override;
621 
622  virtual TF1* GetEResFunction(Int_t Z, Int_t A);
623  virtual TF1* GetELossFunction(Int_t Z, Int_t A);
624  virtual TF1* GetRangeFunction(Int_t Z, Int_t A);
625 
626  virtual Double_t GetSmallestEmaxValid(Int_t Z, Int_t A) const;
627 
629  {
630  fEResforEinc = e;
631  }
633  {
634  return fEResforEinc;
635  }
636 
637  virtual void ReadDefinitionFromFile(const Char_t*);
638 
639  virtual void SetSimMode(Bool_t on = kTRUE)
640  {
646  fSimMode = on;
647  }
648  virtual Bool_t IsSimMode() const
649  {
655  return fSimMode;
656  }
657 
658  virtual Bool_t IsPresent() const
659  {
661  return fPresent;
662  }
663  void SetPresent(Bool_t yes = kTRUE)
664  {
665  fPresent = yes;
666  }
667  virtual Bool_t IsDetecting() const
668  {
670  return fDetecting;
671  }
672  void SetDetecting(Bool_t yes = kTRUE)
673  {
674  fDetecting = yes;
675  }
676 
677  virtual Bool_t IsOK() const
678  {
680  return (fPresent && fDetecting);
681  }
682 
683  KVGroup* GetGroup() const;
685 
688  KVGeoStrucElement* GetParentStructure(const Char_t* type, const Char_t* name = "") const;
689 
690  void SetActiveLayerMatrix(const TGeoHMatrix*);
695  {
698  return fEWPosition;
699  }
701  {
706  }
707  Double_t GetSolidAngle() const override
708  {
710  if (ROOTGeo()) return fEWPosition.GetSolidAngle();
711  return KVPosition::GetSolidAngle();
712  }
713  TVector3 GetRandomDirection(Option_t* t = "isotropic") override
714  {
716  if (ROOTGeo()) return fEWPosition.GetRandomDirection(t);
718  }
719  void GetRandomAngles(Double_t& th, Double_t& ph, Option_t* t = "isotropic") override
720  {
722  if (ROOTGeo()) fEWPosition.GetRandomAngles(th, ph, t);
723  else KVPosition::GetRandomAngles(th, ph, t);
724  }
726  {
728  if (ROOTGeo()) return fEWPosition.GetDirection();
729  return KVPosition::GetDirection();
730  }
731  Double_t GetDistance() const override
732  {
734  if (ROOTGeo()) return fEWPosition.GetDistance();
735  return KVPosition::GetDistance();
736  }
737  Double_t GetTheta() const override
738  {
740  if (ROOTGeo()) return fEWPosition.GetTheta();
741  return KVPosition::GetTheta();
742  }
743  Double_t GetSinTheta() const override
744  {
746  if (ROOTGeo()) return fEWPosition.GetSinTheta();
747  return KVPosition::GetSinTheta();
748  }
749  Double_t GetCosTheta() const override
750  {
752  if (ROOTGeo()) return fEWPosition.GetCosTheta();
753  return KVPosition::GetCosTheta();
754  }
755  Double_t GetPhi() const override
756  {
758  if (ROOTGeo()) return fEWPosition.GetPhi();
759  return KVPosition::GetPhi();
760  }
761 
762  void SetThickness(Double_t thick) override;
764  {
766  return fSingleLayer;
767  }
769  {
771  return !IsSingleLayer();
772  }
774  {
776  return IsGas();
777  }
778  Bool_t HasSameStructureAs(const KVDetector*) const;
779  void SetNameOfArray(const TString& n)
780  {
781  fNameOfArray = n;
782  }
783  const Char_t* GetNameOfArray() const
784  {
786  return fNameOfArray;
787  }
788 
790  {
791  return fDetSignals;
792  }
794  {
795  return fDetSignalsForRawTree;
796  }
798  {
803 
804  auto signal = new KVDetectorSignal(type, this);
805  fDetSignals.Add(signal);
807  return signal;
808  }
809  Bool_t AddDetectorSignalExpression(const KVString& type, const KVString& _expr);
810 
811  virtual Int_t GetIndex() const
812  {
816 
817  return 0;
818  }
819 
820  void SetPressure(Double_t P) override;
821  void SetTemperature(Double_t T) override;
822 
823  virtual Bool_t IsSegmented() const
824  {
825  return kFALSE;
826  }
827  virtual void AddEnergyLossInSubDetector(int, double) {}
828 
829  ClassDefOverride(KVDetector, 10) //Base class for the description of detectors in multidetector arrays
830 };
831 
833  const Char_t* type) const
834 {
835  if (fCalibrators)
837  return 0;
838 }
839 
841 {
842  if (fCalibrators)
844  return 0;
845 }
846 #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)
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
Base class for output signal data produced by a detector.
virtual Bool_t IsFired() const
const Char_t * GetType() const override
virtual Bool_t IsRaw() const
void SetDetector(const KVDetector *d)
Base class for detector geometry description, interface to energy-loss calculations.
Definition: KVDetector.h:158
void SetDetectorSignalValue(const KVString &type, Double_t val) const
Definition: KVDetector.h:517
void SetNameOfArray(const TString &n)
Definition: KVDetector.h:779
KVMaterial * GetAbsorber(const Char_t *name) const
Definition: KVDetector.h:318
Double_t GetInverseDetectorSignalValue(const KVString &output, Double_t value, const KVString &input, const KVNameValueList &params="") const
Definition: KVDetector.h:528
static KVDetector * MakeDetector(const Char_t *name, Float_t thick)
TGeoHMatrix * GetActiveLayerMatrix() const
Definition: KVDetector.h:600
void SetThickness(Double_t thick) override
void IncrementIdentifiedParticles(Int_t n=1)
Definition: KVDetector.h:566
virtual Bool_t IsSimMode() const
Definition: KVDetector.h:648
virtual Bool_t IsOK() const
Definition: KVDetector.h:677
virtual Bool_t use_signal_for_raw_data_tree(const TString &) const
Definition: KVDetector.h:285
KVPosition fEWPosition
position of entrance window i.e. first volume in detector geometry
Definition: KVDetector.h:161
virtual void SetSimMode(Bool_t on=kTRUE)
Definition: KVDetector.h:639
Double_t GetMisalignmentAngle() const override
Definition: KVDetector.h:217
const Char_t * GetMaterialName() const
Definition: KVDetector.h:349
KVMaterial * GetActiveLayer() const override
Definition: KVDetector.h:312
KVUniqueNameList fParentStrucList
list of geometry structures which directly contain this detector
Definition: KVDetector.h:162
Int_t GetNumberOfAbsorberLayers() const
Definition: KVDetector.h:327
void IncrementUnidentifiedParticles(Int_t n=1)
Definition: KVDetector.h:560
Double_t GetSurfaceArea(int npoints=100000) const override
Definition: KVDetector.h:213
virtual void AddEnergyLossInSubDetector(int, double)
Definition: KVDetector.h:827
void SetMaterial(const Char_t *type) override
Definition: KVDetector.cpp:169
Double_t ELossActive(Double_t *x, Double_t *par)
Definition: KVDetector.cpp:924
void SetTemperature(Double_t T) override
KVList * fCalibrators
list of associated calibrator objects
Definition: KVDetector.h:256
KVGeoStrucElement * GetParentStructure(const Char_t *type, const Char_t *name="") const
KVGroup * GetGroup() const
void AddDetectorSignal(KVDetectorSignal *ds)
Definition: KVDetector.h:276
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:272
Bool_t ReplaceCalibrator(const Char_t *type, KVCalibrator *cal, const KVNameValueList &opts="")
Definition: KVDetector.cpp:517
KVList * GetHits() const
Return the list of particles hitting this detector in an event.
Definition: KVDetector.h:439
virtual Double_t GetTotalDeltaE(Int_t Z, Int_t A, Double_t Einc)
virtual Double_t GetEnergy() const
Definition: KVDetector.h:364
Int_t GetNHits() const
Return the number of particles hitting this detector in an event.
Definition: KVDetector.h:449
virtual TF1 * GetEResFunction(Int_t Z, Int_t A)
KVList * GetListOfCalibrators() const
Definition: KVDetector.h:401
void RemoveHit(KVNucleus *part)
Definition: KVDetector.h:430
virtual TGraph * DrawPunchThroughEsurAVsZ(Int_t massform=KVNucleus::kBetaMass)
const KVSeqCollection & GetListOfDetectorSignalsForRawTree() const
Definition: KVDetector.h:793
static Int_t fDetCounter
Definition: KVDetector.h:164
void AddAbsorber(KVMaterial *)
Definition: KVDetector.cpp:607
virtual Double_t GetEResAfterDetector() const
Definition: KVDetector.h:632
TVector3 GetSurfaceCentre() const override
Definition: KVDetector.h:201
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:768
void AddParentStructure(KVGeoStrucElement *elem)
Bool_t IsSingleLayer() const
Definition: KVDetector.h:763
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:268
void Print(Option_t *option="") const override
Definition: KVDetector.cpp:356
TVector3 GetSurfaceNormal() const override
Definition: KVDetector.h:209
TVector3 GetVolumeCentre() const override
Definition: KVDetector.h:205
virtual Int_t GetIndex() const
Definition: KVDetector.h:811
virtual Int_t FindZmin(Double_t ELOSS=-1., Char_t mass_formula=-1)
Definition: KVDetector.cpp:850
Double_t GetSinTheta() const override
Definition: KVDetector.h:743
TF1 * fELossF
parametric function dE in active layer vs. incident energy
Definition: KVDetector.h:264
Double_t GetLinearRange(Int_t Z, Int_t A, Double_t Einc) override
const KVPosition & GetEntranceWindow() const
Definition: KVDetector.h:694
Bool_t HasDetectorSignal(const KVString &type) const
Definition: KVDetector.h:553
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:172
@ kUnidentifiedParticle
Definition: KVDetector.h:171
void ClearHits()
Definition: KVDetector.h:443
void SetEnergyLoss(Double_t e) const override
Definition: KVDetector.h:388
void remove_signal_for_calibrator(KVCalibrator *K)
Definition: KVDetector.cpp:679
TF1 * fEResF
parametric function Eres residual energy after all layers of detector
Definition: KVDetector.h:265
KVDetectorSignal * AddDetectorSignal(const KVString &type)
Definition: KVDetector.h:797
TVector3 GetActiveLayerSurfaceCentre() const
Definition: KVDetector.h:584
Bool_t HasSameStructureAs(const KVDetector *) const
virtual Bool_t Fired(Option_t *opt="any") const
Definition: KVDetector.h:462
UInt_t GetGroupNumber()
Double_t GetPhi() const override
Definition: KVDetector.h:755
virtual KVDetectorSignal * GetDetectorSignal(const KVString &type) const
Definition: KVDetector.h:544
virtual void ReadDefinitionFromFile(const Char_t *)
Bool_t IsCalibrated() const
Definition: KVDetector.h:405
Double_t GetEnergyLoss() const override
Definition: KVDetector.h:384
void SetShape(TGeoBBox *s) override
Definition: KVDetector.h:185
void Copy(TObject &obj) const override
Definition: KVDetector.cpp:129
void SetDetecting(Bool_t yes=kTRUE)
Definition: KVDetector.h:672
virtual TF1 * GetELossFunction(Int_t Z, Int_t A)
void SetActiveLayer(KVMaterial *actif)
Definition: KVDetector.h:302
KVDetector()
default ctor
Definition: KVDetector.cpp:58
TGeoHMatrix * GetMatrix() const override
Definition: KVDetector.h:189
Double_t GetSolidAngle() const override
Definition: KVDetector.h:707
Bool_t BelongsToUnidentifiedParticle() const
Definition: KVDetector.h:572
void DetectParticle(KVNucleus *, TVector3 *norm=0) override
Definition: KVDetector.cpp:195
Double_t RangeDet(Double_t *x, Double_t *par)
Definition: KVDetector.cpp:962
const Char_t * GetNameOfArray() const
Definition: KVDetector.h:783
Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=0) override
Definition: KVDetector.cpp:320
virtual void RemoveCalibrators()
Definition: KVDetector.cpp:701
virtual Double_t GetEntranceWindowSurfaceArea()
Return surface area of first layer of detector in cm2.
TGeoBBox * GetShape() const override
Definition: KVDetector.h:193
virtual TGraph * DrawPunchThroughEnergyVsZ(Int_t massform=KVNucleus::kBetaMass)
const KVList * GetListOfAbsorbers() const
Definition: KVDetector.h:323
KVUniqueNameList fDetSignals
list of signals associated with detector
Definition: KVDetector.h:222
Bool_t IsGasDetector() const
Definition: KVDetector.h:773
Double_t get_corrected_energy(AbsorberStack *stack, KVNucleus *nuc, Double_t e, Bool_t transmission)
Definition: KVDetector.h:228
Int_t fUnidentP
temporary counters, determine state of identified/unidentified particle flags
Definition: KVDetector.h:176
TF1 * fRangeF
parametric function range of particles in detector
Definition: KVDetector.h:266
Bool_t AddDetectorSignalExpression(const KVString &type, const KVString &_expr)
Double_t GetDetectorSignalValue(const KVString &type, const KVNameValueList &params="") const
Definition: KVDetector.h:504
virtual void SetEnergy(Double_t e) const
Definition: KVDetector.h:376
virtual void SetEResAfterDetector(Double_t e)
Definition: KVDetector.h:628
virtual Double_t GetCalibratedEnergy() const
Definition: KVDetector.h:359
KVGeoDetectorNode fNode
positioning information relative to other detectors
Definition: KVDetector.h:163
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:667
virtual Bool_t IsSegmented() const
Definition: KVDetector.h:823
void SetActiveLayer(Int_t i)
Definition: KVDetector.h:307
Double_t GetMaxDeltaE(Int_t Z, Int_t A) override
Bool_t IsAnalysed()
Definition: KVDetector.h:454
TVector3 GetRandomDirection(Option_t *t="isotropic") override
Definition: KVDetector.h:713
void RemoveParentStructure(KVGeoStrucElement *elem)
virtual Double_t GetSmallestEmaxValid(Int_t Z, Int_t A) const
const KVSeqCollection & GetListOfDetectorSignals() const
Definition: KVDetector.h:789
KVUniqueNameList fDetSignalsForRawTree
list of signals used for raw data TTree
Definition: KVDetector.h:223
KVList * fParticles
list of particles hitting detector in an event
Definition: KVDetector.h:257
KVGeoDetectorNode * GetNode()
Definition: KVDetector.h:344
TVector3 GetRandomPointOnSurface() const override
Definition: KVDetector.h:197
Bool_t fSimMode
=kTRUE when using to simulate detector response, =kFALSE when analysing data
Definition: KVDetector.h:270
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:166
Bool_t BelongsToIdentifiedParticle() const
Definition: KVDetector.h:576
void SetMatrix(const TGeoHMatrix *m) override
Definition: KVDetector.h:181
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:595
virtual void Reset(Option_t *opt="")
Definition: KVDetector.h:413
TVector3 GetActiveLayerVolumeCentre() const
Definition: KVDetector.h:590
const TVector3 GetCentreOfEntranceWindow() const
Definition: KVDetector.h:700
KVMaterial * fActiveLayer
The active absorber in the detector.
Definition: KVDetector.h:165
void AddHit(KVNucleus *part)
Definition: KVDetector.h:419
void RemoveAllAbsorbers()
Definition: KVDetector.cpp:646
Double_t GetEIncOfMaxDeltaE(Int_t Z, Int_t A) override
Double_t GetTotalThicknessInCM() const
Definition: KVDetector.h:333
KVCalibrator * GetCalibrator(const Char_t *name, const Char_t *type) const
Definition: KVDetector.h:832
Int_t fIdentP
temporary counters, determine state of identified/unidentified particle flags
Definition: KVDetector.h:175
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:658
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:271
void GetRandomAngles(Double_t &th, Double_t &ph, Option_t *t="isotropic") override
Definition: KVDetector.h:719
void SetActiveLayerShape(TGeoBBox *)
Set ROOT geometry shape of active layer volume.
TVector3 GetDirection() override
Definition: KVDetector.h:725
void SetAnalysed(Bool_t b=kTRUE)
Definition: KVDetector.h:458
TString fFName
dynamically generated full name of detector
Definition: KVDetector.h:255
Bool_t fSingleLayer
=kTRUE if detector has a single absorber layer
Definition: KVDetector.h:274
virtual TF1 * GetRangeFunction(Int_t Z, Int_t A)
Double_t GetDistance() const override
Definition: KVDetector.h:731
virtual Double_t GetCorrectedEnergy(KVNucleus *, Double_t e=-1., Bool_t transmission=kTRUE)
Definition: KVDetector.cpp:751
void init()
default initialisations
Definition: KVDetector.cpp:31
void Clear(Option_t *opt="") override
Definition: KVDetector.cpp:565
KVList fAbsorbers
list of absorbers making up the detector
Definition: KVDetector.h:258
Bool_t AddCalibrator(KVCalibrator *cal, const KVNameValueList &opts="")
Definition: KVDetector.cpp:439
Double_t GetCosTheta() const override
Definition: KVDetector.h:749
void SetPresent(Bool_t yes=kTRUE)
Definition: KVDetector.h:663
Double_t GetTheta() const override
Definition: KVDetector.h:737
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:28
Description of physical materials used to construct detectors & targets; interface to range tables.
Definition: KVMaterial.h:89
virtual void SetEnergyLoss(Double_t e) const
Definition: KVMaterial.h:149
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:139
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:792
Int_t GetZ() const
Return the number of proton / atomic number.
Definition: KVNucleus.cpp:763
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:743
virtual Double_t GetSolidAngle(void) const
Definition: KVPosition.cpp:567
virtual Double_t GetTheta() const
Definition: KVPosition.h:160
virtual Bool_t ROOTGeo() const
Returns kTRUE if ROOT geometry is used, kFALSE if not.
Definition: KVPosition.cpp:598
virtual TVector3 GetSurfaceCentre() const
Definition: KVPosition.cpp:886
virtual TGeoHMatrix * GetMatrix() const
Definition: KVPosition.cpp:777
virtual Double_t GetPhi() const
Definition: KVPosition.h:172
virtual Double_t GetDistance(void) const
Definition: KVPosition.h:190
virtual TVector3 GetVolumeCentre() const
Definition: KVPosition.cpp:915
virtual Double_t GetSurfaceArea(int npoints=100000) const
Definition: KVPosition.cpp:974
virtual Double_t GetSinTheta() const
Definition: KVPosition.h:164
virtual TVector3 GetSurfaceNormal() const
Definition: KVPosition.cpp:945
virtual Double_t GetMisalignmentAngle() const
virtual void SetMatrix(const TGeoHMatrix *)
Definition: KVPosition.cpp:702
virtual TGeoBBox * GetShape() const
Definition: KVPosition.cpp:790
virtual Double_t GetCosTheta() const
Definition: KVPosition.h:168
virtual TVector3 GetDirection()
Definition: KVPosition.cpp:463
virtual TVector3 GetRandomPointOnSurface() const
Definition: KVPosition.cpp:813
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 void SetCleanup(Bool_t enable=kTRUE)
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
virtual Int_t GetEntries() 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