Project
Loading...
Searching...
No Matches
Cave.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12/********************************************************************************
13 * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
14 * *
15 * This software is distributed under the terms of the *
16 * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
17 * copied verbatim in the file "LICENSE" *
18 ********************************************************************************/
19
20// -------------------------------------------------------------------------
21// ----- Cave file -----
22// ----- Created 26/03/14 by M. Al-Turany -----
23// -------------------------------------------------------------------------
24
25#ifndef ALICEO2_PASSIVE_Cave_H
26#define ALICEO2_PASSIVE_Cave_H
27
28#include "FairDetector.h" // for FairModule
29#include "Rtypes.h" // for ClassDef, etc
30#include <functional> // for std::function
31#include <vector>
32namespace o2
33{
34namespace passive
35{
36
37// This class represents the mother container
38// holding all the detector (passive and active) modules
39
40// The Cave is a FairDetector rather than a FairModule
41// in order to be able to receive notifications about
42// BeginPrimary/FinishPrimary/etc from the FairMCApplication and
43// eventually dispatch to further O2 specific observers. This special role
44// is justifiable since the Cave instance necessarily always exists.
45class Cave : public FairDetector
46{
47 public:
48 Cave(const char* name, const char* Title = "Exp Cave");
49 Cave();
50 ~Cave() override;
51 void ConstructGeometry() override;
52 void createMaterials();
53
55 FairModule* CloneModule() const override;
56
57 // the following methods are required for FairDetector but are not actually
58 // implemented
59 Bool_t ProcessHits(FairVolume* v = nullptr) override; // should never be actually called
60 void Register() override {}
61 TClonesArray* GetCollection(Int_t iColl) const override { return nullptr; }
62 void Reset() override {}
63
64 void FinishPrimary() override;
65 void addFinishPrimaryHook(std::function<void()>&& hook) { mFinishPrimaryHooks.emplace_back(hook); }
66
67 void includeZDC(bool hasZDC) { mHasZDC = hasZDC; }
68 void includeRB24(const bool hasRB24 = true) { mHasRB24 = hasRB24; }
69
70 void BeginPrimary() override;
71
72 private:
73 Cave(const Cave& orig);
74 Cave& operator=(const Cave&);
75
76 std::vector<std::function<void()>> mFinishPrimaryHooks;
77
78 bool mHasZDC = true;
79 bool mHasRB24 = true;
80 ClassDefOverride(o2::passive::Cave, 1);
81};
82} // namespace passive
83} // namespace o2
84#endif // Cave_H
void addFinishPrimaryHook(std::function< void()> &&hook)
Definition Cave.h:65
Bool_t ProcessHits(FairVolume *v=nullptr) override
Definition Cave.cxx:163
void FinishPrimary() override
Definition Cave.cxx:132
void createMaterials()
Definition Cave.cxx:38
void includeZDC(bool hasZDC)
Definition Cave.h:67
~Cave() override
void BeginPrimary() override
Definition Cave.cxx:143
void ConstructGeometry() override
Definition Cave.cxx:61
void Reset() override
Definition Cave.h:62
void Register() override
Definition Cave.h:60
TClonesArray * GetCollection(Int_t iColl) const override
Definition Cave.h:61
FairModule * CloneModule() const override
Clone this object (used in MT mode only)
Definition Cave.cxx:131
void includeRB24(const bool hasRB24=true)
Definition Cave.h:68
const GLdouble * v
Definition glcorearb.h:832
GLuint const GLchar * name
Definition glcorearb.h:781
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...