REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestAxionTransmissionProcess.h
1 /*************************************************************************
2  * This file is part of the REST software framework. *
3  * *
4  * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5  * For more information see http://gifna.unizar.es/trex *
6  * *
7  * REST is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * REST is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have a copy of the GNU General Public License along with *
18  * REST in $REST_PATH/LICENSE. *
19  * If not, see http://www.gnu.org/licenses/. *
20  * For the list of contributors see $REST_PATH/CREDITS. *
21  *************************************************************************/
22 
23 #ifndef RestCore_TRestAxionTransmissionProcess
24 #define RestCore_TRestAxionTransmissionProcess
25 
26 #include "TRestAxionEvent.h"
27 #include "TRestAxionEventProcess.h"
28 #include "TRestAxionXrayWindow.h"
29 
32  private:
34  std::vector<std::string> fWindowNames; //<
35 
37  std::vector<TRestAxionXrayWindow*> fXrayWindows;
38 
39  void Initialize() override;
40 
41  void LoadDefaultConfig();
42 
43  protected:
44  public:
45  void InitProcess() override;
46 
47  void InitFromConfigFile() override;
48 
49  TRestEvent* ProcessEvent(TRestEvent* evInput) override;
50 
51  void LoadConfig(std::string cfgFilename, std::string name = "");
52 
54  void PrintMetadata() override {
56 
57  RESTMetadata << "X-ray window names: " << RESTendl;
58  for (const auto& wName : fWindowNames) RESTMetadata << " - " << wName << RESTendl;
59 
61 
62  RESTMetadata << "Printing window definitions found inside TRestAxionTransmissionProcess" << RESTendl;
63 
64  for (const auto& w : fXrayWindows) w->PrintMetadata();
65  }
66 
68  const char* GetProcessName() const override { return "axionTransmission"; }
69 
70  // Constructor
72  TRestAxionTransmissionProcess(char* cfgFileName);
73 
74  // Destructor
76 
77  ClassDefOverride(TRestAxionTransmissionProcess, 1);
78 };
79 #endif
A base class for any axion event process. Defines position, rotation and component displacement.
void BeginPrintProcess()
Pre-defined printer, can be used at the beginning in the implementation of PrintMetadata()
void EndPrintProcess()
Adds the footer for PrintMetadata.
A process to include photon transmission using a combination of TRestAxionXrayWindow definitions.
TRestEvent * ProcessEvent(TRestEvent *evInput) override
The main processing event function.
std::vector< TRestAxionXrayWindow * > fXrayWindows
A list with pointers to the windows metadata descriptions.
const char * GetProcessName() const override
Returns the name of this process.
void InitProcess() override
Process initialization. Data members that require initialization just before start processing should ...
std::vector< std::string > fWindowNames
The names of the metadata TRestAxionXrayWindow that will be combined for transmission.
void InitFromConfigFile() override
Function reading input parameters from the RML TRestAxionTransmissionProcess metadata section.
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
void PrintMetadata() override
It prints out the process parameters stored in the metadata structure.
void Initialize() override
Function to initialize input/output event members and define the section name.
void LoadConfig(std::string cfgFilename, std::string name="")
Function to load the configuration from an external configuration file.
A base class for any REST event.
Definition: TRestEvent.h:38
endl_t RESTendl
Termination flag object for TRestStringOutput.