52{
53 MsgStream log(
msgSvc(), name());
54 log << MSG::INFO << " McTestAlg initialize()" << endreq;
55
56 if(m_particleRootFlag)
57 {
58 StatusCode sc;
59 NTuplePtr ntp(
ntupleSvc(),
"FILE900/particle");
60 if(ntp) tupleParticle = ntp;
61 else {
62 tupleParticle =
ntupleSvc()->book(
"FILE900/particle",CLID_ColumnWiseTuple,
"McTestAlg");
63 if(tupleParticle)
64 sc = tupleParticle->addItem("me",me);
65 }
66 }
67
68 if(m_mdcRootFlag)
69 {
70 StatusCode sc;
72 if(nt1) tupleMdc1 = nt1;
73 else {
74 tupleMdc1 =
ntupleSvc()->book(
"FILE901/n1",CLID_ColumnWiseTuple,
"McTestAlg");
75 if(tupleMdc1)
76 {
77 sc = tupleMdc1->addItem("truthIndex",truthMdcIndex);
78 sc = tupleMdc1->addItem("truthLayer",truthMdcLayer);
79 sc = tupleMdc1->addItem("truthWire",truthMdcWire);
80 sc = tupleMdc1->addItem("truthEdep",truthMdcEdep);
81 sc = tupleMdc1->addItem("truthDriftD",truthMdcDriftD);
82 sc = tupleMdc1->addItem("truthX",truthMdcX);
83 sc = tupleMdc1->addItem("truthY",truthMdcY);
84 sc = tupleMdc1->addItem("truthZ",truthMdcZ);
85 sc = tupleMdc1->addItem("ntruth",ntruthMdc);
86 }
87 else {
88 log << MSG::ERROR <<"Cannot book MDC N-tuple:" << long(tupleMdc1) << endmsg;
89 return StatusCode::FAILURE;
90 }
91 }
92
94 if(nt2) tupleMdc2 = nt2;
95 else {
96 tupleMdc2 =
ntupleSvc()->book(
"FILE901/n2",CLID_ColumnWiseTuple,
"McTestAlg");
97 if(tupleMdc2)
98 {
99 sc = tupleMdc2->addItem("layer",m_layer);
100 sc = tupleMdc2->addItem("cell",m_cell);
101 sc = tupleMdc2->addItem("ADC",m_charge);
102 sc = tupleMdc2->addItem("TDC",m_time);
103 }
104 }
105 }
106
107 if(m_tofRootFlag)
108 {
109 StatusCode sc;
111 if(nt) tupleTof = nt;
112 else {
113 tupleTof=
ntupleSvc()->book(
"FILE902/lr",CLID_ColumnWiseTuple,
"McTestAlg");
114 if(tupleTof)
115 {
116 sc = tupleTof->addItem("truthIndex",truthIndex);
117 sc = tupleTof->addItem("truthPartId",truthPartId);
118 sc = tupleTof->addItem("truthLayer",truthLayer);
119 sc = tupleTof->addItem("truthScinNb",truthScinNb);
120 sc = tupleTof->addItem("truthX",truthX);
121 sc = tupleTof->addItem("truthY",truthY);
122 sc = tupleTof->addItem("truthZ",truthZ);
123 sc = tupleTof->addItem("ntruth",ntruth);
124 sc = tupleTof->addItem("tleft",tleft);
125 sc = tupleTof->addItem("tright",tright);
126 sc = tupleTof->addItem("qleft",qleft);
127 sc = tupleTof->addItem("qright",qright);
128 }
129 else {
130 log << MSG::ERROR <<"Cannot book N-tuple:" << long(tupleTof) << endmsg;
131 return StatusCode::FAILURE;
132 }
133 }
134 }
135 return StatusCode::SUCCESS;
136}