ZDC.cpp 1.45 KB
Newer Older
clantz's avatar
clantz committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/** @file ZDC.cpp
 *  @brief Implementation of ZDC.
 *
 *  Function definitions for ZDC are provided. 
 *  This is a daughter class of Detector.
 *  Methods specific to ZDCs are implemented here.
 *
 *  @author Chad Lantz
 *  @bug No known bugs.
 */

#include "ZDC.h"


/** @brief Default Constructor for ZDC.
 */
ZDC::ZDC( ){
	
}

21
22
23
24
25
26
27
28
29

ZDC::ZDC( std::vector < Channel* > _readOut, int _zdcNumber){

    m_Number = _zdcNumber;
    for(int i = 0; i < (int)_readOut.size(); i++){
        if(_readOut.at(i)->name == "ZDC" && _readOut.at(i)->mapping_column == m_Number){
            SetElement(_readOut.at(i));
        }
    }
30
31
    if(GetChannelsVector().size() > 1) std::cout << "WARNING : more than one entry for one ZDC module. Check the config.xml" << std::endl;
    std::cout << "ZDC object created with " << GetChannelsVector().size() << " channel entries " << std::endl;
32
33
}

clantz's avatar
clantz committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/** @brief Destructor for ZDC.
 */
ZDC::~ZDC( ){

}

/** @brief Prints a map of the ZDC to the terminal
 *
 * Prints a "map" of the ZDC.
 * Displays one element with ZDC number on the top line, DRS4
 * Channel on the second line, and if the element is functioning on the
 * third line.
 * 
 */
void ZDC::PrintMap(){
49
        Channel *c = GetElement(0,m_Number);
clantz's avatar
clantz committed
50
	
51
        std::cout<<"|   "     << m_Number  <<"  |"<<std::endl;
clantz's avatar
clantz committed
52
53
54
55
	std::cout<<"|   "     << c->name <<"  |"<<std::endl;
	std::cout<<"|       |"<< std::endl;
	std::cout<<"|_______|"<< std::endl;

56
}