Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BbcPmtInfoContainerV1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BbcPmtInfoContainerV1.cc
2 #include "BbcPmtInfoV1.h"
3 #include "BbcDefs.h"
4 
5 #include <phool/PHObject.h>
6 #include <phool/phool.h>
7 
8 #include <TClonesArray.h>
9 
10 #include <cassert>
11 
12 
14  : _detector( DETECTOR::MBD )
15 {
16  const int nchannels = BbcDefs::BBC_N_PMT;
17  _clones = new TClonesArray("BbcPmtInfoV1", nchannels);
18  _clones->SetOwner();
19  _clones->SetName("BbcPmtInfoContainerV1");
20  for (int ipmt = 0; ipmt < nchannels; ipmt++)
21  {
22  // as tower numbers are fixed per event
23  // construct towers once per run, and clear the towers for first use
24  _clones->ConstructedAt( ipmt );
25  }
26 }
27 
29 {
30  delete _clones;
31 }
32 
34 {
35  // clear content of towers in the container for the next event
36  //_clones->Clear();
37  for (int ipmt = 0; ipmt < BbcDefs::BBC_N_PMT; ipmt++)
38  {
39  _clones->ConstructedAt( ipmt )->Clear();
40  }
41 }
42 
44 {
45  return (BbcPmtInfoV1*)_clones->ConstructedAt( pos );
46 }
47