21 const std::string&
name,
32 const std::string& entryTag)
40 const EventContext& ctx = Gaudi::Hive::currentContext();
41 unsigned int theRun = ctx.eventID().run_number();
42 unsigned int theEvent = ctx.eventID().event_number();
43 unsigned int theType = 0;
50 std::vector<std::string> theEventElements;
51 theEventElements.push_back(
"EventHeader");
52 theEventElements.push_back(
"(CaloCellContainer*)?");
53 theEventElements.push_back(
"(BeamWireChambers*)?");
54 theEventElements.push_back(
"(BeamProfileChambers*)?");
55 theEventElements.push_back(
"(BeamScintillators*)?");
56 theEventElements.push_back(
"(TailCatcher*)?");
57 theEventElements.push_back(
"(PatternUnit*)?");
59 std::vector<std::string> theEventAttr;
60 theEventAttr.push_back(
"name CDATA #REQUIRED");
64 std::vector<std::string> theHeaderElements;
68 std::vector<std::string> theHeaderAttr;
69 theHeaderAttr.push_back(
"name CDATA #REQUIRED");
70 theHeaderAttr.push_back(
"run CDATA #REQUIRED");
71 theHeaderAttr.push_back(
"event CDATA #REQUIRED");
72 theHeaderAttr.push_back(
"type CDATA #REQUIRED");
82 std::vector<std::string> anyData;
83 anyData.push_back(
"ANY");
85 std::vector<std::string> theCaloAttr;
86 theCaloAttr.push_back(
"name CDATA #REQUIRED");
87 theCaloAttr.push_back(
"ncols CDATA #REQUIRED");
88 theCaloAttr.push_back(
"nrows CDATA #REQUIRED");
89 theCaloAttr.push_back(
"idtype ( uint | int | short | ushort ) #REQUIRED");
90 theCaloAttr.push_back(
"etype ( float | double ) #REQUIRED");
91 this->
addAttributes(outStream,
"CaloCellContainer",theCaloAttr);
95 std::vector<std::string> theBPCAttr;
96 theBPCAttr.push_back(
"name CDATA #REQUIRED");
97 theBPCAttr.push_back(
"cols CDATA #REQUIRED");
98 theBPCAttr.push_back(
"idtype ( uint | int | short | ushort ) #REQUIRED");
99 theBPCAttr.push_back(
"xtype ( float | double ) #REQUIRED");
100 theBPCAttr.push_back(
"ytype ( float | double ) #REQUIRED");
104 std::vector<std::string> theMWPCAttr;
105 theMWPCAttr.push_back(
"name CDATA #REQUIRED");
106 theMWPCAttr.push_back(
"cols CDATA #REQUIRED");
107 theMWPCAttr.push_back(
"idtype ( uint | int | short | ushort ) #REQUIRED");
108 theMWPCAttr.push_back(
"xtype ( float | double ) #REQUIRED");
109 theMWPCAttr.push_back(
"ytype ( float | double ) #REQUIRED");
113 std::vector<std::string> theScintAttr;
114 theScintAttr.push_back(
"name CDATA #REQUIRED");
115 theScintAttr.push_back(
"cols CDATA #REQUIRED");
116 theScintAttr.push_back(
"idtype ( uint | int | short | ushort ) #REQUIRED");
117 theScintAttr.push_back(
"signal ( float | double ) #REQUIRED");
126 std::vector<std::string> theEventValues(theEventAttr.size());
127 for (
unsigned int i=0;
i<theEventAttr.size();
i++ )
129 if ( (theEventAttr[
i]).
find(
"name") != std::string::npos )
131 theEventValues[
i] =
"EventInfo";
134 theEventAttr[
i].substr(0,theEventAttr[
i].find_first_of(
" "));
136 this->
openElement(outStream,
"EventInfo",theEventAttr,theEventValues);
142 std::vector<std::string> theHeaderValues(theHeaderAttr.size());
143 for (
unsigned int i=0;
i<theHeaderAttr.size();
i++ )
145 if ( (theHeaderAttr[
i]).
find(
"name") != std::string::npos )
147 theHeaderValues[
i] =
"EventInfo";
149 else if ( (theHeaderAttr[
i]).
find(
"run") != std::string::npos )
151 std::ostringstream theValue; theValue <<
theRun << std::ends;
152 theHeaderValues[
i] = theValue.str();
154 else if ( (theHeaderAttr[
i]).
find(
"event") != std::string::npos )
156 std::ostringstream theValue; theValue << theEvent << std::ends;
157 theHeaderValues[
i] = theValue.str();
159 else if ( (theHeaderAttr[
i]).
find(
"type") != std::string::npos )
161 std::ostringstream theValue; theValue << theType << std::ends;
162 theHeaderValues[
i] = theValue.str();
166 theHeaderValues[
i] =
"unknown";
169 theHeaderAttr[
i].substr(0,theHeaderAttr[
i].find_first_of(
" "));
173 theHeaderAttr,theHeaderValues);
197 outStream << std::endl;
201 return StatusCode::SUCCESS;
208 return StatusCode::SUCCESS;