LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Operators.cc
Go to the documentation of this file.
1 // Operators for convenient printing of LCIO objects
4 
5 #include "UTIL/Operators.h"
6 #include "UTIL/LCObjectHandle.h"
7 #include "UTIL/LCTime.h"
8 #include "UTIL/CellIDDecoder.h"
9 #include "UTIL/PIDHandler.h"
10 #include "UTIL/LCTOOLS.h"
11 #include "UTIL/BitSet32.h"
12 
13 #include "EVENT/TPCHit.h"
14 #include "EVENT/TrackerRawData.h"
15 #include "EVENT/TrackerData.h"
16 #include "EVENT/TrackerPulse.h"
17 #include "EVENT/LCIO.h"
18 #include "EVENT/MCParticle.h"
19 #include "EVENT/LCFloatVec.h"
20 #include "EVENT/LCIntVec.h"
21 #include "EVENT/Track.h"
22 #include "EVENT/TrackState.h"
23 #include "EVENT/Cluster.h"
25 #include "EVENT/Vertex.h"
26 #include "EVENT/TrackerHit.h"
27 #include "EVENT/TrackerHitPlane.h"
29 #include "EVENT/SimTrackerHit.h"
30 #include "EVENT/LCGenericObject.h"
31 #include "EVENT/LCRelation.h"
32 #include "EVENT/LCEvent.h"
33 
34 //#include "IMPL/LCFlagImpl.h"
35 #include "LCIOSTLTypes.h"
36 
37 #include <map>
38 #include <set>
39 #include <cstdio>
40 #include <sstream>
41 
43 
44 using namespace std ;
45 using namespace EVENT ;
46 using namespace IMPL ;
47 
48 
49 namespace UTIL{
50 
51  /*
52  // EXP: INDEX MAP - UNDER DEVELOPMENT
53 
54  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Vertex, EVENT::LCCollection>& sV){
55  const EVENT::Vertex* v = sV.obj;
56  const EVENT::LCCollection* col = sV.cobj;
57 
58  //TODO: PROBLEM HERE!!!
59  UTIL::IndexMap im(col,"AlgorithmNames","AlgorithmTypes");
60 
61  out << setfill('0');
62  out << " [" << setw(8) << dec << v->id() << "] | " << v->isPrimary()<< " | ";
63  out << setfill(' ') << setw(17) << left << im.decode( v->getAlgorithmType() ) << " | ";
64 
65  out << setfill('0') << right << scientific << setprecision(3) << v->getChi2() << " | " << v->getProbability() << " | " <<
66  v->getPosition()[0] << "," <<
67  v->getPosition()[1] << "," <<
68  v->getPosition()[2] << " | [" ;
69 
70  // for(int i=0;i<VTXCOVMATRIX;i++)
71  // out << v->getCovMatrix()[i] << (i<(VTXCOVMATRIX-1)?",":" | [");
72  out << setw(3) << v->getParameters().size() << "] | [";
73  out << setw(8) << hex << (v->getAssociatedParticle()!=NULL?v->getAssociatedParticle()->id():0) << "]\n";
74 
75  return out;
76 
77  }
78  */
79 
80 
81 
82 
83  //============================================================================
84  // # LCCollection
85  //============================================================================
86 
87  const std::string& header(const EVENT::LCCollection *){ //hauke
88  static const std::string _h("| Number of elements | Type name | Flag | Is transient | Is default | Is subset |\n");
89  return _h;
90  }
91 
92  const std::string& tail(const EVENT::LCCollection *){ //hauke
93  static const std::string _t("|--------------------|-----------|-------------|--------------|------------|-----------|\n");
94  return _t;
95  }
96 
97  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCCollection>& sV){ //hauke
98  const EVENT::LCCollection* hit = sV.obj;
99  out << noshowpos;
100  out << "|" << dec << setw(20) << setfill(' ') << hit->getNumberOfElements();
101  out << "|" << dec << setw(11) << setfill(' ') << hit->getTypeName();
102  out << "|" << hex << setw(13) << setfill(' ') << hit->getFlag();
103  out << "|" << dec << setw(14) << setfill(' ') << hit->isTransient();
104  out << "|" << dec << setw(12) << setfill(' ') << hit->isDefault();
105  out << "|" << dec << setw(11) << setfill(' ') << hit->isSubset() << "|" << endl;
106  return out;
107  }
108 
109  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCCollection> l) { //hauke
110  const EVENT::LCCollection *hit = l.object();
111  const EVENT::LCCollection *col = l.collection();
112 
113  stringstream sstream;
114 
115  out << noshowpos;
116  out << setw(41) << setfill('-') << right << " LCCollection " << setfill('-') << setw(29) << "-" << endl;
117 
118  if(col != NULL){
119  if(col->getTypeName() != LCIO::LCCOLLECTION){
120  out << "Warning: collection not of type " << LCIO::LCCOLLECTION << endl ;
121  return(out);
122 
123  }
124  //print collection flags
125  }
126 
127  //print object attributs
128  out << setw(30) << setfill(' ') << left << "Number of elements" << right << setw(40)<< dec << hit->getNumberOfElements() << endl;
129  out << setw(30) << setfill(' ') << left << "Type name"<< setfill(' ') << right << setw(40) << hit->getTypeName() << endl;
130  out << setw(30) << setfill(' ') << left << "Flag"<< setfill(' ') << right << setw(40) << hex << hit->getFlag() << endl;
131  out << setw(30) << setfill(' ') << left << "Is transient"<< setfill(' ') << right << setw(40) << dec << hit->isTransient() << endl;
132  out << setw(30) << setfill(' ') << left << "Is default"<< setfill(' ') << right << setw(40) << hit->isDefault() << endl;
133  out << setw(30) << setfill(' ') << left << "Is subset"<< setfill(' ') << right << setw(40) << hit->isSubset() << endl;
134  return out;
135  }
136 
137 
138  //============================================================================
139  // # LCEvent
140  //============================================================================
141 
142  const std::string& header(const EVENT::LCEvent *){ //hauke
143  static const std::string _h("| Run number |Event number |Detector name| Time stamp | Weight |\n");
144  return _h;
145  }
146 
147  const std::string& tail(const EVENT::LCEvent *){ //hauke
148  static const std::string _t("|-------------|-------------|-------------|-------------|-------------|\n");
149  return _t;
150  }
151 
152  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCEvent>& sV){ //hauke
153  const EVENT::LCEvent* hit = sV.obj;
154  out << noshowpos;
155  out << "|" << dec << setw(13) << setfill(' ') << hit->getRunNumber();
156  out << "|" << dec << setw(13) << setfill(' ') << hit->getEventNumber();
157  out << "|" << dec << setw(13) << setfill(' ') << hit->getDetectorName();
158  out << "|" << dec << setw(13) << setfill(' ') << hit->getTimeStamp();
159  out << "|" << dec << setw(13) << setfill(' ') << hit->getWeight() << "|" << endl;
160  return out;
161  }
162 
163 
164  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCEvent> l) { //hauke
165  const EVENT::LCEvent *hit = l.object();
166  const EVENT::LCCollection *col = l.collection();
167 
168  stringstream sstream;
169 
170  out << noshowpos;
171  out << setw(41) << setfill('-') << right << " LCEvent " << setfill('-') << setw(29) << "-" << endl;
172 
173  if(col != NULL){
174  if(col->getTypeName() != LCIO::LCEVENT){
175  out << "Warning: collection not of type " << LCIO::LCEVENT << endl ;
176  return(out);
177 
178  }
179  //print collection flags
180  }
181 
182  //print object attributs
183  //sstream << dec << hit->id();
184  out << setw(30) << setfill(' ') << left << "Run number" << right << setw(40) << dec << hit->getRunNumber() << endl;
185  out << setw(30) << setfill(' ') << left << "Event number"<< setfill(' ') << right << setw(40) << dec << hit->getEventNumber() << endl;
186  out << setw(30) << setfill(' ') << left << "Detector name"<< setfill(' ') << right << setw(40) << hit->getDetectorName() << endl;
187  out << setw(30) << setfill(' ') << left << "Time stamp"<< setfill(' ') << right << setw(40) << hit->getTimeStamp() << endl;
188  out << setw(30) << setfill(' ') << left << "Weight"<< setfill(' ') << right << setw(40) << hit->getWeight() << endl;
189 
190  out << setw(30) << setfill(' ') << left << "Collection Names" << endl;
191  const std::vector< std::string >* strVec = hit->getCollectionNames() ;
192  for(std::vector< std::string >::const_iterator name = strVec->begin() ; name != strVec->end() ; name++){
193  out << " " << "Name: " << setw(20) << left << *name;
194  out << " Type: " << left << setw(10) << hit->getCollection( *name )->getTypeName();
195  out << " Number of Elements: "<< left << setw(20) << hit->getCollection( *name )->getNumberOfElements() << endl;
196  }
197  return out;
198  }
199 
200 
201  //============================================================================
202  // # LCFlag
203  //============================================================================
204 
205  const std::string& header(const EVENT::LCFlag *){ //hauke
206  static const std::string _h("| Flag |");
207  return _h;
208  }
209 
210  const std::string& tail(const EVENT::LCFlag *){ //hauke
211  static const std::string _t("|------------|\n");
212  return _t;
213  }
214 
215  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCFlag>& sV){ //hauke
216  const EVENT::LCFlag* hit = sV.obj;
217  out << noshowpos;
218  out << "|" << hex << setw(8) << setfill(' ') << hit->getFlag() << "|" << endl;
219  return out;
220  }
221 
222  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCFlag> l) { //hauke
223  const EVENT::LCFlag *hit = l.object();
224  const EVENT::LCCollection *col = l.collection();
225 
226  stringstream sstream;
227 
228  out << noshowpos;
229  out << setw(41) << setfill('-') << right << " LCFlag " << setfill('-') << setw(29) << "-" << endl;
230 
231  if(col != NULL){
232  // if(col->getTypeName() != LCIO::LCFLAG){
233  // out << "Warning: collection not of type " << LCIO::LCFLAG << endl ;
234  // return(out);
235  // }
236  //not part of lcio?
237  //print collection flags
238  }
239 
240  //print object attributs
241  out << setw(30) << setfill(' ') << left << "Flag" << right << hex << setw(40) << hit->getFlag() << dec << endl;
242  return out;
243  }
244 
245  //============================================================================
246  // # LCGenericObject
247  //============================================================================
248 
249  const std::string& header(const EVENT::LCGenericObject* /*obj*/, const EVENT::LCCollection *col){ //hauke
250  //const EVENT::LCCollection *col = &v;
251  bool isFixedSize = BitSet32( col->getFlag() ).test( LCIO::GOBIT_FIXED);
253  header.str("");
254 
255  header << " [ id ] ";
256  if(col != NULL){
257  header << col->getParameters().getStringVal("DataDescription");
258  header << " - isFixedSize: " << ( isFixedSize ? "true" : "false" );
259  header << endl;
260  }else{
261  header << " Data.... ";
262  header << endl;
263  }
264  static const std::string _t(header.str());
265  return _t;
266  }
267 
268  const std::string& tail(const EVENT::LCGenericObject *){ //hauke
269  static const std::string _t(" --------------------------------------------------------\n");
270  return _t;
271  }
272 
273  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCGenericObject>& sV){ //hauke
274  const EVENT::LCGenericObject* obj = sV.obj;
275  out << noshowpos;
276  out << " [" << dec << setw(8) << setfill('0') << obj->id() << "] ";
277  out << setfill(' ') << dec;
278  for(int j=0;j<obj->getNInt();j++){
279  out << "i:" << obj->getIntVal( j ) << "; " ;
280  }
281  for(int j=0;j<obj->getNFloat();j++){
282  out << "f:" << obj->getFloatVal( j ) << "; " ;
283  }
284  for(int j=0;j<obj->getNDouble();j++){
285  out << "d:" << obj->getDoubleVal( j ) << "; " ;
286  }
287  return out;
288  }
289 
290 
291  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCGenericObject> l) { //hauke
292  const EVENT::LCGenericObject *hit = l.object();
293  const EVENT::LCCollection *col = l.collection();
294 
295  stringstream sstream;
296 
297  out << noshowpos;
298  out << setw(41) << setfill('-') << right << " LCGenericObject " << setfill('-') << setw(29) << "-" << endl;
299 
300  if(col != NULL){
301  if(col->getTypeName() != LCIO::LCGENERICOBJECT){
302  out << "Warning: collection not of type " << LCIO::LCGENERICOBJECT << endl ;
303  return(out);
304 
305  }
306  //print collection flags
307  }
308 
309  //print object attributs
310  sstream << dec << hit->id();
311  out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
312  out << setw(30) << setfill(' ') << left << "Number of integer values"<< setfill(' ') << right << setw(40) << hit->getNInt() << endl;
313  out << setw(30) << setfill(' ') << left << "Number of float values"<< setfill(' ') << right << setw(40) << hit->getNDouble() << endl;
314  out << setw(30) << setfill(' ') << left << "Type name"<< setfill(' ') << right << setw(40) << hit->getTypeName() << endl;
315  out << setw(30) << setfill(' ') << left << "Description"<< setfill(' ') << right << setw(40) << hit->getDataDescription() << endl;
316  return out;
317  }
318 
319  //============================================================================
320  // # LCIntVec
321  //============================================================================
322 
323  const std::string& header(const EVENT::LCIntVec *){ //hauke
324  static const std::string _h("| [ id ] | val0, val1, ...\n");
325  return _h;
326  }
327 
328  const std::string& tail(const EVENT::LCIntVec *){ //hauke
329  static const std::string _t("|------------|----------------\n");
330  return _t;
331  }
332 
333  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCIntVec>& sV){ //hauke
334  const EVENT::LCIntVec* vec = sV.obj;
335  out << noshowpos;
336  out << "| [" << setfill('0') << setw(8) << dec << vec->id() << "] |";
337  for(unsigned int j=0;j< vec->size();j++){
338  out << setfill(' ') << right << setw(8) << (*vec)[j];
339  if( j<vec->size()-1){
340  out << ", ";
341  }
342  if( ! ( (j+1) % 10) ){
343  out << endl << " ";
344  }
345  }
346  out << endl;
347 
348  return out;
349  }
350 
351  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCIntVec> l) { //hauke
352  const EVENT::LCIntVec *hit = l.object();
353  const EVENT::LCCollection *col = l.collection();
354 
355  stringstream sstream;
356 
357  out << noshowpos;
358  out << setw(41) << setfill('-') << right << " LCIntVec " << setfill('-') << setw(29) << "-" << endl;
359 
360  if(col != NULL){
361  if(col->getTypeName() != LCIO::LCINTVEC){
362  out << "Warning: collection not of type " << LCIO::LCINTVEC << endl ;
363  return(out);
364 
365  }
366  //print collection flags
367  }
368 
369  //print object attributs
370  sstream << dec << hit->id();
371  out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
372  return out;
373  }
374 
375 
376  //============================================================================
377  // # LCFloatVec
378  //============================================================================
379 
381  static const std::string _h(" [ id ] | val0, val1, ...\n");
382  //_h+=tail(v);
383  return _h;
384  }
385 
387  static const std::string _t("------------|------------------\n");
388  return _t;
389  }
390 
391  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCFloatVec>& sV){
392  const EVENT::LCFloatVec* vec = sV.obj;
393  out << noshowpos;
394  out << " [" << setfill('0') << setw(8) << dec << vec->id() << "] |";
395  for(unsigned int j=0;j< vec->size();j++){
396  out << setfill(' ') << right << setw(8) << (*vec)[j];
397  if( j<vec->size()-1){
398  out << ", ";
399  }
400  if( ! ( (j+1) % 10) ){
401  out << endl << " ";
402  }
403  }
404  out << endl;
405 
406  return out;
407  }
408 
409  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCFloatVec> ll){
410  const EVENT::LCFloatVec *v = ll.object();
411  const EVENT::LCCollection *col = ll.collection();
412 
413  stringstream tmp;
414  out << noshowpos;
415 
416  out << setw(41) << std::setfill('-') << right << " LCFloatVec " << setfill('-') << setw(29) << "-" << endl;
417  if(col != NULL){
418  if(col->getTypeName() != LCIO::LCFLOATVEC){
419  out << "Warning: collection not of type " << LCIO::LCFLOATVEC << endl ;
420  return(out);
421  }
422  }
423  tmp.str("");
424  tmp << dec << v->id() << dec;
425  out << setw(30) << setfill(' ') << left << "Id" << right << tmp.str() << endl;
426 
427  return out;
428  }
429 
430  //============================================================================
431  // # LCStrVec
432  //============================================================================
433 
434  /*
435  const std::string& header(const EVENT::LCStrVec &){ //hauke
436  static std::string _h("");
437  return _h;
438  }
439 
440  const std::string& tail(const EVENT::LCStrVec &){ //hauke
441  static std::string _t("\n");
442  return _t;
443  }
444 
445  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCStrVec>& sV){ //hauke
446  const EVENT::LCStrVec* hit = sV.obj;
447  out << noshowpos;
448  out << " [" << dec << setw(8) << setfill('0');// << hit->id() << "] ";
449  }
450 
451 
452 
453  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCStrVec> l) { //hauke
454  const EVENT::LCStrVec *hit = l.object();
455  const EVENT::LCCollection *col = l.collection();
456 
457  stringstream sstream;
458 
459  out << noshowpos;
460  out << setw(41) << setfill('-') << right << " LCStrVec " << setfill('-') << setw(29) << "-" << endl;
461 
462  if(col != NULL){
463  if(col->getTypeName() != LCIO::LCSTRVEC){
464  out << "Warning: collection not of type " << LCIO::LCSTRVEC << endl ;
465  return(out);
466 
467  }
468  //print collection flags
469  }
470 
471  //print object attributs
472  sstream << dec << hit->id();
473  out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
474  out << setw(30) << setfill(' ') << left << "Type"<< setfill(' ') << right << setw(40) << hit->getType() << endl;
475  out << setw(30) << left << "Energy [GeV]" << right << setw(40) << hit->getEnergy() << endl;
476  }
477 
478  std::ostream& operator<<( std::ostream& out, const EVENT::LCStrVec &hit){
479  out<<lcio_long(hit,NULL);
480  return out;
481  }
482  */
483 
484 
485 
486 
487  //============================================================================
488  // # LCObject
489  //============================================================================
490 
491  const std::string& header(const EVENT::LCObject *){ //hauke
492  static const std::string _h(" [ Id ] \n");
493  return _h;
494  }
495 
496  const std::string& tail(const EVENT::LCObject *){ //hauke
497  static const std::string _t("-----------\n");
498  return _t;
499  }
500 
501  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCObject>& sV){ //hauke
502  const EVENT::LCObject* hit = sV.obj;
503  out << noshowpos;
504  out << " [" << dec << setw(8) << setfill('0') << hit->id() << "] ";
505  return out;
506  }
507 
508  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCObject> l) { //hauke
509  const EVENT::LCObject *hit = l.object();
510  const EVENT::LCCollection *col = l.collection();
511 
512  stringstream sstream;
513 
514  out << noshowpos;
515  out << setw(41) << setfill('-') << right << " LCObject " << setfill('-') << setw(29) << "-" << endl;
516 
517  if(col != NULL){
518  //if(col->getTypeName() != LCIO::LCOBJECT){
519  // out << "Warning: collection not of type " << LCIO::LCOBJECT << endl ;
520  // return(out);
521  //}
522  //not part of lcio?
523 
524  //print collection flags
525  }
526 
527  //print object attributs
528  sstream << dec << hit->id();
529  out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
530  return out;
531  }
532 
533  //============================================================================
534  // # LCParameters
535  //============================================================================
536 
537  const std::string& header(const EVENT::LCParameters *){ //hauke
538  static const std::string _h("-----\n");
539  return _h;
540  }
541 
542  const std::string& tail(const EVENT::LCParameters *){ //hauke
543  static const std::string _t("-----\n");
544  return _t;
545  }
546 
547  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCParameters>& /*sV*/){ //hauke
548  out << noshowpos;
549  out << "| " << hex << setw(8) << setfill(' ')<< " |";
550  return out;
551  }
552 
553  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCParameters> l) { //hauke
554  //const EVENT::LCParameters *params = l.object();
555  const EVENT::LCCollection *col = l.collection();
556 
557  stringstream sstream;
558 
559  out << noshowpos;
560  out << setw(41) << setfill('-') << right << " LCParameters " << setfill('-') << setw(29) << "-" << endl;
561 
562  if(col != NULL){
563  //if(col->getTypeName() != LCIO::LCPARAMETERS){
564  // out << "Warning: collection not of type " << LCIO::LCPARAMETERS << endl ;
565  // return(out);
566  //}
567  //not part of LCIO?
568 
569  //print collection flags
570 
571  }
572 
573 
574  // from lctools
575  /*
576  StringVec intKeys ;
577  int nIntParameters = params.getIntKeys( intKeys ).size() ;
578  for(int i=0; i< nIntParameters ; i++ ){
579  IntVec intVec ;
580  params.getIntVals( intKeys[i], intVec ) ;
581  int nInt = intVec.size() ;
582  out << " parameter " << intKeys[i] << " [int]: " ;
583 
584  if( nInt == 0 ){
585  out << " [empty] " << std::endl ;
586  }
587  for(int j=0; j< nInt ; j++ ){
588  out << intVec[j] << ", " ;
589  }
590  out << endl ;
591  }
592  StringVec floatKeys ;
593  int nFloatParameters = params.getFloatKeys( floatKeys ).size() ;
594  for(int i=0; i< nFloatParameters ; i++ ){
595  FloatVec floatVec ;
596  params.getFloatVals( floatKeys[i], floatVec ) ;
597  int nFloat = floatVec.size() ;
598  out << " parameter " << floatKeys[i] << " [float]: " ;
599  if( nFloat == 0 ){
600  out << " [empty] " << std::endl ;
601  }
602  for(int j=0; j< nFloat ; j++ ){
603  out << floatVec[j] << ", " ;
604  }
605  out << endl ;
606  }
607  StringVec stringKeys ;
608  int nStringParameters = params.getStringKeys( stringKeys ).size() ;
609  for(int i=0; i< nStringParameters ; i++ ){
610  StringVec stringVec ;
611  params.getStringVals( stringKeys[i], stringVec ) ;
612  int nString = stringVec.size() ;
613  out << " parameter " << stringKeys[i] << " [string]: " ;
614  if( nString == 0 ){
615  out << " [empty] " << std::endl ;
616  }
617  for(int j=0; j< nString ; j++ ){
618  out << stringVec[j] << ", " ;
619  }
620  out << endl ;
621  }
622  */
623  // end
624 
625  //sstream << dec << hit->id();
626  //out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
627  //out << setw(30) << setfill(' ') << left << "Type"<< setfill(' ') << right << setw(40) << hit->getType() << endl;
628  //out << setw(30) << left << "Energy [GeV]" << right << setw(40) << hit->getEnergy() << endl;
629  return out;
630 
631  }
632 
633  //============================================================================
634  // # LCRelation
635  //============================================================================
636 
638  static const std::string _h("| [from_id ] | [ to_id ] | Weight |\n");
639  return _h;
640  }
641 
643  static const std::string _t("|------------|------------|---------|\n");
644  return _t;
645  }
646 
647  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCRelation>& sV){
648  const EVENT::LCRelation* v = sV.obj;
649  out << noshowpos << setfill('0');
650  out << "| [" << setw(8) << dec << ( v->getFrom() ? v->getFrom()->id() : 0 ) << "] |";
651  out << " [" << setw(8) << dec << ( v->getTo() ? v->getTo()->id() : 0 ) << "] |";
652  out << " " << setw(8) << dec << v->getWeight() << "|";
653  out << setfill(' ');
654  out << endl;
655  return out;
656  }
657 
658  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCRelation> ll){
659  const EVENT::LCRelation *v = ll.object();
660  const EVENT::LCCollection *col = ll.collection();
661 
662  stringstream tmp;
663  out << noshowpos;
664 
665  out << setw(41) << std::setfill('-') << right << " LCRelation " << setfill('-') << setw(29) << "-" << endl;
666  if(col != NULL){
667  if(col->getTypeName() != LCIO::LCRELATION){
668  out << "Warning: collection not of type " << LCIO::LCRELATION << endl ;
669  return(out);
670  }
671  }
672 
673  out << setw(30) << setfill(' ') << left << "From [id]" << right << dec << ( v->getFrom() ? v->getFrom()->id() : 0 ) << endl;
674  out << setw(30) << setfill(' ') << left << "To [id]" << right << ( v->getTo() ? v->getTo()->id() : 0 ) << endl;
675  out << setw(30) << setfill(' ') << left << "Weight" << right << v->getWeight() << endl;
676 
677  return out;
678  }
679 
680  //============================================================================
681  // # LCRunHeader
682  //============================================================================
683 
684  const std::string& header(const EVENT::LCRunHeader *){ //hauke
685  static const std::string _h(" [ Run number ] | Detector name | Description | Parameters |\n");
686  return _h;
687  }
688 
689  const std::string& tail(const EVENT::LCRunHeader *){ //hauke
690  static const std::string _t("----------------|---------------|-------------|------------|\n");
691  return _t;
692  }
693 
694  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCRunHeader>& sV){ //hauke
695  const EVENT::LCRunHeader* hit = sV.obj;
696  out << noshowpos;
697  out << " [" << dec << setw(8) << setfill('0') << hit->getRunNumber() << "] ";
698  out << "|" << dec << setw(8) << setfill(' ') << hit->getDetectorName();
699  out << "|" << dec << setw(8) << setfill(' ') << hit->getDescription();
700  out << "|" << dec << setw(8) << setfill(' ') << hit->getParameters() << "|" << endl;
701  return out;
702  }
703 
704  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCRunHeader> l) { //hauke
705  const EVENT::LCRunHeader *hit = l.object();
706  const EVENT::LCCollection *col = l.collection();
707 
708  stringstream sstream;
709 
710  out << noshowpos;
711  out << setw(41) << setfill('-') << right << " LCRunHeader " << setfill('-') << setw(29) << "-" << endl;
712 
713  if(col != NULL){
714  if(col->getTypeName() != LCIO::LCRUNHEADER){
715  out << "Warning: collection not of type " << LCIO::LCRUNHEADER << endl ;
716  return(out);
717 
718  }
719  //print collection flags
720  }
721 
722  //print object attributs
723  sstream << dec << hit->id();
724  out << setw(30) << setfill(' ') << left << "Run number"<< setfill(' ') << right << setw(40) << dec << hit->getRunNumber() <<dec << endl;
725  out << setw(30) << setfill(' ') << left << "Detector name"<< setfill(' ') << right << setw(40) << dec << hit->getDetectorName() <<dec << endl;
726  out << setw(30) << setfill(' ') << left << "Description"<< setfill(' ') << right << setw(40) << dec << hit->getDescription() <<dec << endl;
727  out << setw(30) << setfill(' ') << left << "Parameters"<< setfill(' ') << right << setw(40) << dec << hit->getParameters() <<dec << endl;
728  return out;
729  }
730 
731  //============================================================================
732  // # LCIO
733  //============================================================================
734 
735  const std::string& header(const EVENT::LCIO *){ //hauke
736  static const std::string _h("-------------------");
737  return _h;
738  }
739 
740  const std::string& tail(const EVENT::LCIO *){ //hauke
741  static const std::string _t("-------------------\n");
742  return _t;
743  }
744 
745  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCIO>& /*sV*/){ //hauke
746  out << noshowpos;
747  out << " " << endl;
748  return out;
749  }
750 
751  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCIO> l) { //hauke
752  //const EVENT::LCIO *hit = l.object();
753  const EVENT::LCCollection *col = l.collection();
754 
755  stringstream sstream;
756 
757  out << noshowpos;
758  out << setw(41) << setfill('-') << right << " LCIO " << setfill('-') << setw(29) << "-" << endl;
759 
760  if(col != NULL){
761  //if(col->getTypeName() != LCIO::LCIO){
762  // out << "Warning: collection not of type " << LCIO::LCIO << endl ;
763  // return(out);
764  //}
765  //???
766 
767  //print collection flags
768  }
769 
770  //print object attributs
771  return out;
772  }
773 
774  //============================================================================
775  // # ParticleID
776  //============================================================================
777 
778  const std::string& header(const EVENT::ParticleID *){ //hauke
779  static const std::string _h("| Type | PDG | Likelihood |Algorithm type|");
780  return _h;
781  }
782 
783  const std::string& tail(const EVENT::ParticleID *){ //hauke
784  static const std::string _t("\n");
785  return _t;
786  }
787 
788  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::ParticleID>& sV){ //hauke
789  const EVENT::ParticleID* hit = sV.obj;
790  out << noshowpos;
791  out << "|" << dec << setw(10) << setfill(' ') << hit->getType();
792  out << "|" << dec << setw(10) << setfill(' ') << hit->getPDG();
793  out << "|" << dec << setw(12) << setfill(' ') << hit->getLikelihood();
794  out << "|" << dec << setw(14) << setfill(' ') << hit->getAlgorithmType();
795  return out;
796  }
797 
798  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::ParticleID> l) { //hauke
799  const EVENT::ParticleID *hit = l.object();
800  const EVENT::LCCollection *col = l.collection();
801 
802  stringstream sstream;
803 
804  out << noshowpos;
805  out << setw(41) << setfill('-') << right << " ParticleID " << setfill('-') << setw(29) << "-" << endl;
806 
807  if(col != NULL){
808  if(col->getTypeName() != LCIO::PARTICLEID){
809  out << "Warning: collection not of type " << LCIO::PARTICLEID << endl ;
810  return(out);
811 
812  }
813  //print collection flags
814  }
815 
816  //print object attributs
817  out << setw(30) << setfill(' ') << left << "Type"<< setfill(' ') << right << setw(40) << dec << hit->getType() << endl;
818  out << setw(30) << setfill(' ') << left << "PDG"<< setfill(' ') << right << setw(40) << dec << hit->getPDG() << endl;
819  out << setw(30) << setfill(' ') << left << "Likelihood "<< setfill(' ') << right << setw(40) << dec << hit->getLikelihood() << endl;
820  out << setw(30) << setfill(' ') << left << "Algorithm type"<< setfill(' ') << right << setw(40) << dec << hit->getAlgorithmType() << endl;
821  return out;
822  }
823 
824  //============================================================================
825  // # RawCalorimeterHit
826  //============================================================================
827 
828  const std::string& header(const EVENT::RawCalorimeterHit *){ //hauke
829  static const std::string _h(" [ id ] | cellId0 ( M, S, I, J, K) | cellId1 | amplitude | time \n");
830  return _h;
831  }
832 
833  const std::string& tail(const EVENT::RawCalorimeterHit *){ //hauke
834  static const std::string _t("------------|---------------------------|----------|-----------|-------\n");
835  return _t;
836  }
837 
838  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::RawCalorimeterHit>& sV){ //hauke
839  const EVENT::RawCalorimeterHit* hit = sV.obj;
840  const EVENT::LCCollection *col = sV.col;
841 
842  out << noshowpos;
843  out << " [" << setw(8) << setfill('0') << dec << hit->id();
844  out << "| " << dec << setw(8) << setfill('0') << hit->getCellID0();
845  out << "| " << dec << setw(8) << setfill('0') << hit->getCellID1();
846  out << "|" << dec << setw(11) << setfill(' ') << hit->getAmplitude();
847  out << "|" << dec << setw(11) << setfill(' ') << hit->getTimeStamp() << "|" << endl;
848 
849  if(col->getParameters().getStringVal(LCIO::CellIDEncoding) != ""){
851  // out << endl << " id-fields: ("<< id(const_cast<EVENT::RawCalorimeterHit*>(hit)).valueString() << ")" << std::endl ;
852  out << endl << " id-fields: ("<< id(hit).valueString() << ")" << std::endl ;
853 
854  } else{
855  out << endl << " id-fields: --- unknown/default ---- ";
856  }
857 
858  return out;
859  }
860 
861  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::RawCalorimeterHit> l) { //hauke
862  const EVENT::RawCalorimeterHit *hit = l.object();
863  const EVENT::LCCollection *col = l.collection();
864 
865  stringstream sstream;
866 
867  out << noshowpos;
868  out << setw(41) << setfill('-') << right << " RawCalorimeterHit " << setfill('-') << setw(29) << "-" << endl;
869 
870  if(col != NULL){
871  if(col->getTypeName() != LCIO::RAWCALORIMETERHIT){
872  out << "Warning: collection not of type " << LCIO::RAWCALORIMETERHIT << endl ;
873  return(out);
874  }
875  BitSet32 flag( col->getFlag() ) ;
876  out << " LCIO::RCHBIT_ID1 : " << flag.test( LCIO::RCHBIT_ID1 ) << endl ;
877  out << " LCIO::RCHBIT_TIME : " << flag.test( LCIO::RCHBIT_TIME ) << endl ;
878  out << " LCIO::RCHBIT_NO_PTR : " << flag.test( LCIO::RCHBIT_NO_PTR ) << endl ;
879  //print collection flags
880  }
881 
882  //print object attributs
883  out << setw(30) << setfill(' ') << left << "CellID0"<< setfill(' ') << right << setw(40) << dec << hit->getCellID0() << endl;
884  out << setw(30) << setfill(' ') << left << "CellID1"<< setfill(' ') << right << setw(40) << dec << hit->getCellID1() << endl;
885  out << setw(30) << setfill(' ') << left << "Amplitude"<< setfill(' ') << right << setw(40) << dec << hit->getAmplitude() << endl;
886  out << setw(30) << setfill(' ') << left << "TimeStamp"<< setfill(' ') << right << setw(40) << dec << hit->getTimeStamp() << endl;
887  return out;
888  }
889 
890  //============================================================================
891  // # TPCHit (deprecated)
892  //============================================================================
893 
894  /*
895  const std::string& header(const EVENT::TPCHit &){ //hauke
896  static std::string _h("");
897  return _h;
898  }
899 
900  const std::string& tail(const EVENT::TPCHit &){ //hauke
901  static std::string _t("\n");
902  return _t;
903  }
904 
905  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TPCHit>& sV){ //hauke
906  const EVENT::TPCHit* hit = sV.obj;
907  out << noshowpos;
908  out << " [" << dec << setw(8) << setfill('0');// << hit->id() << "] ";
909  }
910 
911  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::TPCHit> l) {
912  const EVENT::TPCHit *hit = l.object();
913  const EVENT::LCCollection *col = l.collection();
914 
915  stringstream sstream;
916 
917  out << noshowpos;
918  out << setw(41) << setfill('-') << right << " TPCHit " << setfill('-') << setw(29) << "-" << endl;
919 
920  if(col != NULL){
921  if(col->getTypeName() != LCIO::TPCHIT){
922  out << "Warning: collection not of type " << LCIO::TPCHIT << endl ;
923  return(out);
924 
925  }
926  //print collection flags
927  }
928 
929  //print object attributs
930  //sstream << dec << hit->id();
931  //out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
932  //out << setw(30) << setfill(' ') << left << "Type"<< setfill(' ') << right << setw(40) << hit->getType() << endl;
933  //out << setw(30) << left << "Energy [GeV]" << right << setw(40) << hit->getEnergy() << endl;
934  }
935 
936  std::ostream& operator<<( std::ostream& out, const EVENT::TPCHit &hit){
937  out<<lcio_long(hit,NULL);
938  return out;
939  }
940  */
941 
942 
943 
944 
945  //============================================================================
946  // # TrackerData
947  //============================================================================
948 
949  const std::string& header(const EVENT::TrackerData *){ //hauke
950  static const std::string _h(" [ id ] | cellid0 | cellid1 | time | cellid-fields \n");
951  return _h;
952  }
953 
954  const std::string& tail(const EVENT::TrackerData *){ //hauke
955  static const std::string _t("------------|----------|----------|----------|----------------\n");
956  return _t;
957  }
958 
959  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerData>& sV){ //hauke
960  const EVENT::TrackerData* hit = sV.obj;
961  const EVENT::LCCollection* col = sV.col;
962 
963  out << noshowpos;
964  out << " [" << dec << setw(8) << setfill('0') << hit->id() << "] |";
965  out << " " << dec << setw(8) << setfill('0') << hit->getCellID0() << " |";
966  out << " " << dec << setw(8) << setfill('0') << hit->getCellID1() << " |";
967  out << " " << dec << setw(8) << setfill(' ') << hit->getTime() << " |";
968 
969  if(col->getParameters().getStringVal( LCIO::CellIDEncoding ) != ""){
971  out<< " " << id(const_cast<EVENT::TrackerData*>(hit)).valueString();
972  } else{
973  out << " --- unknown/default ---- ";
974  }
975 
976  out << "chargeADC : " ;
977  const FloatVec& charge = hit->getChargeValues() ;
978 
979  for( unsigned j=0 ; j < charge.size() ; j++ ){
980  out << charge[j] << "," ;
981  }
982 
983  out << endl;
984  return out;
985  }
986 
987  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::TrackerData> l) { //hauke
988  const EVENT::TrackerData *hit = l.object();
989  const EVENT::LCCollection *col = l.collection();
990 
991  stringstream sstream;
992 
993  out << noshowpos;
994  out << setw(41) << setfill('-') << right << " TrackerData " << setfill('-') << setw(29) << "-" << endl;
995 
996  if(col != NULL){
997  if(col->getTypeName() != LCIO::TRACKERDATA){
998  out << "Warning: collection not of type " << LCIO::TRACKERDATA << endl ;
999  return(out);
1000 
1001  }
1002  //print collection flags
1003  }
1004 
1005  //print object attributs
1006  out << setw(30) << setfill(' ') << left << "CellID0"<< setfill(' ') << right << setw(40) << dec << hit->getCellID0() << endl;
1007  out << setw(30) << setfill(' ') << left << "CellID1"<< setfill(' ') << right << setw(40) << dec << hit->getCellID1() << endl;
1008  out << setw(30) << setfill(' ') << left << "Time"<< setfill(' ') << right << setw(40) << dec << hit->getTime() << endl;
1009  return out;
1010  }
1011 
1012  //============================================================================
1013  // # TrackerPulse
1014  //============================================================================
1015 
1016  const std::string& header(const EVENT::TrackerPulse *){ //hauke
1017  static const std::string _h(" [ id ] | cellid0 | cellid1 | time | charge | quality |corr.Data | cellid-fields: | cov(c,c), cov(t,c), cov(t,t) \n");
1018  return _h;
1019  }
1020 
1021  const std::string& tail(const EVENT::TrackerPulse *){ //hauke
1022  static const std::string _t("------------|----------|----------|------|--------|----------|----------|----------------|------------------------------\n");
1023  return _t;
1024  }
1025 
1026  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerPulse>& sV){ //hauke
1027  const EVENT::TrackerPulse* hit = sV.obj;
1028  const EVENT::LCCollection* col = sV.col;
1029 
1030  out << noshowpos;
1031  out << " [" << dec << setw(8) << setfill('0') << hit->id() << "] |";
1032  out << " " << dec << setw(8) << setfill('0') << hit->getCellID0() << " |";
1033  out << " " << dec << setw(8) << setfill('0') << hit->getCellID1() << " |";
1034  out << dec << setw(6) << setfill(' ') << hit->getTime() << "|";
1035  out << dec << setw(8) << setfill(' ') << hit->getCharge() << "|";
1036  out << dec << setw(10) << setfill(' ') << hit->getQuality() << endl;
1037  TrackerData* corr = hit->getTrackerData() ;
1038  if( corr != 0 ){
1039  out << "|" << dec << setfill('0') << setw(10) << corr->id() << "]";
1040  }else{
1041  out << "|[" << dec << setfill('0') << setw(10) << '0' << "]";
1042  }
1043 
1044  if(col->getParameters().getStringVal( LCIO::CellIDEncoding ) != ""){
1046  out<< "|" << id(const_cast<EVENT::TrackerPulse*>(hit)).valueString() << "|";
1047  } else{
1048  out << "| --- unknown/default ---- |";
1049  }
1050 
1051 
1052 
1053  for( unsigned int j=0; j < hit->getCovMatrix().size(); j++ ){
1054  out << hit->getCovMatrix()[j] << ", ";
1055  }
1056 
1057  out << endl;
1058  return out;
1059  }
1060 
1061  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::TrackerPulse> l) {//hauke
1062  const EVENT::TrackerPulse *hit = l.object();
1063  const EVENT::LCCollection *col = l.collection();
1064 
1065  stringstream sstream;
1066 
1067  out << noshowpos;
1068  out << setw(41) << setfill('-') << right << " TrackerPulse " << setfill('-') << setw(29) << "-" << endl;
1069 
1070  if(col != NULL){
1071  if(col->getTypeName() != LCIO::TRACKERPULSE){
1072  out << "Warning: collection not of type " << LCIO::TRACKERPULSE << endl ;
1073  return(out);
1074  }
1075  //print collection flags
1076  BitSet32 flag( col->getFlag() ) ;
1077  out << " LCIO::TRAWBIT_ID1 : " << flag.test( LCIO::TRAWBIT_ID1 ) << endl ;
1078  }
1079 
1080  //print object attributs
1081  out << setw(30) << setfill(' ') << left << "CellID0"<< setfill(' ') << right << setw(40) << dec << hit->getCellID0() << endl;
1082  out << setw(30) << setfill(' ') << left << "CellID1"<< setfill(' ') << right << setw(40) << dec << hit->getCellID1() << endl;
1083  out << setw(30) << setfill(' ') << left << "Time"<< setfill(' ') << right << setw(40) << dec << hit->getTime() << endl;
1084  out << setw(30) << setfill(' ') << left << "Charge"<< setfill(' ') << right << setw(40) << dec << hit->getCharge() << endl;
1085  out << setw(30) << setfill(' ') << left << "Quality"<< setfill(' ') << right << setw(40) << dec << hit->getQuality() << endl;
1086  return out;
1087  }
1088 
1089  //============================================================================
1090  // # TrackerRawData
1091  //============================================================================
1092 
1093  const std::string& header(const EVENT::TrackerRawData *){ //hauke
1094  static const std::string _h(" [ id ] | cellid0 | cellid1 | time | cellid-fields \n");
1095  return _h;
1096  }
1097 
1098  const std::string& tail(const EVENT::TrackerRawData *){ //hauke
1099  static const std::string _t("------------|----------|----------|----------|----------------\n");
1100  return _t;
1101  }
1102 
1103  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerRawData>& sV){ //hauke
1104  const EVENT::TrackerRawData* hit = sV.obj;
1105  const EVENT::LCCollection* col = sV.col;
1106 
1107  out << noshowpos;
1108  out << " [" << dec << setw(8) << setfill('0') << hit->id() << "] |";
1109  out << " " << dec << setw(8) << setfill('0') << hit->getCellID0() << " |";
1110  out << " " << dec << setw(8) << setfill('0') << hit->getCellID1() << " |";
1111  out << " " << dec << setw(8) << setfill(' ') << hit->getTime() << " |";
1112 
1113  if(col->getParameters().getStringVal( LCIO::CellIDEncoding ) != ""){
1115  out<< " " << id(const_cast<EVENT::TrackerRawData*>(hit)).valueString();
1116  } else{
1117  out << " --- unknown/default ---- ";
1118  }
1119 
1120  out << " adc values: " ;
1121  const ShortVec& charge = hit->getADCValues() ;
1122  for( unsigned j=0 ; j < charge.size() ; j++ ) {
1123  out << charge[j] << "," ;
1124  }
1125 
1126  out << endl;
1127  return out;
1128  }
1129 
1130  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::TrackerRawData> l) { //hauke
1131  const EVENT::TrackerRawData *hit = l.object();
1132  const EVENT::LCCollection *col = l.collection();
1133 
1134  stringstream sstream;
1135 
1136  out << noshowpos;
1137  out << setw(41) << setfill('-') << right << " TrackerRawData " << setfill('-') << setw(29) << "-" << endl;
1138 
1139  if(col != NULL){
1140  if(col->getTypeName() != LCIO::TRACKERRAWDATA){
1141  out << "Warning: collection not of type " << LCIO::TRACKERRAWDATA << endl ;
1142  return(out);
1143 
1144  }
1145  //print collection flags
1146  }
1147 
1148  //print object attributs
1149  out << setw(30) << setfill(' ') << left << "CellID0"<< setfill(' ') << right << setw(40) << dec << hit->getCellID0() << endl;
1150  out << setw(30) << setfill(' ') << left << "CellID1"<< setfill(' ') << right << setw(40) << dec << hit->getCellID1() << endl;
1151  out << setw(30) << setfill(' ') << left << "Time"<< setfill(' ') << right << setw(40) << dec << hit->getTime() << endl;
1152  return out;
1153  }
1154 
1155  //============================================================================
1156  // # SimCalorimeterHit
1157  //============================================================================
1158 
1160  static const std::string _h(" [ id ] |cellId0 |cellId1 | energy | position (x,y,z) | nMCParticles \n -> MC contribution: prim. PDG | energy | time | length | sec. PDG | stepPosition (x,y,z) \n");
1161  return _h;
1162  }
1163 
1164  const std::string& tail(const EVENT::SimCalorimeterHit *){ //hauke
1165  static const std::string _t("------------|--------|--------|----------|----------------------------------|--------------\n");
1166  return _t;
1167  }
1168 
1169  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::SimCalorimeterHit>& sV){ //hauke
1170  const EVENT::SimCalorimeterHit* hit = sV.obj;
1171  const EVENT::LCCollection* col = sV.col;
1172  BitSet32 flag(col->getFlag());
1173 
1174  out << noshowpos;
1175  out << " [" << dec << setw(8) << setfill('0') << hit->id() << "] ";
1176  out << "|" << dec << setw(8) << setfill('0') << hit->getCellID0();
1177  out << "|" << dec << setw(8) << setfill('0') << hit->getCellID1();
1178  out << "|" << dec << setprecision(3) << scientific << showpos << hit->getEnergy();
1179  if(flag.test( LCIO::CHBIT_LONG )){
1180  out << "|" << dec << setprecision(3) << scientific << showpos
1181  << hit->getPosition()[0] << ", " << hit->getPosition()[1] << ", " << hit->getPosition()[2];
1182  }else{
1183  out << "| no position available ";
1184  }
1185  out << "|" << dec << setw(12) << setfill(' ') << hit->getNMCContributions() << endl;
1186 
1187 
1188  if(col->getParameters().getStringVal(LCIO::CellIDEncoding) != ""){
1190  out << " id-fields: ("<< id(const_cast<EVENT::SimCalorimeterHit*>(hit)).valueString() << ")" << std::endl ;
1191  } else{
1192  out << " id-fields: --- unknown/default ---- ";
1193  }
1194 
1195 
1196  for(int k=0;k < hit->getNMCContributions();k++){
1197  try{
1198  out << " ->" << setfill(' ') << right << " ";
1199  out << setw(11) << ( hit->getParticleCont(k) ? hit->getParticleCont(k)->getPDG() : 0 ) << "|";
1200  out << setw(10) << hit->getEnergyCont(k)<< "|";
1201  out << setw(6) << hit->getTimeCont(k) << "|";
1202 
1203  if(flag.test(LCIO::CHBIT_STEP)){
1204  out << hit->getLengthCont( k ) << "| (" ;
1205  out << hit->getPDGCont( k ) << ", " ;
1206  out << hit->getStepPosition( k )[0] << ", " ;
1207  out << hit->getStepPosition( k )[1] << ", " ;
1208  out << hit->getStepPosition( k )[2] << ")" ;
1209  }else{
1210  out << " no PDG";
1211  }
1212  }catch(exception& e){
1213  out << e.what() << endl ;
1214  }
1215  if(k < hit->getNMCContributions()-1 ){ out << endl; }
1216  }
1217 
1218  out << endl;
1219  out << noshowpos;
1220 
1221  return(out);
1222  }
1223 
1224  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::SimCalorimeterHit> ll){
1225  const EVENT::SimCalorimeterHit *hit = ll.object();
1226  const EVENT::LCCollection *col = ll.collection();
1227 
1228  stringstream tmp;
1229  //out << setprecision(5) << fixed;
1230 
1231  out << noshowpos;
1232  out << setw(46) << std::setfill('-') << right << " SimCalorimeterHit " << setfill('-') << setw(24) << "-" << endl;
1233 
1234  if(col != NULL){
1235  if(col->getTypeName() != LCIO::SIMCALORIMETERHIT){
1236  out << "Warning: collection not of type " << LCIO::SIMCALORIMETERHIT << endl ;
1237  return(out);
1238 
1239  }
1240  tmp.str("");
1241  tmp << "0x" << hex << col->getFlag() << dec;
1242  out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
1243  LCTOOLS::printParameters(col->getParameters());
1244 
1245  BitSet32 flag( col->getFlag() ) ;
1246  out << " -> LCIO::CHBIT_LONG : " << flag.test( LCIO::CHBIT_LONG ) << endl ;
1247  out << " LCIO::CHBIT_BARREL : " << flag.test( LCIO::CHBIT_BARREL ) << endl ;
1248  out << " LCIO::CHBIT_ID1 : " << flag.test( LCIO::CHBIT_ID1 ) << endl ;
1249  out << " LCIO::CHBIT_STEP : " << flag.test( LCIO::CHBIT_STEP ) << endl ;
1250  }
1251  tmp << dec << hit->id() << dec;
1252  out << setw(30) << setfill(' ') << std::left << "Id" << right << setw(40) << tmp.str() << endl;
1253 
1254  //out << setw(30) << left << "CellID0"<< setfill(' ') << right << setw(40) << dec << hit->getCellID0() << endl;
1255  tmp.str("");
1256  tmp << dec << hit->getCellID0() << dec;
1257  out << setw(30) << setfill(' ') << std::left << "CellID0" << right << setw(40) << tmp.str() << endl;
1258 
1259  //out << setw(30) << left << "CellID1"<< setfill(' ') << right << setw(40) << dec << hit->getCellID1() << endl;
1260  tmp.str("");
1261  tmp << dec << hit->getCellID1() << dec;
1262  out << setw(30) << setfill(' ') << std::left << "CellID1" << right << setw(40) << tmp.str() << endl;
1263 
1264  out << setw(30) << left << "Energy [GeV]" << right << setw(40) << dec << hit->getEnergy() << std::endl;
1265 
1266  tmp.str("");
1267  tmp << hit->getPosition()[0] << ", " << hit->getPosition()[1] << ", " << hit->getPosition()[2];
1268  if(col != NULL){
1269  BitSet32 flag(col->getFlag());
1270  if(flag.test(LCIO::CHBIT_LONG)){
1271  out <<setw(30) << left << showpos << "Position (x,y,z) " << setfill(' ') << right <<setw(40) << tmp.str() << endl;
1272  }
1273  else{
1274  out <<setw(30) << left << showpos << "Position (x,y,z) " << setfill(' ') << right <<setw(40) << "no position available" << endl;
1275  }
1276  }else{
1277  out <<setw(40) << left << showpos << "Position (x,y,z) [not verified]" << setfill(' ') << right <<setw(30) << tmp.str() << endl;
1278  }
1279  //out <<setw(30) << std::left << "Position [] (x,y,z) " << setfill(' ') << right <<setw(40) << tmp.str() << endl;
1280 
1281 
1282  out << setw(30) << std::left << "N MC Contributions: "<< setfill(' ') << right << setw(40) << hit->getNMCContributions() << endl;
1283  for(int k=0;k < hit->getNMCContributions();k++){
1284  try{
1285  out << setw(30) << left << "Particle Number" << right << setw(40) << k << endl;
1286  out << setw(30) << left << " Prim. PDG" << right << setw(40) << ( hit->getParticleCont(k) ? hit->getParticleCont(k)->getPDG() : 0 ) << endl;
1287  out << setw(30) << left << " Energy [GeV]" << right << setw(40) << hit->getEnergyCont(k) << endl;
1288  out << setw(30) << left << " Time" << right << setw(40) << hit->getTimeCont(k) << endl;
1289  out << setw(30) << left << " Length" << right << setw(40) << hit->getLengthCont(k) << endl;
1290  out << setw(30) << left << " Sec. PDG" << right << setw(40) << hit->getPDGCont(k) << endl;
1291  }catch(exception& e){
1292  out << e.what() << endl ;
1293  }
1294  }
1295 
1296  out << noshowpos;
1297  return(out);
1298  }
1299 
1300  //============================================================================
1301  // # TrackerHit
1302  //============================================================================
1303 
1304  const std::string& header(const EVENT::TrackerHit *){ //hauke
1305  static const std::string _h(" [ id ] |cellId0 |cellId1 | position (x,y,z) | time |[type]||[qual.]| EDep |EDepError| cov(x,x), cov(y,x), cov(y,y), cov(z,x), cov(z,y), cov(z,z)\n");
1306  return _h;
1307  }
1308 
1309  const std::string& tail(const EVENT::TrackerHit *){ //hauke
1310  static const std::string _t("------------|--------|--------|-----------------------------|---------|------|------|---------|---------|-----------------------------------------------------------------\n");
1311  return _t;
1312  }
1313 
1314  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerHit>& sV){ //hauke
1315  const EVENT::TrackerHit* part = sV.obj;
1316  const EVENT::LCCollection* col = sV.col;
1317  BitSet32 flag(col->getFlag());
1318 
1319  out << " [" << setfill('0') << setw(8) << dec << part->id() << "] ";
1320  out << "|" << setw(8) << setfill('0') << part->getCellID0();
1321  out << "|" << setw(8) << setfill('0') << part->getCellID1();
1322  out << "|" << showpos << scientific << setprecision (2) << part->getPosition()[0] << ","<< part->getPosition()[1] << "," << part->getPosition()[2] << "|";
1323  out << part->getTime() << "|";
1324  out << "[" << noshowpos << setw(4) << part->getType() << "]|";
1325  out << "[" << noshowpos << setw(4) << part->getQuality() << "]|";
1326  out << showpos << part->getEDep() << "|";
1327  out << part->getEDepError() << "|";
1328  unsigned int i;
1329  for(i=0;i<(part->getCovMatrix().size()-1);i++){
1330  out << " " << showpos << scientific << setprecision(2) << part->getCovMatrix()[i] << ",";
1331  }
1332  out << " " << showpos << scientific << setprecision(2) << part->getCovMatrix()[part->getCovMatrix().size()-1] << endl;
1333 
1334  const LCObjectVec& rawHits = part->getRawHits();
1335  if( ! rawHits.empty() ){
1336  out << " rawHits ("<< rawHits.size() <<"): ";
1337  }
1338  try{
1339  for( i=0 ; i < rawHits.size() ; i++ ){
1340  if( rawHits[i] == 0 ) continue ;
1341  out << dec << "[" << rawHits[i]->id() << "], " << dec ;
1342  }
1343  }catch(std::exception& e){}
1344 
1345  out << dec << endl ;
1346  if(col->getParameters().getStringVal(LCIO::CellIDEncoding) != ""){
1347  CellIDDecoder<TrackerHit> id(col);
1348  out << " id-fields: ("<< id(const_cast<EVENT::TrackerHit*>(part)).valueString() << ")" << std::endl ;
1349  } else{
1350  out << " id-fields: --- unknown/default ---- ";
1351  }
1352 
1353  out << noshowpos << fixed;
1354  out << endl ;
1355  return out;
1356  }
1357 
1358  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::TrackerHit> ll){
1359  const EVENT::TrackerHit *hit = ll.object();
1360  const EVENT::LCCollection *col = ll.collection();
1361 
1362  stringstream tmp;
1363  out << noshowpos;
1364  out << setw(41) << setfill('-') << right << " TrackerHit " << setfill('-') << setw(29) << "-" << endl;
1365  if(col != NULL){
1366  if(col->getTypeName() != LCIO::TRACKERHIT){
1367  out << "Warning: collection not of type " << LCIO::TRACKERHIT << endl ;
1368  return(out);
1369 
1370  }
1371  tmp.str("");
1372  tmp << "0x" << hex << col->getFlag() << dec;
1373  out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
1374  LCTOOLS::printParameters(col->getParameters());
1375 
1376  BitSet32 flag( col->getFlag() ) ;
1377  out << " LCIO::CHBIT_BARREL : " << flag.test( LCIO::CHBIT_BARREL ) << endl ;
1378  }
1379 
1380  tmp.str("");
1381  tmp << dec << hit->id() << dec;
1382  out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
1383 
1384  //out << setw(30) << left << "CellID0"<< setfill(' ') << right << setw(40) << dec << hit->getCellID0() << endl;
1385  tmp.str("");
1386  tmp << dec << hit->getCellID0() << dec;
1387  out << setw(30) << setfill(' ') << std::left << "CellID0" << right << setw(40) << tmp.str() << endl;
1388 
1389  //out << setw(30) << left << "CellID1"<< setfill(' ') << right << setw(40) << dec << hit->getCellID1() << endl;
1390  tmp.str("");
1391  tmp << dec << hit->getCellID1() << dec;
1392  out << setw(30) << setfill(' ') << std::left << "CellID1" << right << setw(40) << tmp.str() << endl;
1393 
1394  tmp.str("");
1395  tmp << hit->getPosition()[0] << ", " << hit->getPosition()[1] << ", " << hit->getPosition()[2];
1396  out << setw(30) << left << "Position (x,y,z) " << setfill(' ') << right <<setw(40) << tmp.str() << endl;
1397  out << setw(30) << left << "E_deposited " << setfill(' ') << right << setw(40) << hit->getEDep() << endl;
1398  out << setw(30) << left << "Time " << setfill(' ') << right << setw(40) << hit->getTime() << endl;
1399  out << setw(30) << left << "Type " << setfill(' ') << right << setw(40) << BitSet32( hit->getType() ) << endl;
1400  out << setw(30) << left << "Quality " << setfill(' ') << right << setw(40) << BitSet32( hit->getQuality() )<< endl;
1401  out << noshowpos;
1402 
1403  return(out);
1404  }
1405 
1406  //============================================================================
1407  // # TrackerHitPlane
1408  //============================================================================
1409 
1411  static const std::string _h(" [ id ] |cellId0 |cellId1 | position (x,y,z) | time |[type]|[qual.]| EDep |EDepError| du | dv |q| u (theta, phi) | v (theta, phi)\n");
1412  return _h;
1413  }
1414 
1416  static const std::string _t("------------|--------|--------|-----------------------------|---------|------|------|---------|---------|---------|---------|-|-------------------|-------------------|\n");
1417  return _t;
1418  }
1419 
1420  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerHitPlane>& sV){
1421  const EVENT::TrackerHitPlane* part = sV.obj;
1422  const EVENT::LCCollection* col = sV.col;
1423  BitSet32 flag(col->getFlag());
1424 
1425  out << " [" << setfill('0') << setw(8) << dec << part->id() << "] ";
1426  out << "|" << setw(8) << setfill('0') << part->getCellID0();
1427  out << "|" << setw(8) << setfill('0') << part->getCellID1();
1428  out << "|" << showpos << scientific << setprecision (2) << part->getPosition()[0] << ","<< part->getPosition()[1] << "," << part->getPosition()[2] << "|";
1429  out << part->getTime() << "|";
1430  out << "[" << noshowpos << setw(4) << part->getType() << "]|";
1431  out << "[" << noshowpos << setw(4) << part->getQuality() << "]|";
1432  out << showpos << part->getEDep() << "|";
1433  out << part->getEDepError() << "|";
1434  out << part->getdU() << "|";
1435  out << part->getdV() << "|";
1436  out << part->getQuality() << "|";
1437 
1438  out << part->getU()[0] << "," << part->getU()[1] << "|";
1439  out << part->getV()[0] << "," << part->getV()[1] << "|";
1440 
1441  unsigned int i;
1442  //for(i=0;i<(part->getCovMatrix().size()-1);i++){
1443  // out << " " << showpos << scientific << setprecision(2) << part->getCovMatrix()[i] << ",";
1444  //}
1445  //out << " " << showpos << scientific << setprecision(2) << part->getCovMatrix()[part->getCovMatrix().size()-1] << endl;
1446 
1447  const LCObjectVec& rawHits = part->getRawHits();
1448  if( ! rawHits.empty() ){
1449  out << " rawHits ("<< rawHits.size() <<"): ";
1450  }
1451  try{
1452  for( i=0 ; i < rawHits.size() ; i++ ){
1453  if( rawHits[i] == 0 ) continue ;
1454  out << dec << "[" << rawHits[i]->id() << "], " << dec ;
1455  }
1456  }catch(std::exception& e){}
1457 
1458  out << dec << endl ;
1459  if(col->getParameters().getStringVal(LCIO::CellIDEncoding) != ""){
1460  CellIDDecoder<TrackerHit> id(col);
1461  out << " id-fields: ("<< id(const_cast<EVENT::TrackerHitPlane*>(part)).valueString() << ")" << std::endl ;
1462  } else{
1463  out << " id-fields: --- unknown/default ---- ";
1464  }
1465 
1466  out << noshowpos << fixed;
1467  out << endl ;
1468  return out;
1469  }
1470 
1471  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::TrackerHitPlane> ll){
1472  const EVENT::TrackerHitPlane *hit = ll.object();
1473  const EVENT::LCCollection *col = ll.collection();
1474 
1475  stringstream tmp;
1476  out << noshowpos;
1477  out << setw(41) << setfill('-') << right << " TrackerHitPlane " << setfill('-') << setw(29) << "-" << endl;
1478  if(col != NULL){
1479  if(col->getTypeName() != LCIO::TRACKERHITPLANE){
1480  out << "Warning: collection not of type " << LCIO::TRACKERHITPLANE << endl ;
1481  return(out);
1482 
1483  }
1484  tmp.str("");
1485  tmp << "0x" << hex << col->getFlag() << dec;
1486  out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
1487  LCTOOLS::printParameters(col->getParameters());
1488 
1489  //BitSet32 flag( col->getFlag() ) ;
1490  //out << " LCIO::CHBIT_BARREL : " << flag.test( LCIO::CHBIT_BARREL ) << endl ;
1491  }
1492 
1493  tmp.str("");
1494  tmp << dec << hit->id() << dec;
1495  out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
1496 
1497  //out << setw(30) << left << "CellID0"<< setfill(' ') << right << setw(40) << dec << hit->getCellID0() << endl;
1498  tmp.str("");
1499  tmp << dec << hit->getCellID0() << dec;
1500  out << setw(30) << setfill(' ') << std::left << "CellID0" << right << setw(40) << tmp.str() << endl;
1501 
1502  //out << setw(30) << left << "CellID1"<< setfill(' ') << right << setw(40) << dec << hit->getCellID1() << endl;
1503  tmp.str("");
1504  tmp << dec << hit->getCellID1() << dec;
1505  out << setw(30) << setfill(' ') << std::left << "CellID1" << right << setw(40) << tmp.str() << endl;
1506 
1507  tmp.str("");
1508  tmp << hit->getPosition()[0] << ", " << hit->getPosition()[1] << ", " << hit->getPosition()[2];
1509  out << setw(30) << left << "Position (x,y,z) " << setfill(' ') << right <<setw(40) << tmp.str() << endl;
1510  out << setw(30) << left << "EDep " << setfill(' ') << right << setw(40) << hit->getEDep() << endl;
1511  out << setw(30) << left << "EDepError " << setfill(' ') << right << setw(40) << hit->getEDepError() << endl;
1512  out << setw(30) << left << "Time " << setfill(' ') << right << setw(40) << hit->getTime() << endl;
1513  out << setw(30) << left << "Type " << setfill(' ') << right << setw(40) << BitSet32( hit->getType() ) << endl;
1514  out << setw(30) << left << "Quality " << setfill(' ') << right << setw(40) << BitSet32( hit->getQuality() )<< endl;
1515  out << setw(30) << left << "dU " << setfill(' ') << right << setw(40) << hit->getdU() << endl;
1516  out << setw(30) << left << "dV " << setfill(' ') << right << setw(40) << hit->getdV() << endl;
1517  out << setw(30) << left << "U " << setfill(' ') << right << setw(40) << hit->getU()[0] << "," << hit->getU()[1] << endl;
1518  out << setw(30) << left << "V " << setfill(' ') << right << setw(40) << hit->getV()[0] << "," << hit->getV()[1] << endl;
1519  out << setw(30) << left << "Quality " << setfill(' ') << right << setw(40) << hit->getQuality() << endl;
1520  out << noshowpos;
1521 
1522  return(out);
1523  }
1524 
1525  //============================================================================
1526  // # TrackerHitZCylinder
1527  //============================================================================
1528 
1530  //static std::string _h(" [ id ] |cellId0 |cellId1 | position (x,y,z) | time |[type]| EDep |EDepError| r | dRPhi | dZ |q| center (x,y) |\n");
1531  static const std::string _h(" [ id ] |cellId0 |cellId1 | position (x,y,z) | time |[type]|[qual.]| EDep |EDepError| dRPhi | dZ |q| center (x,y) |\n");
1532  return _h;
1533  }
1534 
1536  static const std::string _t("------------|--------|--------|-----------------------------|---------|------|------|---------|---------|---------|---------|-|-------------------|\n");
1537  return _t;
1538  }
1539 
1540  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerHitZCylinder>& sV){
1541  const EVENT::TrackerHitZCylinder* part = sV.obj;
1542  const EVENT::LCCollection* col = sV.col;
1543  BitSet32 flag(col->getFlag());
1544 
1545  out << " [" << setfill('0') << setw(8) << dec << part->id() << "] ";
1546  out << "|" << setw(8) << setfill('0') << part->getCellID0();
1547  out << "|" << setw(8) << setfill('0') << part->getCellID1();
1548  out << "|" << showpos << scientific << setprecision (2) << part->getPosition()[0] << ","<< part->getPosition()[1] << "," << part->getPosition()[2] << "|";
1549  out << part->getTime() << "|";
1550  out << "[" << noshowpos << setw(4) << part->getType() << "]|";
1551  out << "[" << noshowpos << setw(4) << part->getQuality() << "]|";
1552  out << showpos << part->getEDep() << "|";
1553  out << part->getEDepError() << "|";
1554  //out << part->getR() << "|";
1555  out << part->getdRPhi() << "|";
1556  out << part->getdZ() << "|";
1557  out << part->getQuality() << "|";
1558  out << part->getCenter()[0] << "," << part->getCenter()[1] << "|";
1559 
1560  unsigned int i;
1561  //for(i=0;i<(part->getCovMatrix().size()-1);i++){
1562  // out << " " << showpos << scientific << setprecision(2) << part->getCovMatrix()[i] << ",";
1563  //}
1564  //out << " " << showpos << scientific << setprecision(2) << part->getCovMatrix()[part->getCovMatrix().size()-1] << endl;
1565 
1566  const LCObjectVec& rawHits = part->getRawHits();
1567  if( ! rawHits.empty() ){
1568  out << " rawHits ("<< rawHits.size() <<"): ";
1569  }
1570  try{
1571  for( i=0 ; i < rawHits.size() ; i++ ){
1572  if( rawHits[i] == 0 ) continue ;
1573  out << dec << "[" << rawHits[i]->id() << "], " << dec ;
1574  }
1575  }catch(std::exception& e){}
1576 
1577  out << dec << endl ;
1578  if(col->getParameters().getStringVal(LCIO::CellIDEncoding) != ""){
1579  CellIDDecoder<TrackerHit> id(col);
1580  out << " id-fields: ("<< id(const_cast<EVENT::TrackerHitZCylinder*>(part)).valueString() << ")" << std::endl ;
1581  } else{
1582  out << " id-fields: --- unknown/default ---- ";
1583  }
1584 
1585  out << noshowpos << fixed;
1586  out << endl ;
1587  return out;
1588  }
1589 
1590  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::TrackerHitZCylinder> ll){
1591  const EVENT::TrackerHitZCylinder *hit = ll.object();
1592  const EVENT::LCCollection *col = ll.collection();
1593 
1594  stringstream tmp;
1595  out << noshowpos;
1596  out << setw(41) << setfill('-') << right << " TrackerHitZCylinder " << setfill('-') << setw(29) << "-" << endl;
1597  if(col != NULL){
1598  if(col->getTypeName() != LCIO::TRACKERHITZCYLINDER){
1599  out << "Warning: collection not of type " << LCIO::TRACKERHITZCYLINDER << endl ;
1600  return(out);
1601 
1602  }
1603  tmp.str("");
1604  tmp << "0x" << hex << col->getFlag() << dec;
1605  out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
1606  LCTOOLS::printParameters(col->getParameters());
1607 
1608  //BitSet32 flag( col->getFlag() ) ;
1609  //out << " LCIO::CHBIT_BARREL : " << flag.test( LCIO::CHBIT_BARREL ) << endl ;
1610  }
1611 
1612  tmp.str("");
1613  tmp << dec << hit->id() << dec;
1614  out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
1615 
1616  //out << setw(30) << left << "CellID0"<< setfill(' ') << right << setw(40) << dec << hit->getCellID0() << endl;
1617  tmp.str("");
1618  tmp << dec << hit->getCellID0() << dec;
1619  out << setw(30) << setfill(' ') << std::left << "CellID0" << right << setw(40) << tmp.str() << endl;
1620 
1621  //out << setw(30) << left << "CellID1"<< setfill(' ') << right << setw(40) << dec << hit->getCellID1() << endl;
1622  tmp.str("");
1623  tmp << dec << hit->getCellID1() << dec;
1624  out << setw(30) << setfill(' ') << std::left << "CellID1" << right << setw(40) << tmp.str() << endl;
1625 
1626  tmp.str("");
1627  tmp << hit->getPosition()[0] << ", " << hit->getPosition()[1] << ", " << hit->getPosition()[2];
1628  out << setw(30) << left << "Position (x,y,z) " << setfill(' ') << right <<setw(40) << tmp.str() << endl;
1629  out << setw(30) << left << "EDep " << setfill(' ') << right << setw(40) << hit->getEDep() << endl;
1630  out << setw(30) << left << "EDepError " << setfill(' ') << right << setw(40) << hit->getEDepError() << endl;
1631  out << setw(30) << left << "Time " << setfill(' ') << right << setw(40) << hit->getTime() << endl;
1632  out << setw(30) << left << "Type " << setfill(' ') << right << setw(40) << BitSet32( hit->getType() ) << endl;
1633  out << setw(30) << left << "Quality " << setfill(' ') << right << setw(40) << BitSet32( hit->getQuality() )<< endl;
1634  //out << setw(30) << left << "r " << setfill(' ') << right << setw(40) << hit->getR() << endl;
1635  out << setw(30) << left << "dRPhi " << setfill(' ') << right << setw(40) << hit->getdRPhi() << endl;
1636  out << setw(30) << left << "dZ " << setfill(' ') << right << setw(40) << hit->getdZ() << endl;
1637  out << setw(30) << left << "Center(x,y) " << setfill(' ') << right << setw(40) << hit->getCenter()[0] << "," << hit->getCenter()[1] << endl;
1638  out << setw(30) << left << "Quality " << setfill(' ') << right << setw(40) << hit->getQuality() << endl;
1639  out << noshowpos;
1640 
1641  return(out);
1642  }
1643 
1644  //============================================================================
1645  // # SimTrackerHit
1646  //============================================================================
1647 
1648  const std::string& header(const EVENT::SimTrackerHit *){ //hauke
1649  static const std::string _h(" [ id ] |cellId0 |cellId1 | position (x,y,z) | EDep | time |PDG of MCParticle| (px, py, pz) | pathLength | Quality \n");
1650  return _h;
1651  }
1652 
1653  const std::string& tail(const EVENT::SimTrackerHit *){ //hauke
1654  static const std::string _t("------------|--------|--------|---------------------------------|----------|----------|-----------------|-------------------|-------------|---------\n");
1655  return _t;
1656  }
1657 
1658  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::SimTrackerHit>& sV){ //hauke
1659  const EVENT::SimTrackerHit* hit = sV.obj;
1660  const EVENT::LCCollection* col = sV.col;
1661 
1662  BitSet32 flag(col->getFlag()) ;
1663  bool pStored = flag.test(LCIO::THBIT_MOMENTUM);
1664 
1665  int pdgid = 0;
1666  if(hit->getMCParticle()){
1667  pdgid = hit->getMCParticle()->getPDG() ;
1668  }
1669 
1670  out << " [" << setfill('0') << setw(8) << dec<< hit->id() << "] " << dec;
1671  out << "|" << dec << setw(8) << setfill('0') << hit->getCellID0();
1672  out << "|" << dec << setw(8) << setfill('0') << hit->getCellID1();
1673 
1674 
1675 
1676  //out << setw(8) << setfill('0') << dec << hit->getCellID() << setfill(' ');
1677 
1678  //out << dec << "[";
1679  //if(col->getParameters().getStringVal( LCIO::CellIDEncoding ) != ""){
1680  // CellIDDecoder<SimTrackerHit> id(col);
1681  // out<< id(const_cast<EVENT::SimTrackerHit*>(hit)).valueString();
1682  //} else{
1683  // out << " --- unknown/default ---- ";
1684  //}
1685  //out << "]|(";
1686  out << "|(";
1687 
1688  out << dec << showpos << setprecision(2) << scientific<< hit->getPosition()[0] << ", ";
1689  out << hit->getPosition()[1] << ", ";
1690  out << hit->getPosition()[2] << ")| ";
1691  out << noshowpos;
1692  out << hit->getEDep () << " | ";
1693  out << hit->getTime () << " | ";
1694  out << setw(14) << pdgid << " ";
1695 
1696 
1697  if( pStored ){
1698  out << " | (";
1699  out << hit->getMomentum()[0] << ", ";
1700  out << hit->getMomentum()[1] << ", ";
1701  out << hit->getMomentum()[2] << ") | ";
1702  out << std::setw(13) << hit->getPathLength() << "|";
1703  }else{
1704  out << "| unknown |";
1705  out << " n/a |"; // path length
1706  }
1707 
1708  //qualityBits
1709  out << LCTOOLS::getQualityBits(hit);
1710 
1711  out << endl ;
1712 
1713  if(col->getParameters().getStringVal(LCIO::CellIDEncoding) != ""){
1715  out << " id-fields: ("<< id(const_cast<EVENT::SimTrackerHit*>(hit)).valueString() << ")" << std::endl ;
1716  } else{
1717  out << " id-fields: --- unknown/default ---- ";
1718  }
1719 
1720  out << endl ;
1721 
1722 
1723  /*
1724  out << noshowpos << " " << setw(8) << dec << hit->getCellID() << "|";
1725  out << showpos << scientific << setprecision (2) << setfill(' ') << hit->getPosition()[0]<<","<<hit->getPosition()[1]<<","<<hit->getPosition()[2]<<"|";
1726  out << hit->getEDep() << "|";
1727  out << hit->getTime() << "|";
1728  if(hit->getMCParticle()){
1729  out << setw(17) << hit->getMCParticle()->getPDG() << "|";
1730  }else{
1731  out << " |";
1732  }
1733  out << hit->getMomentum()[0] << "," << hit->getMomentum()[1] << "," << hit->getMomentum()[2] << "|";
1734  out << setw(11) << hit->getPathLength() << endl;
1735  out << noshowpos;
1736 
1737  */
1738  return(out);
1739  }
1740 
1741  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::SimTrackerHit> ll){
1742  const EVENT::SimTrackerHit *hit = ll.object();
1743  const EVENT::LCCollection *col = ll.collection();
1744 
1745  stringstream tmp;
1746  out << noshowpos;
1747 
1748  out << setw(42) << std::setfill('-') << right << " SimTrackerHit " << setfill('-') << setw(28) << "-" << endl;
1749  if(col != NULL){
1750  if(col->getTypeName() != LCIO::SIMTRACKERHIT){
1751  out << "Warning: collection not of type " << LCIO::SIMTRACKERHIT << endl ;
1752  return(out);
1753 
1754  }
1755  tmp.str("");
1756  tmp << col->getFlag() << dec;
1757  out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
1758  LCTOOLS::printParameters(col->getParameters());
1759 
1760  BitSet32 flag( col->getFlag() ) ;
1761  out << " LCIO::THBIT_BARREL : " << flag.test( LCIO::THBIT_BARREL ) << endl ;
1762  out << " LCIO::THBIT_MOMENTUM : " << flag.test( LCIO::THBIT_MOMENTUM ) << endl ;
1763 
1764  out << LCTOOLS::getQualityBits() << endl;
1765  }
1766 
1767  //out << setw(30) << left << "CellID0"<< setfill(' ') << right << setw(40) << dec << hit->getCellID0() << endl;
1768  tmp.str("");
1769  tmp << hit->getCellID0() << dec;
1770  out << setw(30) << setfill(' ') << std::left << "CellID0" << right << setw(40) << tmp.str() << endl;
1771 
1772  //out << setw(30) << left << "CellID1"<< setfill(' ') << right << setw(40) << dec << hit->getCellID1() << endl;
1773  tmp.str("");
1774  tmp << hit->getCellID1() << dec;
1775  out << setw(30) << setfill(' ') << std::left << "CellID1" << right << setw(40) << tmp.str() << endl;
1776 
1777  tmp.str("");
1778  tmp << dec << hit->getPosition()[0] << ", " << hit->getPosition()[1] << ", " << hit->getPosition()[2];
1779  out <<setw(30) << std::left << "Position [mm] (x,y,z) " << dec << setfill(' ') << right <<setw(40) << tmp.str() << endl;
1780  out <<setw(30) << std::left << "dE/dx [GeV]" << setfill(' ') << right <<setw(40) << hit->getEDep() << endl;
1781  out <<setw(30) << std::left << "Time [ns]" << setfill(' ') << right <<setw(40) << hit->getTime() << endl;
1782  if(hit->getMCParticle() != NULL){
1783  out <<std::setw(30) << std::left << "PDG of MCParticle " << setfill(' ') << right <<setw(40) << hit->getMCParticle()->getPDG() << std::endl;
1784  out <<std::setw(30) << std::left << "ID of MCParticle " << setfill(' ') << right <<setw(40) << hit->getMCParticle()->id() << std::endl;
1785  }else{
1786  out <<std::setw(30) << std::left << "PDG of MCParticle " << setfill(' ') << right <<setw(40) << "[Empty]" << std::endl;
1787  }
1788 
1789  tmp.str("");
1790  tmp << hit->getMomentum()[0] << ", " << hit->getMomentum()[1] << ", " << hit->getMomentum()[2];
1791  if(col != NULL){
1792  BitSet32 flag(col->getFlag());
1793  if(flag.test(LCIO::THBIT_MOMENTUM)){
1794  out <<setw(40) << left << "Momentum [GeV] (x,y,z) [not verified]" << setfill(' ') << right <<setw(30) << tmp.str() << endl;
1795  }else{
1796  out <<setw(30) << left << "Momentum [GeV] (x,y,z)" << setfill(' ') << right <<setw(40) << "not available" << endl;
1797  }
1798  }else{
1799  out <<setw(40) << left << "Momentum [GeV] (x,y,z) [not verified]" << setfill(' ') << right <<setw(30) << tmp.str() << endl;
1800  }
1801  out <<setw(30) << left << "PathLength " << setfill(' ') << right <<setw(40) << hit->getPathLength() << endl;
1802 
1803  out << noshowpos;
1804 
1805  return(out);
1806  }
1807 
1808  //============================================================================
1809  // # CalorimeterHit
1810  //============================================================================
1811 
1812  const std::string& header(const EVENT::CalorimeterHit *){ //hauke
1813  static const std::string _h(" [ id ] |cellId0 |cellId1 | energy |energyerr | position (x,y,z) \n");
1814  return _h;
1815  }
1816 
1817  const std::string& tail(const EVENT::CalorimeterHit *){ //hauke
1818  static const std::string _t("------------|--------|--------|----------|----------|-----------------------------------\n");
1819  return _t;
1820  }
1821 
1822  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::CalorimeterHit>& sV){ //hauke
1823  const EVENT::CalorimeterHit* hit = sV.obj;
1824  const EVENT::LCCollection *col = sV.col;
1825  BitSet32 flag( col->getFlag() ) ;
1826 
1827  out << noshowpos;
1828 
1829  out << " [" << dec << setw(8) << setfill('0') << hit->id() << "] ";
1830  out << "|" << dec << setw(8) << setfill('0') << hit->getCellID0();
1831  out << "|" << dec << setw(8) << setfill('0') << hit->getCellID1();
1832  out << "|" << dec << setprecision(3) << scientific << showpos << hit->getEnergy();
1833  out << "|" << dec << setprecision(3) << scientific << hit->getEnergyError();
1834  if( flag.test( LCIO::CHBIT_LONG ) ){
1835  out << "|" << dec << setprecision(3) << scientific << showpos
1836  << hit->getPosition()[0] << ", " << hit->getPosition()[1] << ", " << hit->getPosition()[2];
1837  }else{
1838  out << " no position available ";
1839  }
1840  if(col->getParameters().getStringVal(LCIO::CellIDEncoding) != ""){
1842  out << endl << " id-fields: ("<< id(const_cast<EVENT::CalorimeterHit*>(hit)).valueString() << ")" << std::endl ;
1843  } else{
1844  out << endl << " id-fields: --- unknown/default ---- ";
1845  }
1846 
1847  out << endl << noshowpos;
1848 
1849  return(out);
1850  }
1851 
1852  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::CalorimeterHit> l) {
1853  const EVENT::CalorimeterHit *hit = l.object();
1854  const EVENT::LCCollection *col = l.collection();
1855 
1856  stringstream tmp;
1857  out << noshowpos;
1858 
1859  out << setw(42) << std::setfill('-') << right << " CalorimeterHit " << setfill('-') << setw(28) << "-" << endl;
1860 
1861  if(col != NULL){
1862  if(col->getTypeName() != LCIO::CALORIMETERHIT){
1863  out << "Warning: collection not of type " << LCIO::CALORIMETERHIT << endl ;
1864  return(out);
1865  }
1866  tmp.str("");
1867  tmp << "0x" << hex << col->getFlag() << dec;
1868  out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
1869  LCTOOLS::printParameters(col->getParameters()); //todo
1870  BitSet32 flag(col->getFlag());
1871  out << " -> LCIO::RCHBIT_LONG : " << flag.test( LCIO::RCHBIT_LONG ) << endl ;
1872  out << " LCIO::RCHBIT_BARREL : " << flag.test( LCIO::RCHBIT_BARREL ) << endl ;
1873  out << " LCIO::RCHBIT_ID1 : " << flag.test( LCIO::RCHBIT_ID1 ) << endl ;
1874  out << " LCIO::RCHBIT_TIME : " << flag.test( LCIO::RCHBIT_TIME ) << endl ;
1875  out << " LCIO::RCHBIT_NO_PTR : " << flag.test( LCIO::RCHBIT_NO_PTR ) << endl ;
1876  out << " LCIO::RCHBIT_ENERGY_ERROR : " << flag.test( LCIO::RCHBIT_ENERGY_ERROR ) << endl ;
1877  }
1878 
1879 
1880  //out << setw(30) << setfill(' ') << left << "ID" << right << setw(40) << hit->getId() << endl;
1881  tmp.str("");
1882  tmp << hit->getCellID0() << dec;
1883  out << setw(30) << setfill(' ') << left << "CellId0" << right << setw(40) << tmp.str() << endl;
1884  tmp.str("");
1885  tmp << hit->getCellID1() << dec;
1886 
1887  out << setw(30) << setfill(' ') << left << "CellId1" << right << setw(40) << tmp.str() << endl;
1888  out << setw(30) << setfill(' ') << left << "Energy [GeV]" << right << setw(40) << dec << hit->getEnergy() << endl;
1889  out << setw(30) << setfill(' ') << left << "Energy Error [GeV]" << right << setw(40) << hit->getEnergyError() << endl;
1890  tmp.str("");
1891  tmp << hit->getPosition()[0] << ", " << hit->getPosition()[1] << ", " << hit->getPosition()[2];
1892  if(col != NULL){
1893  BitSet32 flag(col->getFlag());
1894  if(flag.test(LCIO::CHBIT_LONG)){
1895  out <<setw(30) << left << showpos << "Position (x,y,z) " << setfill(' ') << right <<setw(40) << tmp.str() << endl;
1896  }
1897  else{
1898  out <<setw(30) << left << showpos << "Position (x,y,z) " << setfill(' ') << right <<setw(40) << "no position available" << endl;
1899  }
1900  }else{
1901  out <<setw(40) << left << showpos << "Position (x,y,z) [not verified]" << setfill(' ') << right <<setw(30) << tmp.str() << endl;
1902  }
1903  //out << setw(30) << left << noshowpos << "ID-Field" << right << setw(40) << idDecoder(hit).valuestring() << endl;
1904  out <<setw(30) << left << noshowpos << "Type " << setfill(' ') << right <<setw(40) << hit->getType() << endl;
1905  out << noshowpos;
1906 
1907  return(out);
1908  }
1909 
1910  //============================================================================
1911  // # MCParticle
1912  //============================================================================
1913 
1914  const std::string& header(const EVENT::MCParticle *){ //hauke
1915  static const std::string _h(" [ id ] | PDG | px, py, pz | px_ep , py_ep , pz_ep | energy |gen|[simstat ]| vertex x, y , z | endpoint x, y , z | mass | charge | [parents] - [daughters] \n");
1916  return _h;
1917  }
1918 
1919  const std::string& tail(const EVENT::MCParticle *){ //hauke
1920  static const std::string _t("------------|-----|-------------------------------|--------|---|----------|-------------------------------|-------------------------------|---------|---------|--------------------------\n");
1921  return _t;
1922  }
1923 
1924  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::MCParticle>& sV){ //hauke
1925  const EVENT::MCParticle* part = sV.obj;
1926 
1927  out << " [" << dec << setfill('0') << setw(8) << part->id() << "] "<< dec ;
1928  //out << setfill (' ') << dec << setw(5) << index << "|";
1929  out << "|";
1930  out << setfill(' ')<< setw(5) << part->getPDG() << "|";
1931  out << scientific << showpos << setprecision(2)
1932  << part->getMomentum()[0] << ", " << part->getMomentum()[1] << ", " << part->getMomentum()[2] << "|";
1933  out << scientific << showpos << setprecision(2)
1934  << part->getMomentumAtEndpoint()[0] << ", " << part->getMomentumAtEndpoint()[1] << ", " << part->getMomentumAtEndpoint()[2] << "|";
1935  out << noshowpos;
1936  out << part->getEnergy() << "|";
1937  out << fixed << setw(3) << part->getGeneratorStatus() << "|";
1938  out << LCTOOLS::getSimulatorStatusString(const_cast<EVENT::MCParticle *>(part) ).c_str() << "|";
1939  out << scientific << showpos << setprecision(2)
1940  << part->getVertex()[0] << ", " << part->getVertex()[1] << ", " << part->getVertex()[2] << "|";
1941  out << scientific << showpos << setprecision(2)
1942  << part->getEndpoint()[0] << ", " << part->getEndpoint()[1] << ", " << part->getEndpoint()[2] << "|";
1943  out << part->getMass() << "|";
1944  out << part->getCharge() << "|";
1945  out << " [" ;
1946 
1947  for(unsigned int k=0;k<part->getParents().size();k++){
1948  if(k>0) out << "," ;
1949  out << dec << setfill('0') << setw(8) << (part->getParents()[k])->id();
1950  }
1951  out << "] - [" ;
1952  for(unsigned int k=0;k<part->getDaughters().size();k++){
1953  if(k>0) out << "," ;
1954  out << dec << setfill('0') << setw(8)<< (part->getDaughters()[k])->id();
1955  }
1956  out << "] " << endl;
1957 
1958  out << dec << noshowpos << setfill(' ');
1959  return out;
1960  }
1961 
1962  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::MCParticle> ll){
1963  const EVENT::MCParticle *mcp = ll.object();
1964  const EVENT::LCCollection *col = ll.collection();
1965 
1966  stringstream tmp;
1967  out << noshowpos;
1968 
1969  //out << setprecision(5) << fixed;
1970  out << setw(41) << std::setfill('-') << right << " MCParticle " << setfill('-') << setw(29) << "-" << std::endl;
1971  if(col != NULL){
1972  if(col->getTypeName() != LCIO::MCPARTICLE){
1973  out << "Warning: collection not of type " << LCIO::MCPARTICLE << endl ;
1974  return(out);
1975 
1976  }
1977  tmp.str("");
1978  tmp << "0x" << hex << col->getFlag() << dec;
1979  out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
1980  LCTOOLS::printParameters(col->getParameters());
1981  }
1982 
1983  tmp.str("");
1984  tmp << mcp->id() << dec;
1985  out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
1986  out << setw(30) << left << "PDG"<< setfill(' ') << right << setw(40) << mcp->getPDG() << endl;
1987  out << setw(30) << std::left << "Energy [GeV]" << right << setw(40) << mcp->getEnergy() << endl;
1988 
1989 
1990  tmp.str("");
1991  tmp << mcp->getMomentum()[0] << ", " << mcp->getMomentum()[1] << ", " << mcp->getMomentum()[2];
1992  out << setw(30) << left << "Momentum [GeV] (x,y,z) " << setfill(' ') << right <<setw(40) << tmp.str() << endl;
1993 
1994  tmp.str("");
1995  tmp << mcp->getMomentumAtEndpoint()[0] << ", " << mcp->getMomentumAtEndpoint()[1] << ", " << mcp->getMomentumAtEndpoint()[2];
1996  out << setw(30) << left << "Momentum at Endpoint[GeV] (x,y,z) " << setfill(' ') << right <<setw(40) << tmp.str() << endl;
1997 
1998 
1999  out << setw(30) << left <<"GeneratorStatus" << setfill(' ') << right << setw(40) << mcp->getGeneratorStatus() << endl;
2000  //out << "SimulatorStatusString " << std::setw(26) << setfill(' ') << " " << mcp->getGeneratorStatusString() << std::endl;
2001 
2002 
2003  tmp.str("");
2004  tmp << mcp->getVertex()[0] << ", " << mcp->getVertex()[1] << ", " << mcp->getVertex()[2];
2005  out << setw(30) << left << "Vertex [mm] (x,y,z) " << setfill(' ') << right << setw(40) << right << tmp.str() << endl;
2006 
2007  tmp.str("");
2008  tmp << mcp->getEndpoint()[0] << ", " << mcp->getEndpoint()[1] << ", " << mcp->getEndpoint()[2] ;
2009  out << setw(30) << left <<"Endpoint [mm] (x,y,z) " << setfill(' ') << setw(40) << right << tmp.str() << endl;
2010  out << setw(30) << left << "Mass [GeV] " << right << setw(40) << mcp->getMass() << endl;
2011  out << setw(30) << left << "Charge " << right << setw(40) << mcp->getCharge() << endl;
2012  out << setw(30) << left << "Parents " <<right << setw(40) << mcp->getParents().size() << endl;
2013  out << setw(30) << left << "Daughters " << right << setw(40) << mcp->getDaughters().size() << endl;
2014 
2015  //out<<LCTOOLS::getSimulatorStatusString(NULL) << LCTOOLS::getSimulatorStatusString(mcp);
2016  if(mcp->getSimulatorStatus() != 0){
2017  out<<LCTOOLS::getSimulatorStatusString() << LCTOOLS::getSimulatorStatusString((MCParticle *) mcp) << endl;
2018  }
2019 
2020  out << noshowpos;
2021 
2022  return(out);
2023  }
2024 
2025  /* std::ostream& operator<<( std::ostream& out, const LCIO::MCParticle* part){
2026  out << endl
2027  << "[ id ]index| PDG | px, py, pz | energy |gen|[simstat]| vertex x, y , z | endpoint x, y , z | mass | charge | [parents] - [daughters] |"
2028  << endl
2029  << endl ;
2030  printf("[%8.8x]", part->id() );
2031  printf("%10d|" , part->getPDG() );
2032  printf("% 1.2e,% 1.2e,% 1.2e|" ,
2033  part->getMomentum()[0] ,
2034  part->getMomentum()[1] ,
2035  part->getMomentum()[2] );
2036  printf("% 1.2e|" , part->getEnergy() ) ;
2037 
2038  printf(" %1d |" , part->getGeneratorStatus() );
2039  printf("% 1.2e,% 1.2e,% 1.2e|" ,
2040  part->getVertex()[0] ,
2041  part->getVertex()[1] ,
2042  part->getVertex()[2] );
2043  printf("% 1.2e,% 1.2e,% 1.2e|" ,
2044  part->getEndpoint()[0] ,
2045  part->getEndpoint()[1] ,
2046  part->getEndpoint()[2] );
2047  printf("% 1.2e|" , part->getMass() ) ;
2048  printf("% 1.2e|" , part->getCharge() ) ;
2049 
2050  out << " [" ;
2051 
2052  for(unsigned int k=0;k<part->getParents().size();k++){
2053  if(k>0) out << "," ;
2054  out << p2i_map[ part->getParents()[k] ] ;
2055  }
2056  out << "] - [" ;
2057  for(unsigned int k=0;k<part->getDaughters().size();k++){
2058  if(k>0) out << "," ;
2059  out << p2i_map[ part->getDaughters()[k] ] ;
2060  }
2061  out << "] " << endl ;
2062 
2063 
2064  out << endl
2065  << "-------------------------------------------------------------------------------- "
2066  << endl ;
2067  }
2068  */
2069 
2070  //============================================================================
2071  // # ReconstructedParticle
2072  //============================================================================
2073 
2075  static const std::string _h(" [ id ] |com|type| momentum( px,py,pz) | energy | mass | charge | position ( x,y,z) |pidUsed|GoodnessOfPID|\n");
2076  return _h;
2077  }
2078 
2080  static const std::string _t("------------|---|----|-------------------------------|--------|--------|--------|-------------------------------|-------|-------------|\n");
2081  return _t;
2082  }
2083 
2084  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::ReconstructedParticle>& sV){ //hauke
2085  const EVENT::ReconstructedParticle * part = sV.obj;
2086  stringstream tmp;
2087 
2088  out << noshowpos << " [" << setfill('0') << setw(8) << dec << part->id() << "] |" << dec;
2089  out << setfill(' ') << setw(3) << part->isCompound() << "|";
2090  out << setfill(' ') << setw(4) << part->getType() << "|";
2091 
2092  tmp.str("");
2093  tmp << showpos << scientific << setprecision(2);
2094  tmp << part->getMomentum()[0] << ", " << part->getMomentum()[1] << ", " << part->getMomentum()[2];
2095  out << tmp.str() << "|";
2096 
2097 
2098  out << noshowpos << scientific << setprecision(2);
2099  out << part->getEnergy() << "|";
2100  out << part->getMass() << "|";
2101  out << part->getCharge() << "|";
2102 
2103  tmp.str("");
2104  tmp << part->getReferencePoint()[0] << ", " << part->getReferencePoint()[1] << ", " << part->getReferencePoint()[2];
2105  out << tmp.str() << "|";
2106 
2107  out << dec << setw(7) << setfill('0');
2108  if(part->getParticleIDUsed() != 0 ){
2109  out << part->getParticleIDUsed()->id();
2110  }else{
2111  out << 0;
2112  }
2113  out << "|" << setw(13) << setfill(' ') << scientific << part->getGoodnessOfPID() << "|" << endl;
2114 
2115  out << endl;
2116 
2117  out << " covariance( px,py,pz,E) : (" ;
2118  for(int l=0;l<10;l++){
2119  if(l==9){
2120  out << scientific << setprecision(2) << part->getCovMatrix()[l];
2121  }else{
2122  out << scientific << setprecision(2) << part->getCovMatrix()[l] << ", ";
2123  }
2124 
2125 
2126 
2127  //printf("%4.2e, ", part->getCovMatrix()[l] ) ;
2128  }
2129  out << ")" << endl ;
2130 
2131  out << " particles ( [ id ] ):" ;
2132  for(unsigned int l=0;l<part->getParticles().size();l++){
2133  if(l == part->getParticles().size()-1){
2134  out << dec << setfill('0') << "[" <<setw(8) << part->getParticles()[l]->id() << "]";
2135  }else{
2136  out << dec << setfill('0') << "[" <<setw(8) << part->getParticles()[l]->id() << "], ";
2137  }
2138 
2139  //printf("[%8.8x], ", part->getParticles()[l]->id() ) ;
2140  }
2141  out << endl ;
2142 
2143  out << " tracks ( [ id ] ): " ;
2144 
2145  for(unsigned int l=0,N=part->getTracks().size(); l<N ;l++){
2146 
2147  out << dec << setfill('0') << "[" << setw(8)
2148  << ( part->getTracks()[l] ? part->getTracks()[l]->id() : 0 ) << "]" ;
2149 
2150  if( l != N-1 ) out << ", ";
2151  }
2152  out << endl ;
2153 
2154  out << " clusters ( [ id ] ): " ;
2155 
2156  for(unsigned int l=0,N=part->getClusters().size(); l<N ;l++){
2157 
2158  out << dec << setfill('0') << "[" << setw(8)
2159  << ( part->getClusters()[l] ? part->getClusters()[l]->id() : 0 ) << "]";
2160 
2161  if(l != N-1) out << ", " ;
2162  }
2163  out << endl ;
2164  out << " particle ids ( [id], PDG, (type)): " << std::endl ;
2165  for(unsigned int l=0;l<part->getParticleIDs().size();l++){
2166  ParticleID* pid = part->getParticleIDs()[l] ;
2167  if(l==0) out << " " << header( pid ) << std::endl ;
2168  out << " " << lcshort( pid ) << std::endl ;
2169  // out << dec << "[" << setw(8) <<pid->id() << "], " << dec << setw(6) << pid->getPDG() << ", " << "(" << setw(6) <<pid->getType() << ") ";
2170  //printf("[%8.8x], %6.6d, (%6.6d) ", pid->id() , pid->getPDG() , pid->getType() ) ;
2171  }
2172  out << endl ;
2173 
2174  Vertex* sv = dynamic_cast<Vertex*>(part->getStartVertex());
2175  Vertex* ev = dynamic_cast<Vertex*>(part->getEndVertex());
2176  ReconstructedParticle* svr=0;
2177  ReconstructedParticle* evr=0;
2178 
2179  if(sv!=0){
2180  svr = dynamic_cast<ReconstructedParticle*>(sv->getAssociatedParticle());
2181  }
2182  if(ev!=0){
2183  evr = dynamic_cast<ReconstructedParticle*>(ev->getAssociatedParticle());
2184  }
2185 
2186  out << setfill('0') << noshowpos << dec;
2187  out << " vertices: startVertex( id:[ " << setw(8) << (sv !=0? sv->id(): 0);
2188  out << "id_aRP: "<< setw(8) << ((sv != 0 && svr != 0) ? svr->id() : 0 );
2189  out << "] endVertex( id:[" << setw(8) << ( ev != 0 ? ev->id() : 0 );
2190  out << "], id_aRP:[" << setw(8) << ((ev != 0 && evr != 0) ? evr->id() : 0 ) << "]";
2191 
2192  out << noshowpos << setfill(' ') << dec;
2193  out << endl;
2194 
2195  return out;
2196  }
2197 
2198  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::ReconstructedParticle> ll){
2199  const EVENT::ReconstructedParticle *part = ll.object();
2200  const EVENT::LCCollection *col = ll.collection();
2201 
2202  stringstream tmp;
2203 
2204  out << setw(41) << setfill('-') << right << " ReconstructedParticle " << setfill('-') << setw(29) << "-" << endl;
2205  if(col != NULL){
2206  if(col->getTypeName() != LCIO::RECONSTRUCTEDPARTICLE){
2207  out << "Warning: collection not of type " << LCIO::RECONSTRUCTEDPARTICLE << endl ;
2208  return(out);
2209 
2210  }
2211  tmp.str("");
2212  tmp << "0x" << hex << col->getFlag() << dec;
2213  out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
2214  LCTOOLS::printParameters(col->getParameters());
2215  }
2216 
2217  tmp.str("");
2218  tmp<<"0x" << dec << part->id() << dec;
2219  out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
2220  out << dec << setw(30) << setfill(' ') << left << "Compound" << right << setw(40) << part->isCompound() << endl;
2221  out << setw(30) << setfill(' ') << left << "Type" << right << setw(40) << part->getType() << endl;
2222 
2223  tmp.str("");
2224  tmp << showpos << scientific << setprecision(2);
2225  tmp << part->getMomentum()[0] << ", " << part->getMomentum()[1] << ", " << part->getMomentum()[2];
2226  out << setw(30) << setfill(' ') << left << "Momentum (x,y,z)" << right << setw(40) << tmp.str() << endl;
2227 
2228  out << noshowpos << scientific << setprecision(2);
2229  out << setw(30) << setfill(' ') << left << "Mass [GeV]" << right << setw(40) << part->getMass() << endl;
2230 
2231  out << setw(30) << setfill(' ') << left << "Charge [e]" << right << setw(40) << part->getCharge() << endl;
2232  out << setw(30) << setfill(' ') << left << "Energy [GeV]" << right << setw(40) << part->getEnergy() << endl;
2233 
2234  tmp.str("");
2235  tmp << part->getReferencePoint()[0] << ", " << part->getReferencePoint()[1] << ", " << part->getReferencePoint()[2];
2236 
2237  out << setw(30) << setfill(' ') << left << "ReferencePoint" << right << setw(40) << tmp.str() << endl;
2238  out << setw(30) << setfill(' ') << left << "ParticleIDUsed";
2239 
2240 
2241  if(part->getParticleIDUsed() != 0 ){
2242  tmp.str("");
2243  tmp << dec << part->getParticleIDUsed()->id() << dec;
2244  out << dec << right << setw(40) << tmp.str() << endl;
2245  }else{
2246  out << right << setw(40) << 0 << endl;
2247  }
2248 
2249  out << setw(30) << setfill(' ') << left << "GoodnessOfPID" << right << setw(40) << part->getGoodnessOfPID() << endl;
2250 
2251  out << "Covariance p,E: "; //???
2252 
2253  for(int l=0;l<10;l++){
2254  if(l==5) { out << endl << " ";}
2255  if(l==9){
2256  out << scientific << setprecision(2) << part->getCovMatrix()[l];
2257  }else{
2258  out << scientific << setprecision(2) << part->getCovMatrix()[l] << ", ";
2259  }
2260  }
2261  //out << ")" << endl ;
2262 
2263  out << endl << "Particles id: ";
2264  for(unsigned int l=0;l<part->getParticles().size();l++){
2265  if(l == part->getParticles().size()-1){
2266  out << dec << setfill('0') << "[" <<setw(8) << part->getParticles()[l]->id() << "]";
2267  }else{
2268  out << dec << setfill('0') << "[" <<setw(8) << part->getParticles()[l]->id() << "], ";
2269  }
2270  if(! ((l+1)%4)) { out << endl <<" ";}
2271  }
2272  //out << endl ;
2273 
2274  out << endl << "Tracks id: ";
2275 
2276  for(unsigned int l=0,N=part->getTracks().size(); l<N ;l++){
2277  if(! ((l+1)%5)){ out << endl << " ";}
2278  out << dec << setfill('0') << "[" << setw(8)
2279  << ( part->getTracks()[l] ? part->getTracks()[l]->id() : 0 ) << "]" ;
2280 
2281  if( l != N-1 ) out << ", ";
2282  }
2283 
2284  out << endl << "Clusters id: ";
2285  for(unsigned int l=0,N=part->getClusters().size(); l<N ;l++){
2286 
2287  if(! ((l+1)%5)){ out << endl << " ";}
2288  out << dec << setfill('0') << "[" << setw(8)
2289  << ( part->getClusters()[l] ? part->getClusters()[l]->id() : 0 ) << "]";
2290 
2291  if(l != N-1) out << ", " ;
2292  }
2293 
2294  out << endl << "Particle ids ( [id], PDG, (type)): " << endl;
2295  for(unsigned int l=0;l<part->getParticleIDs().size();l++){
2296  ParticleID* pid = part->getParticleIDs()[l] ;
2297  out << dec << " " << "[" << setw(8) <<pid->id() << "], " << dec << setw(6) << pid->getPDG() << ", " << "(" << setw(6) <<pid->getType() << ") " << endl;
2298  }
2299  out << endl ;
2300 
2301  out << noshowpos;
2302  return(out);
2303  }
2304 
2305  //============================================================================
2306  // # TrackState
2307  //============================================================================
2308 
2310  static const std::string _h(" [ id ] | d0 | phi | omega | z0 | tan lambda| reference point(x,y,z) \n");
2311  return _h;
2312  }
2313 
2315  static const std::string _t("------------|----------|----------|----------|-----------|-----------|-------------------------------- \n");
2316  return _t;
2317  }
2318 
2319  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackState>& sV){
2320  const EVENT::TrackState *trk = sV.obj;
2321 
2322  out << noshowpos << " [" << setfill('0') << setw(8) << dec<< trk->id() << "] ";
2323  out << scientific << setprecision(6) << showpos << dec << setfill(' ');
2324  out << " |" << trk->getD0();
2325  out << " |" << trk->getPhi();
2326  out << " |" << trk->getOmega();
2327  out << " |" << setprecision (3) << trk->getZ0();
2328  out << " |" << trk->getTanLambda();
2329  out << " |(" << setprecision(2) << trk->getReferencePoint()[0] << ", " << trk->getReferencePoint()[1] << ", " <<trk->getReferencePoint()[2];
2330  out << endl;
2331 
2332  out << " cov matrix: " << showpos << scientific << setprecision(6) << setw(15) << setfill(' ') ;
2333 
2334  // print cov matrix as lower triangle matrix
2335  for( unsigned l=0 , N=trk->getCovMatrix().size(), ncolumns = 1 , nele =1 ; l <N ; ++l , ++nele) {
2336  out << trk->getCovMatrix()[l];
2337  if(! ( (nele) % ncolumns ) ){
2338  nele = 0 ;
2339  ++ncolumns ;
2340  out << " | " ; // separator for row
2341  } else {
2342  out << ", ";
2343  }
2344  }
2345  out << endl ;
2346 
2347 
2348  out << endl;
2349  return out;
2350  }
2351 
2352  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::TrackState> ll){
2353  const EVENT::TrackState *part = ll.object();
2354  const EVENT::LCCollection *col = ll.collection();
2355 
2356  stringstream tmp;
2357 
2358  //out << scientific << setprecision (2) << showpos;
2359  out << noshowpos;
2360  out << setw(41) << setfill('-') << right << "-- TrackState ---" << setfill('-') << setw(29) << "-" << endl;
2361  if(col != NULL){
2362  if(col->getTypeName() != LCIO::TRACKSTATE){
2363  out << "Warning: collection not of type " << LCIO::TRACKSTATE << endl ;
2364  return(out);
2365 
2366  }
2367  tmp.str("");
2368  tmp << "0x" << hex << col->getFlag() << dec;
2369  out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
2370  LCTOOLS::printParameters(col->getParameters());
2371  }
2372 
2373  tmp.str("") ;
2374  switch( part->getLocation() ){
2375  case EVENT::TrackState::AtOther : tmp << "AtOther" ; break ;
2376  case EVENT::TrackState::AtIP : tmp << "AtIP" ; break ;
2377  case EVENT::TrackState::AtFirstHit : tmp << "AtFirstHit" ; break ;
2378  case EVENT::TrackState::AtLastHit : tmp << "AtLastHit" ; break ;
2379  case EVENT::TrackState::AtCalorimeter : tmp << "AtCalorimeter " ; break ;
2380  case EVENT::TrackState::AtVertex : tmp << "AtVertex" ; break ;
2381  }
2382  out << setw(30) << setfill(' ') << left << "Location" << right << setw(40) << tmp.str() << endl;
2383  tmp.str("") ;
2384  tmp << dec << setfill('0') << setw(8) << part->id();
2385  out << scientific << setprecision(6) ;
2386  out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
2387  out << setw(30) << setfill(' ') << left << "D0" << right << setw(40) << part->getD0() << endl;
2388  out << setw(30) << setfill(' ') << left << "Phi" << right << setw(40) << part->getPhi() << endl;
2389  out << setw(30) << setfill(' ') << left << "Omega" << right << setw(40) << part->getOmega() << endl;
2390  out << setw(30) << setfill(' ') << left << "Z0" << right << setw(40) << part->getZ0() << endl;
2391  out << setw(30) << setfill(' ') << left << "Tan Lambda" << right << setw(40) << part->getTanLambda() << endl;
2392 
2393  tmp.str("");
2394  tmp << dec << part->getReferencePoint()[0] << ", " << part->getReferencePoint()[1] << ", " << part->getReferencePoint()[2];
2395  out << setw(30) << setfill(' ') << left << "ReferencePoint" << right << setw(40) << tmp.str() << endl;
2396 
2397  out << "Cov matrix:" << showpos << scientific << setprecision(6) << setw(15) << setfill(' ') ;
2398 
2399 
2400  // print cov matrix as lower triangle matrix
2401  for( unsigned l=0 , N=part->getCovMatrix().size(), ncolumns = 1 , nele =1 ; l <N ; ++l , ++nele) {
2402 
2403  out << part->getCovMatrix()[l];
2404 
2405  if(! ( (nele) % ncolumns ) ){
2406  nele = 0 ;
2407  ++ncolumns ;
2408  out << endl << " " ;
2409  } else {
2410  out << ", ";
2411  }
2412  }
2413 
2414  out << noshowpos;
2415  return(out);
2416  }
2417 
2418  //============================================================================
2419  // # Track
2420  //============================================================================
2421 
2422  const std::string& header(const EVENT::Track *){ //hauke
2423  static const std::string _h(" [ id ] | type | d0 | phi | omega | z0 | tan lambda| reference point(x,y,z) | dEdx | dEdxErr | chi2 | ndf \n");
2424  return _h;
2425  }
2426 
2427  const std::string& tail(const EVENT::Track *){ //hauke
2428  static const std::string _t("------------|----------|----------|----------|----------|-----------|-----------|---------------------------------|----------|----------|-------- \n");
2429  return _t;
2430  }
2431 
2432  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Track>& sV){ //hauke
2433  const EVENT::Track *trk = sV.obj;
2434  BitSet32 flag(0) ;
2435 
2436  if(sV.col != NULL){
2437  const EVENT::LCCollection *col = sV.col;
2438  flag=BitSet32(col->getFlag());
2439  }
2440 
2441  out << noshowpos << " [" << setfill('0') << setw(8) << dec<< trk->id() << "] ";
2442  out << "| " << dec << setw(8) << trk->getType();
2443  out << scientific << setprecision (2) << showpos << dec << setfill(' ');
2444  out << " |" << trk->getD0();
2445  out << " |" << trk->getPhi();
2446  out << " |" << trk->getOmega();
2447  out << " |" <<setprecision (3) << trk->getZ0();
2448  out << " |" << trk->getTanLambda();
2449  out << " |(" << setprecision(2) << trk->getReferencePoint()[0] << ", " << trk->getReferencePoint()[1] << ", " <<trk->getReferencePoint()[2];
2450  out << ")|" << trk->getdEdx();
2451  out << " |" << trk->getdEdxError();
2452  out << " |" << trk->getChi2();
2453  out << " |" << noshowpos << setw(5) << trk->getNdf() ;
2454  out << endl;
2455 
2456  out << " errors: " << showpos << scientific << setprecision(6) << setw(15) << setfill(' ') ;
2457 
2458  // print cov matrix as lower triangle matrix
2459  for( unsigned l=0 , N=trk->getCovMatrix().size(), ncolumns = 1 , nele =1 ; l <N ; ++l , ++nele) {
2460  out << trk->getCovMatrix()[l];
2461  if(! ( (nele) % ncolumns ) ){
2462  nele = 0 ;
2463  ++ncolumns ;
2464  out << " | " ; // separator for row
2465  } else {
2466  out << ", ";
2467  }
2468  }
2469  out << endl ;
2470 
2471  out << " tracks(id): " ;
2472  const TrackVec& tracks = trk->getTracks() ;
2473 
2474  for(unsigned int l=0,N=tracks.size(); l<N ;l++){
2475 
2476  out << dec << setfill('0') << "[" << setw(8) << dec
2477  << ( tracks[l] ? tracks[l]->id() : 0 ) << "]" ;
2478 
2479  if( l != N-1 ) out << ", ";
2480  }
2481 
2482  out << endl;
2483  if(sV.col != NULL){
2484  if(flag.test(LCIO::TRBIT_HITS)){
2485  out << " hits ->";
2486  const TrackerHitVec& hits= trk->getTrackerHits() ;
2487  for(unsigned l=0;l<hits.size();l++){
2488  out << "[" << setfill('0') << setw(8) << ( hits[l] ? hits[l]->id() : 0 ) << "] ";
2489  }
2490  out << endl;
2491  }
2492  }
2493 
2494  out << " radius of innermost hit " << trk->getRadiusOfInnermostHit() << " / mm , " << " subdetector Hit numbers : "
2495  << setfill(' ') << dec << fixed ;
2496  for(unsigned l=0 ; l< trk->getSubdetectorHitNumbers().size(); l++) {
2497  out << trk->getSubdetectorHitNumbers()[l];
2498  if(l < trk->getSubdetectorHitNumbers().size()-1){
2499  out << ", ";
2500  }
2501  }
2502  out << endl;
2503 
2504  return out;
2505  }
2506 
2507  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::Track> ll){
2508  const EVENT::Track *part = ll.object();
2509  const EVENT::LCCollection *col = ll.collection();
2510 
2511  stringstream tmp;
2512 
2513  //out << scientific << setprecision (2) << showpos;
2514  out << noshowpos;
2515  out << setw(41) << setfill('-') << right << "-- Track ---" << setfill('-') << setw(29) << "-" << endl;
2516 
2517  if(col != NULL){
2518  if(col->getTypeName() != LCIO::TRACK){
2519  out << "Warning: collection not of type " << LCIO::TRACK << endl ;
2520  return(out);
2521 
2522  }
2523  tmp.str("");
2524  tmp << "0x" << hex << col->getFlag() << dec;
2525  out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
2526  LCTOOLS::printParameters(col->getParameters());
2527  BitSet32 flag( col->getFlag() ) ;
2528  out << " LCIO::TRBIT_HITS : " << flag.test( LCIO::TRBIT_HITS ) << endl ;
2529 
2530  }
2531 
2532  tmp << dec << setfill('0') << setw(8) << part->id();
2533  out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
2534  out << setw(30) << setfill(' ') << left << "Type" << right << setw(40) << part->getType() << endl;
2535  // out << setw(30) << setfill(' ') << left << "D0" << right << showpos << setw(40) << part->getD0() << endl;
2536  // out << setw(30) << setfill(' ') << left << "Phi" << right << setw(40) << part->getPhi() << endl;
2537  // out << setw(30) << setfill(' ') << left << "Omega" << right << setw(40) << part->getOmega() << endl;
2538  // out << setw(30) << setfill(' ') << left << "Z0" << right << setw(40) << part->getZ0() << endl;
2539  // out << setw(30) << setfill(' ') << left << "Tan Lambda" << right << setw(40) << part->getTanLambda() << endl;
2540  // tmp.str("");
2541  // tmp << dec << part->getReferencePoint()[0] << ", " << part->getReferencePoint()[1] << ", " << part->getReferencePoint()[2];
2542  // out << setw(30) << setfill(' ') << left << "ReferencePoint" << right << setw(40) << tmp.str() << endl;
2543  out << setw(30) << setfill(' ') << left << "dEdx" << right << setw(40) << part->getdEdx() << endl;
2544  out << setw(30) << setfill(' ') << left << "dEdx Error" << right << setw(40) << part->getdEdxError() << endl;
2545  out << setw(30) << setfill(' ') << left << "Chi2" << right << setw(40) << part->getChi2() << endl;
2546  out << setw(30) << setfill(' ') << left << "Ndf" << right << setw(40) << noshowpos << part->getNdf() << endl;
2547 
2548  // out << "Errors: " << showpos;
2549  // unsigned int l;
2550  // for(l=0;l<14;l++){
2551  // out << part->getCovMatrix()[l];
2552  // if(! ((l+1)%5)){
2553  // out << endl << " ";
2554  // } else{
2555  // out << ", ";
2556  // }
2557  // }
2558  // if(!((l+2)%5)){out << endl << " ";}
2559  // out << part->getCovMatrix()[l+1] << endl;
2560 
2561  for(unsigned i=0,N=part->getTrackStates().size() ; i<N ; ++i ){
2562 
2563  out << *part->getTrackStates()[i] ;
2564  }
2565 
2566 
2567  out << "Tracks(id): " ;
2568  const TrackVec& tracks = part->getTracks() ;
2569 
2570  for(unsigned l=0;l<tracks.size();l++){
2571  if( tracks[l] != 0 )
2572  out << tracks[l]->id();
2573  else
2574  out << 0;
2575 
2576 
2577  if(!(l+1)%5){
2578  out << endl << " ";
2579  continue;
2580  }
2581  if(l != tracks.size()-1){ out << ", ";}
2582 
2583  }
2584 
2585  out << endl << "Hits: " << noshowpos;
2586  const TrackerHitVec& hits= part->getTrackerHits() ;
2587  for(unsigned l=0;l<hits.size();l++){
2588  out << "[" << ( hits[l] ? hits[l]->id() : 0 ) << "] ";
2589  if(!((l+1)%7)){out << endl << " ";}
2590  }
2591  out << endl;
2592 
2593  out << "Radius of innermost hit " << part->getRadiusOfInnermostHit() << " / mm , " << " subdetector Hit numbers : " ;
2594  out << endl << " ";
2595  // for(l=0 ; l< part->getSubdetectorHitNumbers().size()-1 ; l++) {
2596  // out << part->getSubdetectorHitNumbers()[l] << ", " ;
2597  // if(!((l+1)%20)){out << endl << " ";}
2598  // }
2599  // if(!((l+2)%20)){out << endl << " ";}
2600  // out << part->getSubdetectorHitNumbers()[l+1] << endl;
2601  for(unsigned l=0 ; l< part->getSubdetectorHitNumbers().size(); l++) {
2602  out << part->getSubdetectorHitNumbers()[l];
2603  if(l < part->getSubdetectorHitNumbers().size()-1){
2604  out << ", ";
2605  }
2606  }
2607  out << endl;
2608 
2609  out << noshowpos;
2610  return(out);
2611  }
2612 
2613  //============================================================================
2614  // # Cluster
2615  //============================================================================
2616 
2617  const std::string& header(const EVENT::Cluster *){ //hauke
2618  static const std::string _h(" [ id ] |type| energy |energyerr | position ( x,y,z) | itheta | iphi \n");
2619  return _h;
2620  }
2621 
2622  const std::string& tail(const EVENT::Cluster *){ //hauke
2623  static const std::string _t("------------|----|----------|----------|----------------------------------|----------|----------\n");
2624  return _t;
2625  }
2626 
2627  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Cluster>& sV){ //hauke
2628  const EVENT::Cluster * clu = sV.obj;
2629  const EVENT::LCCollection *col = sV.col;
2630 
2631  BitSet32 flag( col->getFlag() ) ;
2632 
2633  out << noshowpos << " [" << setfill('0') << setw(8) << dec << clu->id() << "] |" << dec;
2634  out << setfill(' ') << setw(4) << clu->getType() << "|";
2635  out << showpos << scientific << setprecision(3) << clu->getEnergy() << "|" << clu->getEnergyError() << "|";
2636  out << clu->getPosition()[0] << ", " << clu->getPosition()[1] << ", " << clu->getPosition()[2] << "|";
2637  out << clu->getITheta() << "|";
2638  out << clu->getIPhi();
2639 
2640  out << " errors (6 pos)/( 3 dir): (" ;
2641  for(int l=0;l<6;l++){
2642  out << setw(4) << clu->getPositionError()[l] << ", ";
2643  }
2644  out << ")/(";
2645  for(int l=0;l<3;l++){
2646  out << setw(4) << clu->getDirectionError()[l];
2647  }
2648  out << ")" << endl ;
2649  out << " clusters(e): " ;
2650  const ClusterVec& clusters = clu->getClusters() ;
2651  for(unsigned int l=0;l<clusters.size();l++){
2652  out << setw(4) << ( clusters[l] ? clusters[l]->getEnergy() : 0. ) << ", ";
2653  }
2654  out << endl ;
2655  out <<" subdetector energies : " ;
2656  const FloatVec& sdE = clu->getSubdetectorEnergies() ;
2657  for(unsigned int l=0;l<sdE.size();l++){
2658  out << setw(4) << sdE[l] << ", ";
2659  }
2660  out << endl ;
2661 
2662 
2663  if( flag.test( LCIO::CLBIT_HITS ) ) {
2664  out << " hits ->";
2665  const CalorimeterHitVec& hits= clu->getCalorimeterHits() ;
2666  const FloatVec& contr = clu->getHitContributions() ;
2667  for(unsigned int k=0;k<hits.size();k++){
2668  out << "[" << setfill('0' ) << dec << setw(8) << ( hits[k] ? hits[k]->id() : 0 ) << "]"
2669  << "(" << scientific << setprecision (2) << showpos << dec << setfill(' ') << contr[k] << ") " ;
2670  if( ! ( (k+1) % 10 ) ) out << std::endl ;
2671  }
2672  }
2673 
2674  out << endl;
2675 
2676  out << dec << noshowpos;
2677  return out;
2678  }
2679 
2680  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::Cluster> l) {
2681  const EVENT::Cluster *clu = l.object();
2682  const EVENT::LCCollection *col = l.collection();
2683 
2684  //out << "lcio_long: Cluster : lcio_long" << std::endl;
2685 
2686  stringstream tmp;
2687  out << noshowpos;
2688  out << setw(41) << setfill('-') << right << " Cluster " << setfill('-') << setw(29) << "-" << endl;
2689 
2690  if(col != NULL){
2691  if(col->getTypeName() != LCIO::CLUSTER){
2692  out << "Warning: collection not of type " << LCIO::CLUSTER << endl ;
2693  return(out);
2694 
2695  }
2696  tmp.str("");
2697  tmp << "0x" << hex << col->getFlag() << dec;
2698  out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
2699  LCTOOLS::printParameters(col->getParameters());
2700  BitSet32 flag( col->getFlag() ) ;
2701  out << " LCIO::CLBIT_HITS : " << flag.test( LCIO::CLBIT_HITS ) << endl ;
2702 
2703  }
2704 
2705 
2706  tmp << dec << clu->id();
2707  out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
2708  out << setw(30) << setfill(' ') << left << "Type"<< setfill(' ') << right << setw(40) << clu->getType() << endl;
2709  out << setw(30) << left << "Energy [GeV]" << right << setw(40) << clu->getEnergy() << endl;
2710  out << setw(30) << left << "EnergyError [GeV]" << right << setw(40) << clu->getEnergyError() << endl;
2711  tmp.str("");
2712  tmp << dec << clu->getPosition()[0] << ", " << clu->getPosition()[1] << ", " << clu->getPosition()[2];
2713  out << setw(30) << left << "Position [mm] (x,y,z) " << setfill(' ') << right <<setw(40) << tmp.str() << endl;
2714  out << setw(30) << left << "itheta" << setfill(' ') << right <<setw(40) << clu->getITheta() << endl;
2715  out << setw(30) << left << "iphi" << setfill(' ') << right <<setw(40) << clu->getIPhi() << endl;
2716  //to much output
2717  /*
2718  //raw code from LCTOOLS.cc
2719  out << " errors (6 pos)/( 3 dir): (" ;
2720  for(int l=0;l<6;l++){
2721  printf("%4.2e, ", clu->getPositionError()[l] ) ;
2722  }
2723  out << ")/(" ;
2724  for(int l=0;l<3;l++){
2725  printf("%4.2e, ", clu->getDirectionError()[l] ) ;
2726  }
2727  out << ")" << endl ;
2728  out << " clusters(e): " ;
2729  const ClusterVec& clusters = clu->getClusters() ;
2730 
2731  for(unsigned int l=0;l<clusters.size();l++){
2732  printf("%4.2e, ", clusters[l]->getEnergy() ) ;
2733  }
2734  out << endl ;
2735  out <<" subdetector energies : " ;
2736  const FloatVec& sdE = clu->getSubdetectorEnergies() ;
2737  for(unsigned int l=0;l<sdE.size();l++){
2738  printf("%4.2e, ", sdE[l] ) ;
2739  }
2740  const CalorimeterHitVec& hits= clu->getCalorimeterHits() ;
2741  const FloatVec& contr = clu->getHitContributions() ;
2742  for(unsigned int k=0;k<hits.size();k++){
2743  printf( " [%8.8x] (%4.3e), " , hits[k]->id(), contr[k] ) ;
2744  // out << "0x" << hits[k] << "(" << contr[k] << "), " ;
2745  }
2746  out << dec << endl ;
2747  */
2748 
2749  return(out);
2750  }
2751 
2752  //============================================================================
2753  // # Vertex
2754  //============================================================================
2755 
2757  static const std::string _h( "\n[ id ] |pri| alg. type | chi2 | prob. | position ( x, y, z) | [par] | [idRecP] \n");
2758  return _h;
2759  }
2760 
2761  const std::string& tail(const EVENT::Vertex *){
2762  static const std::string _t( "------------|---|-------------------|-----------|-----------|---------------------------------|-------|------------\n");
2763  return _t;
2764  }
2765 
2766  std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Vertex>& sV){
2767 
2768  const EVENT::Vertex* v = sV.obj;
2769  out << noshowpos;
2770  out << setfill('0');
2771  out << " [" << setw(8) << dec << v->id() << "] | " << v->isPrimary()<< " | ";
2772  out << setfill(' ') << setw(17) << left << v->getAlgorithmType() << " | ";
2773  out << showpos;
2774 
2775  out << setfill('0') << right << scientific << setprecision(2) << v->getChi2() << " | " << v->getProbability() << " | " <<
2776  v->getPosition()[0] << ", " << v->getPosition()[1] << ", " << v->getPosition()[2] << " | [" ;
2777 
2778  out << setw(3) << v->getParameters().size() << "] | [";
2779  out << setw(8) << dec << (v->getAssociatedParticle()!=NULL?v->getAssociatedParticle()->id():0) << "]\n";
2780 
2781  out << noshowpos;
2782  return out;
2783  }
2784 
2785  std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::Vertex> ll){
2786  const EVENT::Vertex *v = ll.object();
2787  const EVENT::LCCollection *col = ll.collection();
2788 
2789  stringstream tmp;
2790  out << noshowpos;
2791 
2792  out << setw(41) << std::setfill('-') << right << " Vertex " << setfill('-') << setw(29) << "-" << endl;
2793  if(col != NULL){
2794  if(col->getTypeName() != LCIO::VERTEX){
2795  out << "Warning: collection not of type " << LCIO::VERTEX << endl ;
2796  return(out);
2797  }
2798  }
2799 
2800  tmp.str("");
2801  tmp << dec << v->id() << dec;
2802 
2803  out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
2804  out << setw(30) << setfill(' ') << left << "Is Primary Vertex" << right << setw(40) << (v->isPrimary() ? "yes":"no") << endl;
2805  out << setw(30) << setfill(' ') << left << "Algorithm Type" << right << setw(40) << v->getAlgorithmType() << endl;
2806  out << scientific << setprecision(5);
2807 
2808  out << setw(30) << setfill(' ') << left << "Chi2" << right << setw(40) << v->getChi2() << endl;
2809  out << setw(30) << setfill(' ') << left << "Probability" << right << setw(40) << v->getProbability() << endl;
2810  tmp.str("");
2811  tmp<<setprecision(5);
2812  tmp << v->getPosition()[0] <<", "<<v->getPosition()[1] <<", "<<v->getPosition()[2];
2813  out << setw(30) << setfill(' ') << left << "Position (x,y,z)" << right << setw(40) << tmp.str() << endl;
2814 
2815  out << "Covariance Matrix ";
2816  for(unsigned int i=0; i<v->getCovMatrix().size(); i++){
2817  out << v->getCovMatrix()[i] << (i<(v->getCovMatrix().size()-1)?", ":"\n");
2818  if((! ((i+1)%3)) && i < v->getCovMatrix().size()- 1){ out << endl << " "; }
2819  }
2820 
2821  out << setw(30) << setfill(' ') << left << "Parameters";
2822 
2823  if(v->getParameters().size()==0){
2824  out << right << setw(40) << "[Empty]" << endl;
2825  } else { out << endl; }
2826 
2827  for(unsigned int i=0; i < v->getParameters().size(); i++){
2828  out << " Parameter [";
2829  out << setw(3) << i << "]:\t";
2830  out << scientific << setprecision(5) << v->getParameters()[i] << endl;
2831  }
2832 
2833  out << setw(30) << setfill(' ') << left << "ARP ID" << right << setw(40) << (v->getAssociatedParticle()!=NULL?v->getAssociatedParticle()->id():0) << endl;
2834 
2835  return out;
2836  }
2837 
2838 } // namespace
2839 
2840 using namespace UTIL ;
2841 
2842 // see header file for namespace change here
2843 namespace EVENT {
2844 
2846  out<<lcio_long(hit,NULL);
2847  return out;
2848  }
2849 
2851  out<<lcio_long(hit,NULL);
2852  return out;
2853  }
2854 
2856  out<<lcio_long(hit,NULL);
2857  return out;
2858  }
2859 
2861  out<<lcio_long(hit,NULL);
2862  return out;
2863  }
2864 
2866  out<<lcio_long(hit,NULL);
2867  return out;
2868  }
2869 
2871  out << lcio_long(v,NULL);
2872  return out;
2873  }
2874 
2876  out<<lcio_long(hit,NULL);
2877  return out;
2878  }
2879 
2881  out<<lcio_long(hit,NULL);
2882  return out;
2883  }
2884 
2886  out << lcio_long(v,NULL);
2887  return out;
2888  }
2889 
2891  out<<lcio_long(hit,NULL);
2892  return out;
2893  }
2894 
2895  std::ostream& operator<<( std::ostream& out, const EVENT::LCIO &hit){ //hauke
2896  out<<lcio_long(hit,NULL);
2897  return out;
2898  }
2899 
2901  out<<lcio_long(hit,NULL);
2902  return out;
2903  }
2904 
2906  out<<lcio_long(hit,NULL);
2907  return out;
2908  }
2909 
2911  out<<lcio_long(hit,NULL);
2912  return out;
2913  }
2914 
2916  out<<lcio_long(hit,NULL);
2917  return out;
2918  }
2919 
2921  out<<lcio_long(hit,NULL);
2922  return out;
2923  }
2924 
2926  out<<lcio_long(hit,NULL);
2927  return out;
2928  }
2929 
2931  out << lcio_long(hit,NULL);
2932  return out;
2933  }
2934 
2936  out << lcio_long(hit,NULL);
2937  return out;
2938  }
2939 
2941  out << lcio_long(hit,NULL);
2942  return out;
2943  }
2944 
2946  out << lcio_long(hit,NULL);
2947  return(out);
2948  }
2949 
2951  out << lcio_long(hit,NULL);
2952  return(out);
2953  }
2954 
2956  out << lcio_long(mcp,NULL);
2957  return out;
2958  }
2959 
2961  out << lcio_long(part,NULL);
2962  return(out);
2963  }
2964 
2966  out << lcio_long(part,NULL);
2967  return(out);
2968  }
2969 
2971  out << lcio_long(part,NULL);
2972  return(out);
2973  }
2974 
2976  out << lcio_long(clu,NULL);
2977  return(out);
2978  }
2979 
2981  out << lcio_long(v,NULL);
2982  return out;
2983  }
2984 
2985 }
virtual const TrackVec & getTracks() const =0
The tracks that have been combined to this track.
virtual const double * getPosition() const =0
Returns the hit position in [mm].
The generic object that is held in an LCCollection.
Definition: LCObject.h:30
virtual float getITheta() const =0
Intrinsic direction of cluster at position: Theta.
virtual bool isTransient() const =0
True if collection is transient, i.e.
virtual const ParticleIDVec & getParticleIDs() const =0
The particle Id&#39;s sorted by their likelihood.
virtual float getChi2() const =0
Chi squared of the vertex fit.
const std::string & header(const EVENT::Vertex *)
operator for detailed output of a vertex object (e.g.
Definition: Operators.cc:2756
A generic tracker hit to be used by pattern recognition.
Definition: TrackerHit.h:26
virtual int getCellID1() const =0
Returns the second detector specific (geometrical) cell id.
virtual int getCellID1() const =0
Returns the second detector specific (geometrical) cell id.
virtual const ReconstructedParticleVec & getParticles() const =0
The reconstructed particles that have been combined to this particle.
virtual int getCellID0() const =0
Returns the detector specific (geometrical) cell id.
virtual const MCParticleVec & getParents() const =0
Returns the parents of this particle.
virtual int getTime() const =0
Returns a time measurement associated with the adc values, e.g.
virtual const TrackStateVec & getTrackStates() const =0
Returns track states associtated to this track.
virtual const FloatVec & getCovMatrix() const =0
Covariance matrix of the charge (c) and time (t) measurements.
T empty(T...args)
virtual float getEDep() const =0
The energy deposited on the hit [GeV].
virtual const double * getPosition() const =0
The hit position in [mm].
virtual int getPDGCont(int i) const =0
Returns the PDG code of the shower particle that caused this contribution.
The generic simulated calorimeter hit.
virtual Vertex * getEndVertex() const =0
The vertex where the particle decays This method actually returns the start vertex from the first dau...
virtual const FloatVec & getParameters() const =0
Additional parameters related to this vertex - check/set the collection parameter &quot;VertexParameterNa...
static const int AtVertex
Definition: TrackState.h:42
virtual double getEnergy() const =0
Energy of the reconstructed particle - only float used in files.
virtual int getType() const =0
Type - userdefined.
The Vertex class for LCIO.
Definition: Vertex.h:34
virtual int getNDouble() const =0
Number of double values stored in this object.
virtual int getType() const =0
Type of raw data hit, either one of LCIO::TPCHIT LCIO::SIMTRACKERHIT
virtual float getTanLambda() const =0
Lambda is the dip angle of the track in r-z at the reference point.
virtual int id() const =0
Returns an object id for internal (debugging) use in LCIO.
virtual int getType() const =0
Type of reconstructed particle.
virtual const std::string & getDetectorName() const =0
Returns the name of the detector setup used in the simulation.
virtual double getWeight() const =0
Returns the event weight.
virtual LCObject * getTo() const =0
The &#39;to&#39; object of the given relation.
virtual int getCellID1() const =0
Returns the second detector specific (geometrical) cell id.
virtual const float * getStepPosition(int i) const =0
Returns the position where the energy deposited (step) occurred optional, only if bit LCIO::CHBIT_STE...
virtual const double * getMomentumAtEndpoint() const =0
Returns the particle&#39;s 3-momentum at the endpoint in [GeV] Only float used in files.
static const int AtIP
Definition: TrackState.h:38
Interface for the run header.
Definition: LCRunHeader.h:23
virtual float getCharge() const =0
Charge of the reconstructed particle.
virtual const float * getCenter() const =0
Radius of cylinder.
lcio_short< T > lcshort(const T *t, const EVENT::LCCollection *b=NULL)
Definition: Operators.h:74
virtual float getFloatVal(int index) const =0
Returns the float value for the given index.
virtual float getOmega() const =0
Omega is the signed curvature of the track in [1/mm].
virtual const CalorimeterHitVec & getCalorimeterHits() const =0
The hits that have been combined to this cluster.
virtual const float * getReferencePoint() const =0
Reference point of the track parameters.
virtual const FloatVec & getCovMatrix() const =0
Covariance matrix of the track parameters.
virtual bool isPrimary() const =0
Checks if the Vertex is the primary vertex of the event.
A tracker hit on a planar surface - the hit is stored as: x,y,z, u(theta, phi), v(theta,phi), du, dv where (x,y,z) is the position in global cartesian coordinates, u,v are the the meassurement directions (unit vectors, spanning the plane) and du,dv are the measurement errors along these directions.
int id() const
Returns an object id for internal (debugging) use in LCIO.
Definition: LCIntVec.h:34
A generic simulated tracker hit.
Definition: SimTrackerHit.h:23
virtual const float * getV() const =0
Direction of second measurement - given as (theta, phi).
virtual MCParticle * getParticleCont(int i) const =0
Returns the MCParticle that caused the shower responsible for this contribution to the hit...
T endl(T...args)
virtual int getCellID1() const =0
Same name as in CalorimeterHit, even though there are no &#39;cells&#39; in this case Optional, check/set flag(LCIO::RTHZBIT_ID1)==1.
T right(T...args)
virtual const TrackerHitVec & getTrackerHits() const =0
Optionaly ( check/set flag(LCIO::TRBIT_HITS)==1) return the hits that have been used to create this t...
virtual float getRadiusOfInnermostHit() const =0
The radius of the innermost hit that has been used in the track fit.
virtual float getEnergyError() const =0
Returns the error of the hit energy in [GeV].
The LCIO TrackState class.
Definition: TrackState.h:26
virtual float getEnergyCont(int i) const =0
Returns the energy in [GeV] of the i-th contribution to the hit.
virtual int getCellID1() const =0
Returns the second detector specific (geometrical) cell id.
virtual float getLengthCont(int i) const =0
Returns the step length of the i-th contribution to the hit.
virtual const ClusterVec & getClusters() const =0
The clusters that have been combined to this cluster.
virtual const FloatVec & getHitContributions() const =0
Returns the energy contribution of the hits Runs parallel to the CalorimeterHitVec from getCalorimete...
virtual int getPDG() const =0
Returns the PDG code of the particle.
T end(T...args)
virtual int getAmplitude() const =0
Returns the amplitude of the hit in ADC counts.
virtual int getNFloat() const =0
Number of float values stored in this object.
virtual float getdU() const =0
Measurement error along u.
virtual const float * getMomentum() const =0
Returns the 3-momentum of the particle at the hits position in [GeV] - optional, only if bit LCIO::TH...
virtual int getRunNumber() const =0
Return the run number off this event.
virtual const FloatVec & getCovMatrix() const =0
Covariance matrix of the position (stored as lower triangle matrix, i.e.
virtual float getdEdx() const =0
dEdx of the track.
virtual const std::vector< std::string > * getCollectionNames() const =0
Returns the names of the collections in the event.
virtual float getLikelihood() const =0
The likelihood of this hypothesis - in a user defined normalization.
Convenient helper class for setting single bits in a 32bit-field, such as collection flags or hit typ...
Definition: BitSet32.h:31
TrackerData contains the corrected (calibrated) raw tracker data.
Definition: TrackerData.h:23
virtual float getTime() const =0
The time of the pulse - arbitrary units.
virtual const std::string getDataDescription() const =0
The description string.
virtual double getDoubleVal(int index) const =0
Returns the double value for the given index.
virtual double getMass() const =0
Returns the mass of the particle in [GeV] - only float used in files.
virtual const FloatVec & getCovMatrix() const =0
Covariance of the position (x,y,z), stored as lower triangle matrix.
virtual const FloatVec & getPositionError() const =0
Covariance matrix of the position (6 Parameters)
virtual float getD0() const =0
Impact paramter of the track in (r-phi).
virtual float getCharge() const =0
The integrated charge of the pulse - arbitrary units.
std::ostream & operator<<(std::ostream &os, const LCIORandomAccess &ra)
virtual const ClusterVec & getClusters() const =0
The weights of the reconstructed particles combined to this particle.
virtual const std::string & getAlgorithmType() const =0
Type code for the algorithm that has been used to create the vertex - check/set the collection parame...
std::vector< std::string > LCStrVec
Header file for the f77-wrapper functions for stl vectors.
Definition: lcvec.h:17
virtual float getD0() const =0
Impact paramter of the track in (r-phi).
virtual int getCellID0() const =0
Returns the detector specific (geometrical) cell id.
T setw(T...args)
virtual float getEnergyError() const =0
Returns the error on the energy of the cluster.
virtual long64 getTimeStamp() const =0
Returns the time stamp of the event.
static const int AtFirstHit
Definition: TrackState.h:39
virtual const FloatVec & getCovMatrix() const =0
Covariance matrix of the track parameters.
STL class.
virtual float getWeight() const =0
The weight of the given relation - only if collection flag bit LCIO::LCREL_WEIGHTED is set...
virtual int getCellID0() const =0
Returns the first detector specific (geometrical) cell id.
T test(T...args)
virtual int getLocation() const =0
The location of the track state.
virtual const float * getPosition() const =0
Returns the position of the hit in world coordinates.
virtual int getFlag() const =0
Returns flag word for collection.
virtual double getEnergy() const =0
Returns the energy of the particle (at the vertex) in [GeV] computed from the particle&#39;s momentum and...
T noshowpos(T...args)
Tracker pulses as computed from TrackerData objects or as directly measured by a specific subdetector...
Definition: TrackerPulse.h:26
virtual bool isCompound() const =0
Return particles primary flag.
virtual int getCellID0() const =0
Same name as in CalorimeterHit, even though there are no &#39;cells&#39; in this case.
virtual float getdV() const =0
Measurement error along v.
T what(T...args)
virtual float getEDep() const =0
The energy deposited on the hit [GeV].
virtual MCParticle * getMCParticle() const =0
Returns the MC particle that caused the hit.
virtual int getFlag() const =0
Returns the flag word.
virtual int getGeneratorStatus() const =0
Returns the status for particles as defined by the generator, typically 0 empty line 1 undecayed ...
virtual int getRunNumber() const =0
Returns the run number.
virtual float getdEdxError() const =0
Error of dEdx.
virtual float getdZ() const =0
Measurement error along z.
virtual int getCellID1() const =0
Same name as in CalorimeterHit, even though there are no &#39;cells&#39; in this case Optional, check/set flag(LCIO::RTHBIT_ID1)==1.
virtual LCCollection * getCollection(const std::string &name) const =0
Returns the collection for the given name.
virtual const double * getVertex() const =0
Returns the production vertex of the particle in [mm].
virtual int getNInt() const =0
Number of integer values stored in this object.
Simple interface to store generic named parameters of type int, float and string. ...
Definition: LCParameters.h:28
virtual const FloatVec & getDirectionError() const =0
Covariance matrix of the direction (3 Parameters).
The LCIO cluster.
Definition: Cluster.h:30
virtual int getIntVal(int index) const =0
Returns the integer value for the given index.
virtual int getSimulatorStatus() const =0
Returns the status for particles from the simulation, e.g.
T setfill(T...args)
virtual int getNdf() const =0
Number of degrees of freedom of the track fit.
virtual bool isSubset() const =0
True if the collection holds a subset of objects from other collections.
virtual const float * getU() const =0
Direction of first measurement - given as (theta, phi).
The LCIO track class.
Definition: Track.h:33
Convenient class for decoding cellIDs from collection parameter LCIO::CellIDEncoding.
Definition: CellIDDecoder.h:29
T str(T...args)
virtual int getCellID1() const =0
Returns the second detector specific (geometrical) cell id.
Int vector used for user extensions.
Definition: LCIntVec.h:24
virtual const FloatVec & getCovMatrix() const =0
Covariance matrix of the reconstructed particle&#39;s 4vector (10 parameters).
virtual int getCellID1() const =0
Same name as in CalorimeterHit, even though there are no &#39;cells&#39; in this case Optional, check/set flag(LCIO::THBIT_ID1)==1.
Float vector used for user extensions.
Definition: LCFloatVec.h:25
virtual float getZ0() const =0
Impact paramter of the track in (r-z).
virtual const float * getReferencePoint() const =0
Reference point of the track parameters, e.g.
virtual int getTimeStamp() const =0
Returns a time stamp for the hit.
virtual const std::string & getTypeName() const =0
Returns the type name of the collection - valid names are defined in LCIO.
virtual float getChi2() const =0
True if the reference point is the point of closest approach.
Simple interface to store generic user data.
virtual const FloatVec & getChargeValues() const =0
The corrected (calibrated) FADC spectrum.
virtual float getGoodnessOfPID() const =0
The overall goodness of the PID on a scale of [0;1].
virtual const std::string & getDetectorName() const =0
Returns the name of the detector setup used in the simulation.
virtual float getTanLambda() const =0
Lambda is the dip angle of the track in r-z at the reference point.
virtual float getTime() const =0
The time of the hit in [ns].
virtual float getEnergy() const =0
Returns the energy of the hit in [GeV].
virtual float getTime() const =0
Returns a time measurement associated with the adc values, e.g.
STL class.
virtual const float * getPosition() const =0
Position of the cluster.
virtual int getCellID0() const =0
Same name as in CalorimeterHit, even though there are no &#39;cells&#39; in this case.
The LCIO reconstructedParticle.
virtual int getType() const =0
Flagword that defines the type of cluster.
The LCIO Monte Carlo particle.
Definition: MCParticle.h:27
virtual int getType() const =0
Type of hit.
T scientific(T...args)
virtual float getZ0() const =0
Impact paramter of the track in (r-z).
virtual const float * getPosition() const =0
Returns the position of the hit in world coordinates.
virtual int getNumberOfElements() const =0
Returns the number of elements in the collection.
virtual const LCParameters & getParameters() const =0
Parameters defined for this run.
Persistent interface for LCIO ParticleIDs.
Definition: ParticleID.h:28
A single weighted relationship between two LCObjects.
Definition: LCRelation.h:29
virtual float getEDepError() const =0
The error measured on EDep [GeV].
virtual const IntVec & getSubdetectorHitNumbers() const =0
A vector that holds the number of hits in particular subdetectors.
T size(T...args)
const std::string & tail(const EVENT::Vertex *)
Definition: Operators.cc:2761
virtual float getCharge() const =0
Returns the particle&#39;s charge.
virtual int getCellID0() const =0
Returns the first detector specific (geometrical) cell id.
virtual const float * getPosition() const =0
Position of the vertex.
The generic calorimeter hit for real data (or simulation thereof).
virtual int getNMCContributions() const =0
Returns the number of MC contributions to the hit.
LCIO_LONG< T > lcio_long(const T &o, const EVENT::LCCollection *c)
Definition: Operators.h:175
virtual ReconstructedParticle * getAssociatedParticle() const =0
Returns Reconstructed Particle associated to the Vertex.
virtual int getCellID1() const =0
Same name as in CalorimeterHit, even though there are no &#39;cells&#39; in this case Optional, check/set flag(LCIO::RTHPBIT_ID1)==1.
The main event interface.
Definition: LCEvent.h:31
Generic class for raw tracker data.
virtual int getQuality() const =0
The quality bit flag of the hit.
The generic collection used in LCIO.
Definition: LCCollection.h:29
virtual Vertex * getStartVertex() const =0
The start vertex associated to this particle.
A tracker hit on a cylindrical surface that runs parallel to the z-axis - the hit is stored as: x...
T begin(T...args)
virtual LCObject * getFrom() const =0
The &#39;from&#39; object of the given relation.
virtual int getAlgorithmType() const =0
Type of the algorithm/module that created this hypothesis - NOTE: must be unique within one collectio...
virtual int getCellID0() const =0
Returns the first detector specific (geometrical) cell id.
virtual float getPathLength() const =0
The path length of the particle in the sensitive material that resulted in this hit.
virtual int getEventNumber() const =0
Returns this event&#39;s number .
virtual const std::string & getDescription() const =0
Description of the simulation, physics channels etc.
int id() const
Returns an object id for internal (debugging) use in LCIO.
Definition: LCFloatVec.h:35
virtual float getOmega() const =0
Omega is the signed curvature of the track in [1/mm].
static const int AtLastHit
Definition: TrackState.h:40
virtual float getProbability() const =0
Probability of the vertex fit.
virtual int getCellID1() const =0
Returns the second detector specific (geometrical) cell id.
virtual int getCellID0() const =0
Same name as in CalorimeterHit, even though there are no &#39;cells&#39; in this case.
virtual bool isDefault() const =0
True if collection is the default collection for the given type.
T dec(T...args)
virtual int getQuality() const =0
The quality bit flag of the pulse - check/set collection parameters TrackerPulseQualityNames and Trac...
virtual int getCellID0() const =0
Returns the detector specific (geometrical) cell id.
virtual const FloatVec & getSubdetectorEnergies() const =0
A vector that holds the energy observed in a particular subdetectors.
virtual const double * getEndpoint() const =0
Returns the endpoint of the particle in [mm] if the endpoint has been set explicetly.
virtual const std::string & getStringVal(const std::string &key) const =0
Returns the first string value for the given key.
virtual const TrackVec & getTracks() const =0
The weights of cluster contributions to this particle.
virtual const LCParameters & getParameters() const =0
Parameters defined for this collection.
virtual float getTimeCont(int i) const =0
Returns the time in [ns] of the i-th contribution to the hit.
virtual float getEnergy() const =0
Returns the energy of the hit in [GeV].
virtual float getIPhi() const =0
Intrinsic direction of cluster at position: Phi.
static const int AtOther
Definition: TrackState.h:37
virtual float getEnergy() const =0
Energy of the cluster.
virtual const ShortVec & getADCValues() const =0
The actual FADC spectrum.
virtual const double * getMomentum() const =0
The reconstructed particle&#39;s 3-momentum - only float used in files,.
virtual const double * getMomentum() const =0
Returns the particle&#39;s 3-momentum at the production vertex in [GeV].
Helper class to create and interpret the 32-bit flag word in LCCollections.
Definition: LCFlag.h:19
virtual float getdRPhi() const =0
Measurement error along RPhi.
virtual const MCParticleVec & getDaughters() const =0
Returns the daughters of this particle.
The generic calorimeter hit - created from SimCalorimeterHit or RawCalorimeterHit.
virtual ParticleID * getParticleIDUsed() const =0
The particle Id used for the kinematics of this particle.
virtual float getPhi() const =0
Phi of the track at the reference point.
static const int AtCalorimeter
Definition: TrackState.h:41
T setprecision(T...args)
virtual TrackerData * getTrackerData() const =0
Optionally the TrackerData that has been used to create the pulse can be stored with the pulse - NULL...
virtual const float * getReferencePoint() const =0
Reference point of the reconstructedParticle parameters.
virtual int getCellID0() const =0
Same name as in CalorimeterHit, even though there are no &#39;cells&#39; in this case.
virtual double getMass() const =0
Mass of the reconstructed particle, set independently from four vector quantities.
STL class.
virtual const std::string getTypeName() const =0
The type name of the user class (typically the class name) This type name is stored as a collection p...
virtual float getPhi() const =0
Phi of the track at the reference point.
virtual int getType() const =0
Flagword that defines the type of track.
virtual const LCObjectVec & getRawHits() const =0
The raw data hits.
virtual int getPDG() const =0
The PDG code of this id - UnknownPDG ( 999999 ) if unknown.
virtual float getTime() const =0
Returns the time of the hit in [ns].
virtual int id() const
Provide default implementation for id.