00001 #include <iostream>
00002 #include <ios>
00003
00004 #include "UTIL/Operators.h"
00005
00006 #include "EVENT/ReconstructedParticle.h"
00007
00008
00009
00010
00011
00012
00013 using namespace std;
00014 using namespace EVENT;
00015
00016
00017
00018 #include "EVENT/SimTrackerHit.h"
00019 #include "UTIL/LCTOOLS.h"
00020
00021 #include "EVENT/TPCHit.h"
00022 #include "EVENT/TrackerRawData.h"
00023 #include "EVENT/TrackerData.h"
00024 #include "EVENT/TrackerPulse.h"
00025 #include "EVENT/LCIO.h"
00026 #include "EVENT/MCParticle.h"
00027 #include "EVENT/LCFloatVec.h"
00028 #include "EVENT/LCIntVec.h"
00029 #include "IMPL/LCFlagImpl.h"
00030 #include "EVENT/Track.h"
00031 #include "EVENT/Cluster.h"
00032 #include "EVENT/ReconstructedParticle.h"
00033 #include "EVENT/Vertex.h"
00034 #include "EVENT/TrackerHit.h"
00035 #include "EVENT/LCGenericObject.h"
00036 #include "EVENT/LCRelation.h"
00037 #include "LCIOSTLTypes.h"
00038
00039 #include <sstream>
00040
00041
00042
00043
00044 #include "UTIL/LCObjectHandle.h"
00045 #include "UTIL/LCTime.h"
00046 #include "UTIL/CellIDDecoder.h"
00047 #include "UTIL/PIDHandler.h"
00048 #include <map>
00049 #include <set>
00050 #include <cstdio>
00051
00052 #include "EVENT/LCEvent.h"
00053
00054 typedef std::vector<std::string> LCStrVec ;
00055
00056 using namespace std ;
00057 using namespace EVENT ;
00058 using namespace IMPL ;
00059
00060
00061
00062
00063 namespace UTIL{
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 const ostream_flags saveflags(std::ostream& stream){
00100 ostream_flags flags;
00101 flags.oldf = stream.flags();
00102 flags.precision = stream.precision();
00103 flags.fill = stream.fill();
00104 return(flags);
00105 }
00106 void setflags(std::ostream& stream, ostream_flags flags){
00107 stream.flags(flags.oldf);
00108 stream.precision(flags.precision);
00109 stream.fill(flags.fill);
00110
00111 }
00112
00113 const std::string& header(const EVENT::LCCollection &){
00114 static std::string _vtxh("| Number of elements | Type name | Flag | Is transient | Is default | Is subset |\n");
00115 return _vtxh;
00116 }
00117
00118 const std::string& tail(const EVENT::LCCollection &){
00119 static std::string _vtxt("|--------------------|-----------|-------------|--------------|------------|-----------|\n");
00120 return _vtxt;
00121 }
00122
00123 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCCollection>& sV){
00124 const EVENT::LCCollection* hit = sV.obj;
00125 using namespace std;
00126
00127 ostream_flags flags=saveflags(out);
00128 out << noshowpos;
00129 out << "|" << dec << setw(20) << setfill(' ') << hit->getNumberOfElements();
00130 out << "|" << dec << setw(11) << setfill(' ') << hit->getTypeName();
00131 out << "|" << hex << setw(13) << setfill(' ') << hit->getFlag();
00132 out << "|" << dec << setw(14) << setfill(' ') << hit->isTransient();
00133 out << "|" << dec << setw(12) << setfill(' ') << hit->isDefault();
00134 out << "|" << dec << setw(11) << setfill(' ') << hit->isSubset() << "|" << endl;
00135
00136 setflags(out, flags);
00137 return out;
00138 }
00139
00140
00141
00142 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCCollection> l) {
00143 const EVENT::LCCollection *hit = l.object();
00144 const EVENT::LCCollection *col = l.collection();
00145
00146 using namespace std;
00147 ostream_flags flags=saveflags(out);
00148
00149 stringstream sstream;
00150
00151 out << noshowpos;
00152 out << setw(41) << setfill('-') << right << " LCCollection " << setfill('-') << setw(29) << "-" << endl;
00153
00154 if(col != NULL){
00155 if(col->getTypeName() != LCIO::LCCOLLECTION){
00156 out << "Warning: collection not of type " << LCIO::LCCOLLECTION << endl ;
00157 setflags(out, flags);
00158 return(out);
00159 }
00160
00161 }
00162
00163
00164 out << setw(30) << setfill(' ') << left << "Number of elements" << right << setw(40)<< dec << hit->getNumberOfElements() << endl;
00165 out << setw(30) << setfill(' ') << left << "Type name"<< setfill(' ') << right << setw(40) << hit->getTypeName() << endl;
00166 out << setw(30) << setfill(' ') << left << "Flag"<< setfill(' ') << right << setw(40) << hex << hit->getFlag() << endl;
00167 out << setw(30) << setfill(' ') << left << "Is transient"<< setfill(' ') << right << setw(40) << dec << hit->isTransient() << endl;
00168 out << setw(30) << setfill(' ') << left << "Is default"<< setfill(' ') << right << setw(40) << hit->isDefault() << endl;
00169 out << setw(30) << setfill(' ') << left << "Is subset"<< setfill(' ') << right << setw(40) << hit->isSubset() << endl;
00170
00171 setflags(out, flags);
00172 return out;
00173
00174 }
00175
00176 std::ostream& operator<<( std::ostream& out, const EVENT::LCCollection &hit){
00177 out<<lcio_long(hit,NULL);
00178 return out;
00179 }
00180
00181
00182 const std::string& header(const EVENT::LCEvent &){
00183 static std::string _vtxh("| Run number |Event number |Detector name| Time stamp | Weight |\n");
00184 return _vtxh;
00185 }
00186
00187 const std::string& tail(const EVENT::LCEvent &){
00188 static std::string _vtxt("|-------------|-------------|-------------|-------------|-------------|\n");
00189 return _vtxt;
00190 }
00191 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCEvent>& sV){
00192 const EVENT::LCEvent* hit = sV.obj;
00193 using namespace std;
00194 ostream_flags flags=saveflags(out);
00195
00196 out << noshowpos;
00197 out << "|" << hex << setw(13) << setfill(' ') << hit->getRunNumber();
00198 out << "|" << hex << setw(13) << setfill(' ') << hit->getEventNumber();
00199 out << "|" << dec << setw(13) << setfill(' ') << hit->getDetectorName();
00200 out << "|" << dec << setw(13) << setfill(' ') << hit->getTimeStamp();
00201 out << "|" << dec << setw(13) << setfill(' ') << hit->getWeight() << "|" << endl;
00202 setflags(out, flags);
00203
00204 return out;
00205 }
00206
00207
00208 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCEvent> l) {
00209 const EVENT::LCEvent *hit = l.object();
00210 const EVENT::LCCollection *col = l.collection();
00211
00212 using namespace std;
00213 ostream_flags flags=saveflags(out);
00214
00215 stringstream sstream;
00216
00217 out << noshowpos;
00218 out << setw(41) << setfill('-') << right << " LCEvent " << setfill('-') << setw(29) << "-" << endl;
00219
00220 if(col != NULL){
00221 if(col->getTypeName() != LCIO::LCEVENT){
00222 out << "Warning: collection not of type " << LCIO::LCEVENT << endl ;
00223 setflags(out, flags);
00224
00225 return(out);
00226
00227 }
00228
00229 }
00230
00231
00232
00233 out << setw(30) << setfill(' ') << left << "Run number" << right << setw(40) <<hex << hit->getRunNumber() << endl;
00234 out << setw(30) << setfill(' ') << left << "Event number"<< setfill(' ') << right << setw(40) << dec << hit->getEventNumber() << endl;
00235 out << setw(30) << setfill(' ') << left << "Detector name"<< setfill(' ') << right << setw(40) << hit->getDetectorName() << endl;
00236 out << setw(30) << setfill(' ') << left << "Time stamp"<< setfill(' ') << right << setw(40) << hit->getTimeStamp() << endl;
00237 out << setw(30) << setfill(' ') << left << "Weight"<< setfill(' ') << right << setw(40) << hit->getWeight() << endl;
00238
00239 out << setw(30) << setfill(' ') << left << "Collection Names" << endl;
00240 const std::vector< std::string >* strVec = hit->getCollectionNames() ;
00241 for(std::vector< std::string >::const_iterator name = strVec->begin() ; name != strVec->end() ; name++){
00242 out << " " << "Name: " << setw(20) << left << *name;
00243 out << " Type: " << left << setw(10) << hit->getCollection( *name )->getTypeName();
00244 out << " Number of Elements: "<< left << setw(20) << hit->getCollection( *name )->getNumberOfElements() << endl;
00245 }
00246 out << setfill(' ') << setprecision(6) << dec;
00247 setflags(out, flags);
00248
00249 return out;
00250 }
00251
00252 std::ostream& operator<<( std::ostream& out, const EVENT::LCEvent &hit){
00253 out<<lcio_long(hit,NULL);
00254 return out;
00255 }
00256
00257
00258
00259 const std::string& header(const EVENT::LCFlag &){
00260 static std::string _vtxh("| Flag |");
00261 return _vtxh;
00262 }
00263 const std::string& tail(const EVENT::LCFlag &){
00264 static std::string _vtxt("|------------|\n");
00265 return _vtxt;
00266 }
00267 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCFlag>& sV){
00268 const EVENT::LCFlag* hit = sV.obj;
00269 using namespace std;
00270 ostream_flags flags=saveflags(out);
00271
00272 out << noshowpos;
00273 out << "|" << hex << setw(8) << setfill(' ') << hit->getFlag() << "|" << endl;
00274 setflags(out, flags);
00275 return out;
00276 }
00277
00278
00279 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCFlag> l) {
00280 const EVENT::LCFlag *hit = l.object();
00281 const EVENT::LCCollection *col = l.collection();
00282
00283 using namespace std;
00284 ostream_flags flags=saveflags(out);
00285
00286 stringstream sstream;
00287
00288 out << noshowpos;
00289 out << setw(41) << setfill('-') << right << " LCFlag " << setfill('-') << setw(29) << "-" << endl;
00290
00291 if(col != NULL){
00292
00293
00294
00295
00296
00297
00298 }
00299
00300
00301 out << setw(30) << setfill(' ') << left << "Flag" << right << hex << setw(40) << hit->getFlag() << dec << endl;
00302
00303 setflags(out, flags);
00304 return out;
00305 }
00306
00307 std::ostream& operator<<( std::ostream& out, const EVENT::LCFlag &hit){
00308 out<<lcio_long(hit,NULL);
00309 return out;
00310 }
00311
00312
00313
00314 const std::string& header(const EVENT::LCGenericObject &){
00315 static std::string _vtxh(" [ id ] | Number of ints|Number of floats| Type |\n");
00316 return _vtxh;
00317 }
00318 const std::string& tail(const EVENT::LCGenericObject &){
00319 static std::string _vtxt(" -------------|---------------|----------------|------------|\n");
00320 return _vtxt;
00321 }
00322 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCGenericObject>& sV){
00323 const EVENT::LCGenericObject* hit = sV.obj;
00324 using namespace std;
00325 ostream_flags flags=saveflags(out);
00326
00327 out << noshowpos;
00328 out << " [" << hex << setw(8) << setfill('0') << hit->id() << "] ";
00329 out << " |" << dec << setw(15) << setfill(' ') << hit->getNInt();
00330 out << "|" << setw(16) << setfill(' ') << hit->getNDouble();
00331 out << "|" << setw(12) << setfill(' ') << hit->getDataDescription() << "|" << endl;
00332
00333
00334 setflags(out, flags);
00335 return out;
00336 }
00337
00338
00339 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCGenericObject> l) {
00340 const EVENT::LCGenericObject *hit = l.object();
00341 const EVENT::LCCollection *col = l.collection();
00342
00343 using namespace std;
00344 ostream_flags flags=saveflags(out);
00345
00346 stringstream sstream;
00347
00348 out << noshowpos;
00349 out << setw(41) << setfill('-') << right << " LCGenericObject " << setfill('-') << setw(29) << "-" << endl;
00350
00351 if(col != NULL){
00352 if(col->getTypeName() != LCIO::LCGENERICOBJECT){
00353 out << "Warning: collection not of type " << LCIO::LCGENERICOBJECT << endl ;
00354 setflags(out, flags);
00355 return(out);
00356
00357 }
00358
00359 }
00360
00361
00362 sstream << "0x" << hex << hit->id();
00363 out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
00364 out << setw(30) << setfill(' ') << left << "Number of integer values"<< setfill(' ') << right << setw(40) << hit->getNInt() << endl;
00365 out << setw(30) << setfill(' ') << left << "Number of float values"<< setfill(' ') << right << setw(40) << hit->getNDouble() << endl;
00366 out << setw(30) << setfill(' ') << left << "Type name"<< setfill(' ') << right << setw(40) << hit->getTypeName() << endl;
00367 out << setw(30) << setfill(' ') << left << "Description"<< setfill(' ') << right << setw(40) << hit->getDataDescription() << endl;
00368
00369 setflags(out, flags);
00370 return out;
00371 }
00372
00373 std::ostream& operator<<( std::ostream& out, const EVENT::LCGenericObject &hit){
00374 out<<lcio_long(hit,NULL);
00375 return out;
00376 }
00377
00378
00379
00380
00381 const std::string& header(const EVENT::LCIntVec &){
00382 static std::string _vtxh(" [ Id ] \n");
00383 return _vtxh;
00384 }
00385 const std::string& tail(const EVENT::LCIntVec &){
00386 static std::string _vtxt("-----------\n");
00387 return _vtxt;
00388 }
00389 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCIntVec>& sV){
00390 const EVENT::LCIntVec* hit = sV.obj;
00391 using namespace std;
00392 ostream_flags flags=saveflags(out);
00393
00394 out << noshowpos;
00395 out << " [" << hex << setw(8) << setfill('0') << hit->id() << "] ";
00396
00397 setflags(out, flags);
00398 return out;
00399 }
00400
00401
00402 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCIntVec> l) {
00403 const EVENT::LCIntVec *hit = l.object();
00404 const EVENT::LCCollection *col = l.collection();
00405
00406 using namespace std;
00407 ostream_flags flags=saveflags(out);
00408
00409 stringstream sstream;
00410
00411 out << noshowpos;
00412 out << setw(41) << setfill('-') << right << " LCIntVec " << setfill('-') << setw(29) << "-" << endl;
00413
00414 if(col != NULL){
00415 if(col->getTypeName() != LCIO::LCINTVEC){
00416 out << "Warning: collection not of type " << LCIO::LCINTVEC << endl ;
00417 setflags(out, flags);
00418 return(out);
00419
00420 }
00421
00422 }
00423
00424
00425 sstream << "0x" << hex << hit->id();
00426 out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
00427
00428 setflags(out, flags);
00429 return out;
00430 }
00431
00432 std::ostream& operator<<( std::ostream& out, const EVENT::LCIntVec &hit){
00433 out<<lcio_long(hit,NULL);
00434 return out;
00435 }
00436
00437
00438
00439
00440 const std::string& header(const EVENT::LCObject &){
00441 static std::string _vtxh(" [ Id ] \n");
00442 return _vtxh;
00443 }
00444
00445 const std::string& tail(const EVENT::LCObject &){
00446 static std::string _vtxt("-----------\n");
00447 return _vtxt;
00448 }
00449
00450 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCObject>& sV){
00451 const EVENT::LCObject* hit = sV.obj;
00452 using namespace std;
00453 ostream_flags flags=saveflags(out);
00454
00455 out << noshowpos;
00456 out << " [" << hex << setw(8) << setfill('0') << hit->id() << "] ";
00457
00458 setflags(out, flags);
00459 return out;
00460 }
00461
00462
00463
00464 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCObject> l) {
00465 const EVENT::LCObject *hit = l.object();
00466 const EVENT::LCCollection *col = l.collection();
00467
00468 using namespace std;
00469 ostream_flags flags=saveflags(out);
00470
00471 stringstream sstream;
00472
00473 out << noshowpos;
00474 out << setw(41) << setfill('-') << right << " LCObject " << setfill('-') << setw(29) << "-" << endl;
00475
00476 if(col != NULL){
00477
00478
00479
00480
00481
00482
00483
00484 }
00485
00486
00487 sstream << "0x" << hex << hit->id();
00488 out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << sstream.str() << endl;
00489
00490 setflags(out, flags);
00491 return out;
00492 }
00493
00494 std::ostream& operator<<( std::ostream& out, const EVENT::LCObject &hit){
00495 out<<lcio_long(hit,NULL);
00496 return out;
00497 }
00498
00499
00500 const std::string& header(const EVENT::LCParameters &){
00501 static std::string _vtxh("-----\n");
00502 return _vtxh;
00503 }
00504 const std::string& tail(const EVENT::LCParameters &){
00505 static std::string _vtxt("-----\n");
00506 return _vtxt;
00507 }
00508 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCParameters>& sV){
00509
00510 using namespace std;
00511 ostream_flags flags=saveflags(out);
00512
00513 out << noshowpos;
00514 out << "| " << hex << setw(8) << setfill(' ')<< " |";
00515
00516 setflags(out, flags);
00517 return out;
00518 }
00519
00520
00521
00522 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCParameters> l) {
00523
00524 const EVENT::LCCollection *col = l.collection();
00525
00526 using namespace std;
00527 ostream_flags flags=saveflags(out);
00528
00529 stringstream sstream;
00530
00531 out << noshowpos;
00532 out << setw(41) << setfill('-') << right << " LCParameters " << setfill('-') << setw(29) << "-" << endl;
00533
00534 if(col != NULL){
00535
00536
00537
00538
00539
00540
00541
00542
00543 }
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602 setflags(out, flags);
00603 return out;
00604
00605 }
00606
00607 std::ostream& operator<<( std::ostream& out, const EVENT::LCParameters &hit){
00608 out<<lcio_long(hit,NULL);
00609 return out;
00610 }
00611
00612
00613 const std::string& header(const EVENT::LCRunHeader &){
00614 static std::string _vtxh(" [ Run number ] | Detector name | Description | Parameters |\n");
00615 return _vtxh;
00616 }
00617 const std::string& tail(const EVENT::LCRunHeader &){
00618 static std::string _vtxt("----------------|---------------|-------------|------------|\n");
00619 return _vtxt;
00620 }
00621 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCRunHeader>& sV){
00622 const EVENT::LCRunHeader* hit = sV.obj;
00623 using namespace std;
00624 ostream_flags flags=saveflags(out);
00625
00626 out << noshowpos;
00627 out << " [" << hex << setw(8) << setfill('0') << hit->getRunNumber() << "] ";
00628 out << "|" << dec << setw(8) << setfill(' ') << hit->getDetectorName();
00629 out << "|" << dec << setw(8) << setfill(' ') << hit->getDescription();
00630 out << "|" << dec << setw(8) << setfill(' ') << hit->getParameters() << "|" << endl;
00631
00632 setflags(out, flags);
00633 return out;
00634 }
00635
00636
00637
00638 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCRunHeader> l) {
00639 const EVENT::LCRunHeader *hit = l.object();
00640 const EVENT::LCCollection *col = l.collection();
00641
00642 using namespace std;
00643 ostream_flags flags=saveflags(out);
00644
00645 stringstream sstream;
00646
00647 out << noshowpos;
00648 out << setw(41) << setfill('-') << right << " LCRunHeader " << setfill('-') << setw(29) << "-" << endl;
00649
00650 if(col != NULL){
00651 if(col->getTypeName() != LCIO::LCRUNHEADER){
00652 out << "Warning: collection not of type " << LCIO::LCRUNHEADER << endl ;
00653 return(out);
00654
00655 }
00656
00657 }
00658
00659
00660 sstream << "0x" << hex << hit->id();
00661 out << setw(30) << setfill(' ') << left << "Run number"<< setfill(' ') << right << setw(40) << hex << hit->getRunNumber() <<dec << endl;
00662 out << setw(30) << setfill(' ') << left << "Detector name"<< setfill(' ') << right << setw(40) << hex << hit->getDetectorName() <<dec << endl;
00663 out << setw(30) << setfill(' ') << left << "Description"<< setfill(' ') << right << setw(40) << hex << hit->getDescription() <<dec << endl;
00664 out << setw(30) << setfill(' ') << left << "Parameters"<< setfill(' ') << right << setw(40) << hex << hit->getParameters() <<dec << endl;
00665
00666 setflags(out, flags);
00667 return out;
00668 }
00669
00670 std::ostream& operator<<( std::ostream& out, const EVENT::LCRunHeader &hit){
00671 out<<lcio_long(hit,NULL);
00672 return out;
00673 }
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727 const std::string& header(const EVENT::ParticleID &){
00728 static std::string _vtxh("| Type | PDG | Likelihood |Algorithm type|");
00729 return _vtxh;
00730 }
00731 const std::string& tail(const EVENT::ParticleID &){
00732 static std::string _vtxt("\n");
00733 return _vtxt;
00734 }
00735 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::ParticleID>& sV){
00736 const EVENT::ParticleID* hit = sV.obj;
00737 using namespace std;
00738 ostream_flags flags=saveflags(out);
00739
00740 out << noshowpos;
00741 out << "|" << dec << setw(10) << setfill(' ') << hit->getType();
00742 out << "|" << dec << setw(10) << setfill(' ') << hit->getPDG();
00743 out << "|" << dec << setw(12) << setfill(' ') << hit->getLikelihood();
00744 out << "|" << dec << setw(14) << setfill(' ') << hit->getAlgorithmType();
00745
00746 setflags(out, flags);
00747 return out;
00748 }
00749
00750
00751 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::ParticleID> l) {
00752 const EVENT::ParticleID *hit = l.object();
00753 const EVENT::LCCollection *col = l.collection();
00754
00755 using namespace std;
00756 ostream_flags flags=saveflags(out);
00757
00758 stringstream sstream;
00759
00760 out << noshowpos;
00761 out << setw(41) << setfill('-') << right << " ParticleID " << setfill('-') << setw(29) << "-" << endl;
00762
00763 if(col != NULL){
00764 if(col->getTypeName() != LCIO::PARTICLEID){
00765 out << "Warning: collection not of type " << LCIO::PARTICLEID << endl ;
00766 setflags(out, flags);
00767 return(out);
00768
00769 }
00770
00771 }
00772
00773
00774 out << setw(30) << setfill(' ') << left << "Type"<< setfill(' ') << right << setw(40) << dec << hit->getType() << endl;
00775 out << setw(30) << setfill(' ') << left << "PDG"<< setfill(' ') << right << setw(40) << dec << hit->getPDG() << endl;
00776 out << setw(30) << setfill(' ') << left << "Likelihood "<< setfill(' ') << right << setw(40) << dec << hit->getLikelihood() << endl;
00777 out << setw(30) << setfill(' ') << left << "Algorithm type"<< setfill(' ') << right << setw(40) << dec << hit->getAlgorithmType() << endl;
00778
00779 setflags(out, flags);
00780 return out;
00781 }
00782
00783 std::ostream& operator<<( std::ostream& out, const EVENT::ParticleID &hit){
00784 out<<lcio_long(hit,NULL);
00785 return out;
00786 }
00787
00788
00789 const std::string& header(const EVENT::RawCalorimeterHit &){
00790 static std::string _vtxh(" CellID0 | CellID1 | Amplitude | TimeStamp \n");
00791 return _vtxh;
00792 }
00793 const std::string& tail(const EVENT::RawCalorimeterHit &){
00794 static std::string _vtxt("---------|---------|-----------|-----------\n");
00795 return _vtxt;
00796 }
00797 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::RawCalorimeterHit>& sV){
00798 const EVENT::RawCalorimeterHit* hit = sV.obj;
00799 using namespace std;
00800 ostream_flags flags=saveflags(out);
00801
00802 out << noshowpos;
00803 out << "| " << hex << setw(8) << setfill('0') << hit->getCellID0();
00804 out << "| " << hex << setw(8) << setfill('0') << hit->getCellID1();
00805 out << "|" << dec << setw(11) << setfill(' ') << hit->getAmplitude();
00806 out << "|" << dec << setw(11) << setfill(' ') << hit->getTimeStamp() << "|" << endl;
00807
00808 setflags(out, flags);
00809 return out;
00810 }
00811
00812
00813 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::RawCalorimeterHit> l) {
00814 const EVENT::RawCalorimeterHit *hit = l.object();
00815 const EVENT::LCCollection *col = l.collection();
00816
00817 using namespace std;
00818 ostream_flags flags=saveflags(out);
00819
00820 stringstream sstream;
00821
00822 out << noshowpos;
00823 out << setw(41) << setfill('-') << right << " RawCalorimeterHit " << setfill('-') << setw(29) << "-" << endl;
00824
00825 if(col != NULL){
00826 if(col->getTypeName() != LCIO::RAWCALORIMETERHIT){
00827 out << "Warning: collection not of type " << LCIO::RAWCALORIMETERHIT << endl ;
00828 setflags(out, flags);
00829 return(out);
00830 }
00831 LCFlagImpl flag( col->getFlag() ) ;
00832 out << " LCIO::RCHBIT_ID1 : " << flag.bitSet( LCIO::RCHBIT_ID1 ) << endl ;
00833 out << " LCIO::RCHBIT_TIME : " << flag.bitSet( LCIO::RCHBIT_TIME ) << endl ;
00834 out << " LCIO::RCHBIT_NO_PTR : " << flag.bitSet( LCIO::RCHBIT_NO_PTR ) << endl ;
00835
00836 }
00837
00838
00839 out << setw(30) << setfill(' ') << left << "CellID0"<< setfill(' ') << right << setw(40) << hex << hit->getCellID0() << endl;
00840 out << setw(30) << setfill(' ') << left << "CellID1"<< setfill(' ') << right << setw(40) << hex << hit->getCellID1() << endl;
00841 out << setw(30) << setfill(' ') << left << "Amplitude"<< setfill(' ') << right << setw(40) << dec << hit->getAmplitude() << endl;
00842 out << setw(30) << setfill(' ') << left << "TimeStamp"<< setfill(' ') << right << setw(40) << dec << hit->getTimeStamp() << endl;
00843
00844 setflags(out, flags);
00845 return out;
00846 }
00847
00848 std::ostream& operator<<( std::ostream& out, const EVENT::RawCalorimeterHit &hit){
00849 out<<lcio_long(hit,NULL);
00850 return out;
00851 }
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904 const std::string& header(const EVENT::TrackerData &){
00905 static std::string _vtxh(" CellID0 | CellID1 | Time \n");
00906 return _vtxh;
00907 }
00908 const std::string& tail(const EVENT::TrackerData &){
00909 static std::string _vtxt("---------|---------|-----------\n");
00910 return _vtxt;
00911 }
00912 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerData>& sV){
00913 const EVENT::TrackerData* hit = sV.obj;
00914 using namespace std;
00915 ostream_flags flags=saveflags(out);
00916
00917 out << noshowpos;
00918 out << "| " << hex << setw(8) << setfill('0') << hit->getCellID0();
00919 out << "| " << hex << setw(8) << setfill('0') << hit->getCellID1();
00920 out << "|" << dec << setw(11) << setfill(' ') << hit->getTime() << "|" << endl;
00921
00922 setflags(out, flags);
00923 return out;
00924
00925 }
00926
00927 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::TrackerData> l) {
00928 const EVENT::TrackerData *hit = l.object();
00929 const EVENT::LCCollection *col = l.collection();
00930
00931 using namespace std;
00932 ostream_flags flags=saveflags(out);
00933
00934 stringstream sstream;
00935
00936 out << noshowpos;
00937 out << setw(41) << setfill('-') << right << " TrackerData " << setfill('-') << setw(29) << "-" << endl;
00938
00939 if(col != NULL){
00940 if(col->getTypeName() != LCIO::TRACKERDATA){
00941 out << "Warning: collection not of type " << LCIO::TRACKERDATA << endl ;
00942 setflags(out, flags);
00943 return(out);
00944
00945 }
00946
00947 }
00948
00949
00950 out << setw(30) << setfill(' ') << left << "CellID0"<< setfill(' ') << right << setw(40) << hex << hit->getCellID0() << endl;
00951 out << setw(30) << setfill(' ') << left << "CellID1"<< setfill(' ') << right << setw(40) << hex << hit->getCellID1() << endl;
00952 out << setw(30) << setfill(' ') << left << "Time"<< setfill(' ') << right << setw(40) << dec << hit->getTime() << endl;
00953
00954 setflags(out, flags);
00955 return out;
00956 }
00957 std::ostream& operator<<( std::ostream& out, const EVENT::TrackerData &hit){
00958 out<<lcio_long(hit,NULL);
00959 return out;
00960 }
00961
00962
00963
00964 const std::string& header(const EVENT::TrackerPulse &){
00965 static std::string _vtxh(" CellID0 | CellID1 | Time | Charge | Quality \n");
00966 return _vtxh;
00967 }
00968 const std::string& tail(const EVENT::TrackerPulse &){
00969 static std::string _vtxt("---------|---------|--------|--------|---------\n");
00970 return _vtxt;
00971 }
00972 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerPulse>& sV){
00973 const EVENT::TrackerPulse* hit = sV.obj;
00974 using namespace std;
00975 ostream_flags flags=saveflags(out);
00976
00977 out << noshowpos;
00978 out << "| " << hex << setw(8) << setfill('0') << hit->getCellID0();
00979 out << "| " << hex << setw(8) << setfill('0') << hit->getCellID1();
00980 out << "|" << dec << setw(8) << setfill(' ') << hit->getTime();
00981 out << "|" << dec << setw(8) << setfill(' ') << hit->getCharge();
00982 out << "|" << dec << setw(8) << setfill(' ') << hit->getQuality() << endl;
00983
00984
00985 setflags(out, flags);
00986 return out;
00987 }
00988
00989
00990
00991 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::TrackerPulse> l) {
00992 const EVENT::TrackerPulse *hit = l.object();
00993 const EVENT::LCCollection *col = l.collection();
00994
00995 using namespace std;
00996 ostream_flags flags=saveflags(out);
00997
00998 stringstream sstream;
00999
01000 out << noshowpos;
01001 out << setw(41) << setfill('-') << right << " TrackerPulse " << setfill('-') << setw(29) << "-" << endl;
01002
01003 if(col != NULL){
01004 if(col->getTypeName() != LCIO::TRACKERPULSE){
01005 out << "Warning: collection not of type " << LCIO::TRACKERPULSE << endl ;
01006 setflags(out, flags);
01007 return(out);
01008 }
01009
01010 LCFlagImpl flag( col->getFlag() ) ;
01011 out << " LCIO::TRAWBIT_ID1 : " << flag.bitSet( LCIO::TRAWBIT_ID1 ) << endl ;
01012 }
01013
01014
01015 out << setw(30) << setfill(' ') << left << "CellID0"<< setfill(' ') << right << setw(40) << hex << hit->getCellID0() << endl;
01016 out << setw(30) << setfill(' ') << left << "CellID1"<< setfill(' ') << right << setw(40) << hex << hit->getCellID1() << endl;
01017 out << setw(30) << setfill(' ') << left << "Time"<< setfill(' ') << right << setw(40) << dec << hit->getTime() << endl;
01018 out << setw(30) << setfill(' ') << left << "Charge"<< setfill(' ') << right << setw(40) << dec << hit->getCharge() << endl;
01019 out << setw(30) << setfill(' ') << left << "Quality"<< setfill(' ') << right << setw(40) << dec << hit->getQuality() << endl;
01020
01021 setflags(out, flags);
01022 return out;
01023 }
01024 std::ostream& operator<<( std::ostream& out, const EVENT::TrackerPulse &hit){
01025 out<<lcio_long(hit,NULL);
01026 return out;
01027 }
01028
01029
01030
01031 const std::string& header(const EVENT::TrackerRawData &){
01032 static std::string _vtxh(" CellID0 | CellID1 | Time \n");
01033 return _vtxh;
01034 }
01035 const std::string& tail(const EVENT::TrackerRawData &){
01036 static std::string _vtxt("\n");
01037 return _vtxt;
01038 }
01039 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerRawData>& sV){
01040 const EVENT::TrackerRawData* hit = sV.obj;
01041 using namespace std;
01042 ostream_flags flags=saveflags(out);
01043
01044 out << noshowpos;
01045 out << "| " << hex << setw(8) << setfill('0') << hit->getCellID0();
01046 out << "| " << hex << setw(8) << setfill('0') << hit->getCellID1();
01047 out << "|" << dec << setw(8) << setfill(' ') << hit->getTime() << endl;
01048
01049 setflags(out, flags);
01050 return out;
01051 }
01052
01053
01054 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::TrackerRawData> l) {
01055 const EVENT::TrackerRawData *hit = l.object();
01056 const EVENT::LCCollection *col = l.collection();
01057
01058 using namespace std;
01059 ostream_flags flags=saveflags(out);
01060
01061 stringstream sstream;
01062
01063 out << noshowpos;
01064 out << setw(41) << setfill('-') << right << " TrackerRawData " << setfill('-') << setw(29) << "-" << endl;
01065
01066 if(col != NULL){
01067 if(col->getTypeName() != LCIO::TRACKERRAWDATA){
01068 out << "Warning: collection not of type " << LCIO::TRACKERRAWDATA << endl ;
01069 setflags(out, flags);
01070 return(out);
01071
01072 }
01073
01074 }
01075
01076
01077 out << setw(30) << setfill(' ') << left << "CellID0"<< setfill(' ') << right << setw(40) << hex << hit->getCellID0() << endl;
01078 out << setw(30) << setfill(' ') << left << "CellID1"<< setfill(' ') << right << setw(40) << hex << hit->getCellID1() << endl;
01079 out << setw(30) << setfill(' ') << left << "Time"<< setfill(' ') << right << setw(40) << dec << hit->getTime() << endl;
01080
01081 setflags(out, flags);
01082 return out;
01083 }
01084 std::ostream& operator<<( std::ostream& out, const EVENT::TrackerRawData &hit){
01085 out<<lcio_long(hit,NULL);
01086 return out;
01087 }
01088
01089
01090
01091
01092 const std::string& header(const EVENT::LCIO &){
01093 static std::string _vtxh("-------------------");
01094 return _vtxh;
01095 }
01096 const std::string& tail(const EVENT::LCIO &){
01097 static std::string _vtxt("-------------------\n");
01098 return _vtxt;
01099 }
01100 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCIO>& sV){
01101
01102 using namespace std;
01103 ostream_flags flags=saveflags(out);
01104
01105 out << noshowpos;
01106 out << " " << endl;
01107
01108 setflags(out, flags);
01109 return out;
01110 }
01111
01112
01113 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCIO> l) {
01114
01115 const EVENT::LCCollection *col = l.collection();
01116
01117
01118 using namespace std;
01119 ostream_flags flags=saveflags(out);
01120
01121 stringstream sstream;
01122
01123 out << noshowpos;
01124 out << setw(41) << setfill('-') << right << " LCIO " << setfill('-') << setw(29) << "-" << endl;
01125
01126 if(col != NULL){
01127
01128
01129
01130
01131
01132
01133
01134 }
01135
01136
01137
01138 setflags(out, flags);
01139 return out;
01140 }
01141 std::ostream& operator<<( std::ostream& out, const EVENT::LCIO &hit){
01142 out<<lcio_long(hit,NULL);
01143 return out;
01144 }
01145
01146 const std::string& header(const EVENT::SimCalorimeterHit &){
01147 static std::string _vtxh(" [id] | cellId0| cellId1| energy |energyerr | position (x,y,z) |nMCParticles|\n\t\t-> MC contribution: prim. PDG| energy | time | sec. PDG\n");
01148 return _vtxh;
01149 }
01150
01151 const std::string& tail(const EVENT::SimCalorimeterHit &){
01152 static std::string _vtxt("------------|--------|--------|----------|----------|----------------------------------|-------------\n");
01153 return _vtxt;
01154 }
01155
01156 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::SimCalorimeterHit>& sV){
01157 const EVENT::SimCalorimeterHit* hit = sV.obj;
01158 using namespace std;
01159 ostream_flags flags=saveflags(out);
01160
01161 out << noshowpos;
01162 out << " [" << hex << setw(8) << setfill('0') << hit->id() << "] ";
01163 out << "|" << hex << setw(8) << setfill('0') << hit->getCellID0();
01164 out << "|" << hex << setw(8) << setfill('0') << hit->getCellID1();
01165 out << "|" << dec << setprecision(3) << scientific << showpos << hit->getEnergy();
01166
01167 out << "|" << dec << setprecision(3) << scientific << " ";
01168 out << "|" << dec << setprecision(3) << scientific << showpos
01169 << hit->getPosition()[0] << ", " << hit->getPosition()[0] << ", " << hit->getPosition()[0];
01170 out << "|" << dec << setw(12) << setfill(' ') << hit->getNMCContributions()
01171 << endl;
01172
01173 for(int k=0;k < hit->getNMCContributions();k++){
01174 try{
01175 out << "\t\t-> "
01176 << setw(15) << left << setfill(' ') << k << ":"
01177 << setw(10) << left << setfill(' ') << hit->getParticleCont(k)->getPDG() << "|"
01178 << right << setprecision(3) << scientific << showpos << hit->getEnergyCont(k) << "|"
01179 << setprecision(3) << scientific << setw(8) <<setfill(' ') << showpos<< hit->getTimeCont(k) << "|"
01180 << " " << hit->getPDGCont( k) << endl ;
01181 }catch(exception& e){
01182 out << e.what() << endl ;
01183 }
01184 }
01185 out << noshowpos;
01186
01187
01188 setflags(out, flags);
01189 return(out);
01190 }
01191
01192 std::ostream& operator<<( std::ostream& out, const EVENT::SimCalorimeterHit &hit){
01193
01194 out<<lcio_long(hit,NULL);
01195 return out;
01196 }
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215
01216
01217
01218
01219
01220
01221
01222
01223
01224
01225
01226
01227
01228
01229
01230
01231
01232
01233
01234
01235
01236
01237
01238
01239
01240
01241
01242
01243
01244 const std::string& header(const EVENT::TrackerHit &){
01245 static std::string _vtxh(" [id] | position (x,y,z) | EDep | time |type \n");
01246 return _vtxh;
01247 }
01248
01249 const std::string& tail(const EVENT::TrackerHit &){
01250 static std::string _vtxt("------------|-----------------------------|---------|---------|-----\n");
01251 return _vtxt;
01252 }
01253
01254 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::TrackerHit>& sV){
01255 const EVENT::TrackerHit* part = sV.obj;
01256 using namespace std;
01257 ostream_flags flags=saveflags(out);
01258
01259 out << " [" << setfill('0') << setw(8) << hex<< part->id() << "] |" << dec;
01260 out << showpos << scientific << setprecision (2) << part->getPosition()[0] << ","<< part->getPosition()[1] << "," << part->getPosition()[2] << "|";
01261 out << part->getEDep() << "|";
01262 out << part->getTime() << "|";
01263 out << noshowpos << setw(4) << part->getType() << endl;
01264
01265 setflags(out, flags);
01266 return out;
01267 }
01268
01269 std::ostream& operator<<( std::ostream& out, const EVENT::TrackerHit &hit){
01270 out << lcio_long(hit,NULL);
01271 return out;
01272 }
01273
01274 const std::string& header(const EVENT::SimTrackerHit &){
01275 static std::string _vtxh(" CellID | position (x,y,z) | EDep | time |PDG of MCParticle| px , py , pz |path length \n");
01276 return _vtxh;
01277 }
01278
01279 const std::string& tail(const EVENT::SimTrackerHit &){
01280 static std::string _vtxt("---------|-----------------------------|---------|---------|-----------------|-----------------------------|------------\n");
01281 return _vtxt;
01282 }
01283
01284 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::SimTrackerHit>& sV){
01285 const EVENT::SimTrackerHit* hit = sV.obj;
01286 using namespace std;
01287 ostream_flags flags=saveflags(out);
01288
01289 out << noshowpos << " " << setw(8) << hex << hit->getCellID() << "|";
01290 out << showpos << scientific << setprecision (2) << setfill(' ') << hit->getPosition()[0]<<","<<hit->getPosition()[1]<<","<<hit->getPosition()[2]<<"|";
01291 out << hit->getEDep() << "|";
01292 out << hit->getTime() << "|";
01293 if(hit->getMCParticle()){
01294 out << setw(17) << hit->getMCParticle()->getPDG() << "|";
01295 }else{
01296 out << " |";
01297 }
01298 out << hit->getMomentum()[0] << "," << hit->getMomentum()[0] << "," << hit->getMomentum()[0] << "|";
01299 out << setw(11) << hit->getPathLength() << endl;
01300 out << noshowpos;
01301
01302
01303 out << setfill(' ') << setprecision(6) << dec;
01304 return(out);
01305 }
01306
01307 std::ostream& operator<<( std::ostream& out, const EVENT::SimTrackerHit &hit){
01308 out << lcio_long(hit,NULL);
01309 return(out);
01310 }
01311
01312
01313 const std::string& header(const EVENT::CalorimeterHit &){
01314 static std::string _vtxh(" [id] |cellId0 |cellId1 | energy |energyerr | position (x,y,z) \n");
01315 return _vtxh;
01316 }
01317
01318 const std::string& tail(const EVENT::CalorimeterHit &){
01319 static std::string _vtxt("------------|--------|--------|----------|----------|-----------------------------------\n");
01320 return _vtxt;
01321 }
01322
01323 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::CalorimeterHit>& sV){
01324 const EVENT::CalorimeterHit* hit = sV.obj;
01325 using namespace std;
01326 ostream_flags flags=saveflags(out);
01327
01328 out << noshowpos;
01329
01330 out << " [" << hex << setw(8) << setfill('0') << hit->id() << "] ";
01331 out << "|" << hex << setw(8) << setfill('0') << hit->getCellID0();
01332 out << "|" << hex << setw(8) << setfill('0') << hit->getCellID1();
01333 out << "|" << dec << setprecision(3) << scientific << showpos << hit->getEnergy();
01334 out << "|" << dec << setprecision(3) << scientific << hit->getEnergyError();
01335 out << "|" << dec << setprecision(3) << scientific << showpos
01336 << hit->getPosition()[0] << ", " << hit->getPosition()[0] << ", " << hit->getPosition()[0];
01337 out << endl << noshowpos;
01338
01339
01340 setflags(out, flags);
01341 return(out);
01342 }
01343
01344 std::ostream& operator<<( std::ostream& out, const EVENT::CalorimeterHit &hit){
01345 out << lcio_long(hit,NULL);
01346
01347
01348 return(out);
01349 }
01350
01351
01352
01353
01354
01355
01356
01357
01358
01359
01360
01361
01362
01363
01364
01365
01366
01367
01368
01369
01370
01371
01372 const std::string& header(const EVENT::MCParticle &){
01373 static std::string _vtxh(" [id] | PDG | px , py , pz | energy |gen| vertex x, y , z |endpoint x, y , z | mass | charge |parents-daughters\n");
01374 return _vtxh;
01375 }
01376
01377 const std::string& tail(const EVENT::MCParticle &){
01378 static std::string _vtxt("------------|----------|-----------------------------|---------|---|-----------------------------|-----------------------------|---------|---------|------------------\n");
01379 return _vtxt;
01380 }
01381
01382 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::MCParticle>& sV){
01383 const EVENT::MCParticle* part = sV.obj;
01384 using namespace std;
01385 ostream_flags flags=saveflags(out);
01386
01387 out << noshowpos << " [" << setfill('0') << setw(8) << hex<< part->id() << "] |" << dec;
01388 out << setfill(' ') << setw(10) << part->getPDG() << "|";
01389 out << showpos << scientific << setprecision (2) << part->getMomentum()[0] << ","<< part->getMomentum()[1] << "," << part->getMomentum()[2] << "|";
01390 out << part->getEnergy() << "|";
01391 out << " " << noshowpos << part->getGeneratorStatus() << showpos <<" |";
01392 out << part->getVertex()[0] << "," << part->getVertex()[1] << "," <<part->getVertex()[2] << "|";
01393 out << part->getEndpoint()[0] << "," << part->getEndpoint()[1] << "," <<part->getEndpoint()[2] << "|";
01394 out << part->getMass() << "|";
01395 out << part->getCharge() << "|";
01396 out << setw(6) << part->getParents().size() << " - " << setw(8) << part->getDaughters().size();
01397 out << endl << noshowpos;
01398
01399 setflags(out, flags);
01400 return out;
01401 }
01402
01403
01404 std::ostream& operator<<( std::ostream& out, const EVENT::MCParticle &mcp){
01405 out << lcio_long(mcp,NULL);
01406 return out;
01407 }
01408
01409 const std::string& header(const EVENT::ReconstructedParticle &){
01410 static std::string _vtxh(" [id] |com|type| momentum( px,py,pz) | energy | mass | charge | position ( x,y,z) |pidUsed\n");
01411 return _vtxh;
01412 }
01413
01414 const std::string& tail(const EVENT::ReconstructedParticle &){
01415 static std::string _vtxt("------------|---|----|-------------------------------|--------|--------|--------|-------------------------------|--------\n");
01416 return _vtxt;
01417 }
01418
01419 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::ReconstructedParticle>& sV){
01420 const EVENT::ReconstructedParticle * part = sV.obj;
01421 stringstream tmp;
01422 using namespace std;
01423 ostream_flags flags=saveflags(out);
01424
01425 out << noshowpos << " [" << setfill('0') << setw(8) << hex << part->id() << "] |" << dec;
01426 out << setfill(' ') << setw(3) << part->isCompound() << "|";
01427 out << setfill(' ') << setw(4) << part->getType() << "|";
01428
01429 tmp.str("");
01430 tmp << showpos << scientific << setprecision(2);
01431 tmp << part->getMomentum()[0] << ", " << part->getMomentum()[1] << ", " << part->getMomentum()[2];
01432 out << tmp.str() << "|";
01433
01434
01435 out << noshowpos << scientific << setprecision(2);
01436 out << part->getMass() << "|";
01437 out << part->getCharge() << "|";
01438 out << part->getEnergy() << "|";
01439
01440 tmp.str("");
01441 tmp << part->getReferencePoint()[0] << ", " << part->getReferencePoint()[1] << ", " << part->getReferencePoint()[2];
01442 out << tmp.str() << "|";
01443
01444 out << hex << setw(7) << setfill('0');
01445 if(part->getParticleIDUsed() != 0 ){
01446 out << part->getParticleIDUsed()->id();
01447 }else{
01448 out << 0;
01449 }
01450 out << endl;
01451
01452 out << " covariance( px,py,pz,E) : (" ;
01453 for(int l=0;l<10;l++){
01454 if(l==9){
01455 out << scientific << setprecision(2) << part->getCovMatrix()[l];
01456 }else{
01457 out << scientific << setprecision(2) << part->getCovMatrix()[l] << ", ";
01458 }
01459
01460
01461
01462
01463 }
01464 out << ")" << endl ;
01465
01466 out << " particles ( [ id ] ):" ;
01467 for(unsigned int l=0;l<part->getParticles().size();l++){
01468 if(l == part->getParticles().size()-1){
01469 out << hex << setfill('0') << "[" <<setw(8) << part->getParticles()[l]->id() << "]";
01470 }else{
01471 out << hex << setfill('0') << "[" <<setw(8) << part->getParticles()[l]->id() << "], ";
01472 }
01473
01474
01475 }
01476 out << endl ;
01477
01478 out << " tracks ( [ id ] ): " ;
01479 for(unsigned int l=0;l<part->getTracks().size();l++){
01480 if(l == part->getTracks().size()-1){
01481 out << hex << setfill('0') << "[" << setw(8) << part->getTracks()[l]->id() << "]";
01482 }else{
01483 out << hex << setfill('0') << "[" << setw(8) << part->getTracks()[l]->id() << "], ";
01484 }
01485
01486
01487 }
01488 out << endl ;
01489
01490 out << " clusters ( [ id ] ): " ;
01491 for(unsigned int l=0;l<part->getClusters().size();l++){
01492 if(l == part->getClusters().size()-1){
01493 out << hex << setfill('0') << "[" << setw(8) << part->getClusters()[l]->id() << "]";
01494 }else{
01495 out << hex << setfill('0') << "[" << setw(8) << part->getClusters()[l]->id() << "], ";
01496 }
01497
01498
01499 }
01500 out << endl ;
01501 out << " particle ids ( [id], PDG, (type)): " ;
01502 for(unsigned int l=0;l<part->getParticleIDs().size();l++){
01503 ParticleID* pid = part->getParticleIDs()[l] ;
01504 out << hex << "[" << setw(8) <<pid->id() << "], " << dec << setw(6) << pid->getPDG() << ", " << "(" << setw(6) <<pid->getType() << ") ";
01505
01506 }
01507 out << endl ;
01508
01509 setflags(out, flags);
01510 return out;
01511 }
01512
01513
01514 std::ostream& operator<<( std::ostream& out, const EVENT::ReconstructedParticle &part){
01515 out << lcio_long(part,NULL);
01516 return(out);
01517 }
01518
01519 const std::string& header(const EVENT::Track &){
01520 static std::string _vtxh(" [id] | type | d0 | phi | omega | z0 |tan lambd| reference point(x,y,z) | dEdx | dEdxErr | chi2 \n");
01521 return _vtxh;
01522 }
01523
01524 const std::string& tail(const EVENT::Track &){
01525 static std::string _vtxt("------------|-----------|---------|---------|---------|---------|---------|-------------------------------|---------|---------|----------\n");
01526 return _vtxt;
01527 }
01528
01529 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Track>& sV){
01530 const EVENT::Track * part = sV.obj;
01531 using namespace std;
01532 ostream_flags flags=saveflags(out);
01533
01534 out << noshowpos << " [" << setfill('0') << setw(8) << hex<< part->id() << "] ";
01535 out << "|" << dec << setfill(' ') << setw(8) << part->getType();
01536 out << scientific << setprecision (2) << showpos;
01537 out << "|" << part->getD0();
01538 out << "|" << part->getPhi();
01539 out << "|" << part->getOmega();
01540 out << "|" << part->getZ0();
01541 out << "|" << part->getTanLambda();
01542 out << "|" << part->getReferencePoint()[0] << ", " << part->getReferencePoint()[1] << ", " <<part->getReferencePoint()[2];
01543 out << "|" << part->getdEdx();
01544 out << "|" << part->getdEdxError();
01545 out << "|" << part->getChi2();
01546 out << endl;
01547
01548 out << "Errors: " ;
01549 unsigned int l;
01550 for(l=0;l<14;l++){
01551 out << part->getCovMatrix()[l] << ", ";
01552 }
01553 out << part->getCovMatrix()[l+1] << endl;
01554
01555
01556 out << "Tracks(id): " ;
01557 const TrackVec& tracks = part->getTracks() ;
01558 for(l=0;l<tracks.size();l++){
01559 if( tracks[l] != 0 )
01560 out << tracks[l]->id();
01561 else
01562 out << 0;
01563 if(l != tracks.size()-1){ out << ", ";}
01564 }
01565
01566 out << endl << "Hits ->";
01567 const TrackerHitVec& hits= part->getTrackerHits() ;
01568 for(l=0;l<hits.size();l++){
01569 out << "[" << hits[l]->id() << "] ";
01570 }
01571 out << endl;
01572
01573 out << "Radius of innermost hit " << part->getRadiusOfInnermostHit() << " / mm , " << " subdetector Hit numbers : " ;
01574 for(l=0 ; l< part->getSubdetectorHitNumbers().size()-1 ; l++) {
01575 out << part->getSubdetectorHitNumbers()[l] << ", " ;
01576 }
01577 out << part->getSubdetectorHitNumbers()[l+1] << endl;
01578
01579 setflags(out, flags);
01580 return out;
01581 }
01582
01583
01584 std::ostream& operator<<( std::ostream& out, const EVENT::Track &part){
01585 out << lcio_long(part,NULL);
01586 return(out);
01587 }
01588
01589
01590
01591 const std::string& header(const EVENT::Cluster &){
01592 static std::string _vtxh(" [id] |type| energy | position ( x,y,z) | itheta | iphi \n");
01593 return _vtxh;
01594 }
01595
01596
01597 const std::string& tail(const EVENT::Cluster &){
01598 static std::string _vtxt("------------|----|----------|----------------------------------|----------|----------\n");
01599 return _vtxt;
01600 }
01601
01602 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Cluster>& sV){
01603 const EVENT::Cluster * clu = sV.obj;
01604 using namespace std;
01605 ostream_flags flags=saveflags(out);
01606
01607 out << noshowpos << " [" << setfill('0') << setw(8) << hex << clu->id() << "] |" << dec;
01608 out << setfill(' ') << setw(4) << clu->getType() << "|";
01609 out << showpos << scientific << setprecision(3) << clu->getEnergy() << "|";
01610 out << clu->getPosition()[0] << ", " << clu->getPosition()[1] << ", " << clu->getPosition()[2] << "|";
01611 out << clu->getITheta() << "|";
01612 out << clu->getIPhi() << noshowpos << endl;
01613
01614 setflags(out, flags);
01615 return out;
01616 }
01617
01618
01619 std::ostream& operator<<( std::ostream& out, const EVENT::Cluster &clu){
01620 out << lcio_long(clu,NULL);
01621 return(out);
01622 }
01623
01624
01625
01626
01627 const std::string& header(const EVENT::Vertex &v){
01628 static std::string _vtxh(
01629 "\n [id] |pri| alg. type | chi2 | prob. | position ( x, y, z) | [par] | [idRecP] \n");
01630
01631 return _vtxh;
01632 }
01633
01634 const std::string& tail(const EVENT::Vertex &){
01635 static std::string _vtxt(
01636 "------------|---|-------------------|-----------|-----------|---------------------------------|-------|------------\n");
01637 return _vtxt;
01638 }
01639
01640 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Vertex>& sV){
01641 using namespace std;
01642 ostream_flags flags=saveflags(out);
01643
01644
01645 const EVENT::Vertex* v = sV.obj;
01646 out << noshowpos;
01647 out << setfill('0');
01648 out << " [" << setw(8) << hex << v->id() << "] | " << v->isPrimary()<< " | ";
01649 out << setfill(' ') << setw(17) << left << v->getAlgorithmType() << " | ";
01650 out << showpos;
01651
01652 out << setfill('0') << right << scientific << setprecision(2) << v->getChi2() << " | " << v->getProbability() << " | " <<
01653 v->getPosition()[0] << ", " << v->getPosition()[1] << ", " << v->getPosition()[2] << " | [" ;
01654
01655 out << setw(3) << v->getParameters().size() << "] | [";
01656 out << setw(8) << hex << (v->getAssociatedParticle()!=NULL?v->getAssociatedParticle()->id():0) << "]\n";
01657
01658 setflags(out, flags);
01659 return out;
01660 }
01661
01662
01663
01664 std::ostream& operator<<( std::ostream& out, const EVENT::Vertex &v){
01665 out << lcio_long(v,NULL);
01666 return out;
01667 }
01668
01669
01670 const std::string& header(const EVENT::LCRelation &v){
01671 static std::string _vtxh("| [ from ] | [ to ] | Weight |\n");
01672
01673 return _vtxh;
01674 }
01675
01676 const std::string& tail(const EVENT::LCRelation &){
01677 static std::string _vtxt("|------------|------------|--------|\n");
01678 return _vtxt;
01679 }
01680
01681 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCRelation>& sV){
01682 using namespace std;
01683 ostream_flags flags=saveflags(out);
01684
01685 const EVENT::LCRelation* v = sV.obj;
01686 out << noshowpos;
01687 out << "| [" << setw(8) << hex << (v->getFrom())->id() << "] |";
01688 out << " [" << setw(8) << hex << (v->getTo())->id() << "] |";
01689 out << " " << setw(8) << dec << v->getWeight() << "|\n";
01690
01691 setflags(out, flags);
01692 return out;
01693 }
01694
01695
01696
01697 std::ostream& operator<<( std::ostream& out, const EVENT::LCRelation &v){
01698 out << lcio_long(v,NULL);
01699 return out;
01700 }
01701
01702 const std::string& header(const EVENT::LCFloatVec &v){
01703 static std::string _vtxh("| [ id ] |\n");
01704
01705 return _vtxh;
01706 }
01707
01708 const std::string& tail(const EVENT::LCFloatVec &){
01709 static std::string _vtxt("|----------|\n");
01710 return _vtxt;
01711 }
01712
01713 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::LCFloatVec>& sV){
01714 using namespace std;
01715 const EVENT::LCFloatVec* v = sV.obj;
01716 ostream_flags flags=saveflags(out);
01717
01718 out << noshowpos;
01719 out << "| [" << setw(8) << hex << v->id() << "] |\n";
01720
01721 setflags(out, flags);
01722 return out;
01723 }
01724
01725
01726
01727 std::ostream& operator<<( std::ostream& out, const EVENT::LCFloatVec &v){
01728 out << lcio_long(v,NULL);
01729 return out;
01730 }
01731
01732
01733 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::CalorimeterHit> l) {
01734 const EVENT::CalorimeterHit *hit = l.object();
01735 const EVENT::LCCollection *col = l.collection();
01736
01737 using namespace std;
01738 ostream_flags flags=saveflags(out);
01739
01740 stringstream tmp;
01741 out << noshowpos;
01742
01743 out << setw(42) << std::setfill('-') << right << " CalorimeterHit " << setfill('-') << setw(28) << "-" << endl;
01744
01745 if(col != NULL){
01746 if(col->getTypeName() != LCIO::CALORIMETERHIT){
01747 out << "Warning: collection not of type " << LCIO::CALORIMETERHIT << endl ;
01748 setflags(out, flags);
01749 return(out);
01750 }
01751 tmp.str("");
01752 tmp << "0x" << hex << col->getFlag() << dec;
01753 out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
01754 LCTOOLS::printParameters(col->getParameters());
01755 LCFlagImpl flag(col->getFlag());
01756 cout << " -> LCIO::RCHBIT_LONG : " << flag.bitSet( LCIO::RCHBIT_LONG ) << endl ;
01757 cout << " LCIO::RCHBIT_BARREL : " << flag.bitSet( LCIO::RCHBIT_BARREL ) << endl ;
01758 cout << " LCIO::RCHBIT_ID1 : " << flag.bitSet( LCIO::RCHBIT_ID1 ) << endl ;
01759 cout << " LCIO::RCHBIT_TIME : " << flag.bitSet( LCIO::RCHBIT_TIME ) << endl ;
01760 cout << " LCIO::RCHBIT_NO_PTR : " << flag.bitSet( LCIO::RCHBIT_NO_PTR ) << endl ;
01761 cout << " LCIO::RCHBIT_ENERGY_ERROR : " << flag.bitSet( LCIO::RCHBIT_ENERGY_ERROR ) << endl ;
01762 }
01763
01764
01765
01766 tmp.str("");
01767 tmp << "0x" << hex << hit->getCellID0() << dec;
01768 out << setw(30) << setfill(' ') << left << "CellId0" << right << setw(40) << tmp.str() << endl;
01769 tmp.str("");
01770 tmp << "0x" << hex << hit->getCellID1() << dec;
01771
01772 out << setw(30) << setfill(' ') << left << "CellId1" << right << setw(40) << tmp.str() << endl;
01773 out << setw(30) << setfill(' ') << left << "Energy [GeV]" << right << setw(40) << dec << hit->getEnergy() << endl;
01774 out << setw(30) << setfill(' ') << left << "Energy Error [GeV]" << right << setw(40) << hit->getEnergyError() << endl;
01775 tmp.str("");
01776 tmp << hit->getPosition()[0] << ", " << hit->getPosition()[1] << ", " << hit->getPosition()[2];
01777 if(col != NULL){
01778 LCFlagImpl flag(col->getFlag());
01779 if(flag.bitSet(LCIO::CHBIT_LONG)){
01780 out <<setw(30) << left << showpos << "Position (x,y,z) " << setfill(' ') << right <<setw(40) << tmp.str() << endl;
01781 }
01782 else{
01783 out <<setw(30) << left << showpos << "Position (x,y,z) " << setfill(' ') << right <<setw(40) << "no position available" << endl;
01784 }
01785 }else{
01786 out <<setw(40) << left << showpos << "Position (x,y,z) [not verified]" << setfill(' ') << right <<setw(30) << tmp.str() << endl;
01787 }
01788
01789 out <<setw(30) << left << noshowpos << "Type " << setfill(' ') << right <<setw(40) << hit->getType() << endl;
01790 out << noshowpos;
01791
01792
01793 setflags(out, flags);
01794 return(out);
01795 }
01796
01797 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::Cluster> l) {
01798 const EVENT::Cluster *clu = l.object();
01799 const EVENT::LCCollection *col = l.collection();
01800
01801
01802
01803 using namespace std;
01804 ostream_flags flags=saveflags(out);
01805
01806 stringstream tmp;
01807 out << noshowpos;
01808 out << setw(41) << setfill('-') << right << " Cluster " << setfill('-') << setw(29) << "-" << endl;
01809
01810 if(col != NULL){
01811 if(col->getTypeName() != LCIO::CLUSTER){
01812 out << "Warning: collection not of type " << LCIO::CLUSTER << endl ;
01813 setflags(out, flags);
01814 return(out);
01815
01816 }
01817 tmp.str("");
01818 tmp << "0x" << hex << col->getFlag() << dec;
01819 out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
01820 LCTOOLS::printParameters(col->getParameters());
01821 LCFlagImpl flag( col->getFlag() ) ;
01822 cout << " LCIO::CLBIT_HITS : " << flag.bitSet( LCIO::CLBIT_HITS ) << endl ;
01823
01824 }
01825
01826
01827 tmp << "0x" << hex << clu->id();
01828 out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
01829 out << setw(30) << setfill(' ') << left << "Type"<< setfill(' ') << right << setw(40) << clu->getType() << endl;
01830 out << setw(30) << left << "Energy [GeV]" << right << setw(40) << clu->getEnergy() << endl;
01831 tmp.str("");
01832 tmp << dec << clu->getPosition()[0] << ", " << clu->getPosition()[1] << ", " << clu->getPosition()[2];
01833 out << setw(30) << left << "Position [mm] (x,y,z) " << setfill(' ') << right <<setw(40) << tmp.str() << endl;
01834 out << setw(30) << left << "itheta" << setfill(' ') << right <<setw(40) << clu->getITheta() << endl;
01835 out << setw(30) << left << "iphi" << setfill(' ') << right <<setw(40) << clu->getIPhi() << endl;
01836
01837
01838
01839
01840
01841
01842
01843
01844
01845
01846
01847
01848
01849
01850
01851
01852
01853
01854
01855
01856
01857
01858
01859
01860
01861
01862
01863
01864
01865
01866
01867
01868
01869
01870 setflags(out, flags);
01871 return(out);
01872 }
01873
01874
01875 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::Track> ll){
01876 const EVENT::Track *part = ll.object();
01877 const EVENT::LCCollection *col = ll.collection();
01878
01879 using namespace std;
01880 ostream_flags flags=saveflags(out);
01881
01882 stringstream tmp;
01883
01884
01885 out << noshowpos;
01886 out << setw(41) << setfill('-') << right << "-- Track ---" << setfill('-') << setw(29) << "-" << endl;
01887
01888 if(col != NULL){
01889 if(col->getTypeName() != LCIO::TRACK){
01890 out << "Warning: collection not of type " << LCIO::TRACK << endl ;
01891 setflags(out, flags);
01892 return(out);
01893
01894 }
01895 tmp.str("");
01896 tmp << "0x" << hex << col->getFlag() << dec;
01897 out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
01898 LCTOOLS::printParameters(col->getParameters());
01899 LCFlagImpl flag( col->getFlag() ) ;
01900 cout << " LCIO::TRBIT_HITS : " << flag.bitSet( LCIO::TRBIT_HITS ) << endl ;
01901
01902 }
01903
01904 tmp << hex << setfill('0') << setw(8) << part->id();
01905 out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
01906 out << setw(30) << setfill(' ') << left << "Type" << right << setw(40) << part->getType() << endl;
01907 out << setw(30) << setfill(' ') << left << "D0" << right << showpos << setw(40) << part->getD0() << endl;
01908 out << setw(30) << setfill(' ') << left << "Phi" << right << setw(40) << part->getPhi() << endl;
01909 out << setw(30) << setfill(' ') << left << "Omega" << right << setw(40) << part->getOmega() << endl;
01910 out << setw(30) << setfill(' ') << left << "Z0" << right << setw(40) << part->getZ0() << endl;
01911 out << setw(30) << setfill(' ') << left << "Tan Lambda" << right << setw(40) << part->getTanLambda() << endl;
01912
01913 tmp.str("");
01914 tmp << dec << part->getReferencePoint()[0] << ", " << part->getReferencePoint()[1] << ", " << part->getReferencePoint()[2];
01915 out << setw(30) << setfill(' ') << left << "ReferencePoint" << right << setw(40) << tmp.str() << endl;
01916 out << setw(30) << setfill(' ') << left << "dEdx" << right << setw(40) << part->getdEdx() << endl;
01917 out << setw(30) << setfill(' ') << left << "dEdx Error" << right << setw(40) << part->getdEdxError() << endl;
01918 out << setw(30) << setfill(' ') << left << "Chi2" << right << setw(40) << part->getChi2() << endl;
01919
01920 out << "Errors: " << showpos;
01921 unsigned int l;
01922 for(l=0;l<14;l++){
01923 out << part->getCovMatrix()[l];
01924 if(! ((l+1)%5)){
01925 out << endl << " ";
01926 } else{
01927 out << ", ";
01928 }
01929 }
01930 if(!((l+2)%5)){out << endl << " ";}
01931 out << part->getCovMatrix()[l+1] << endl;
01932
01933
01934
01935 out << "Tracks(id): " ;
01936 const TrackVec& tracks = part->getTracks() ;
01937 for(l=0;l<tracks.size();l++){
01938 if( tracks[l] != 0 )
01939 out << tracks[l]->id();
01940 else
01941 out << 0;
01942
01943
01944 if(!(l+1)%5){
01945 out << endl << " ";
01946 continue;
01947 }
01948 if(l != tracks.size()-1){ out << ", ";}
01949
01950 }
01951
01952 out << endl << "Hits: " << noshowpos;
01953 const TrackerHitVec& hits= part->getTrackerHits() ;
01954 for(l=0;l<hits.size();l++){
01955 out << "[" << hits[l]->id() << "] ";
01956 if(!((l+1)%7)){out << endl << " ";}
01957 }
01958 out << endl;
01959
01960 out << "Radius of innermost hit " << part->getRadiusOfInnermostHit() << " / mm , " << " subdetector Hit numbers : " ;
01961 out << endl << " ";
01962 for(l=0 ; l< part->getSubdetectorHitNumbers().size()-1 ; l++) {
01963 out << part->getSubdetectorHitNumbers()[l] << ", " ;
01964 if(!((l+1)%20)){out << endl << " ";}
01965 }
01966 if(!((l+2)%20)){out << endl << " ";}
01967 out << part->getSubdetectorHitNumbers()[l+1] << endl;
01968
01969 out << noshowpos;
01970
01971 setflags(out, flags);
01972 return(out);
01973 }
01974
01975
01976 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::ReconstructedParticle> ll){
01977 const EVENT::ReconstructedParticle *part = ll.object();
01978 const EVENT::LCCollection *col = ll.collection();
01979
01980 using namespace std;
01981 ostream_flags flags=saveflags(out);
01982
01983 stringstream tmp;
01984
01985 out << setw(41) << setfill('-') << right << " ReconstructedParticle " << setfill('-') << setw(29) << "-" << endl;
01986 if(col != NULL){
01987 if(col->getTypeName() != LCIO::RECONSTRUCTEDPARTICLE){
01988 out << "Warning: collection not of type " << LCIO::RECONSTRUCTEDPARTICLE << endl ;
01989 setflags(out, flags);
01990 return(out);
01991
01992 }
01993 tmp.str("");
01994 tmp << "0x" << hex << col->getFlag() << dec;
01995 out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
01996 LCTOOLS::printParameters(col->getParameters());
01997 }
01998
01999 tmp.str("");
02000 tmp<<"0x" << hex << part->id() << dec;
02001 out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
02002 out << dec << setw(30) << setfill(' ') << left << "Compound" << right << setw(40) << part->isCompound() << endl;
02003 out << setw(30) << setfill(' ') << left << "Type" << right << setw(40) << part->getType() << endl;
02004
02005 tmp.str("");
02006 tmp << showpos << scientific << setprecision(2);
02007 tmp << part->getMomentum()[0] << ", " << part->getMomentum()[1] << ", " << part->getMomentum()[2];
02008 out << setw(30) << setfill(' ') << left << "Momentum (x,y,z)" << right << setw(40) << tmp.str() << endl;
02009
02010 out << noshowpos << scientific << setprecision(2);
02011 out << setw(30) << setfill(' ') << left << "Mass [GeV]" << right << setw(40) << part->getMass() << endl;
02012
02013 out << setw(30) << setfill(' ') << left << "Charge [e]" << right << setw(40) << part->getCharge() << endl;
02014 out << setw(30) << setfill(' ') << left << "Energy [GeV]" << right << setw(40) << part->getEnergy() << endl;
02015
02016 tmp.str("");
02017 tmp << part->getReferencePoint()[0] << ", " << part->getReferencePoint()[1] << ", " << part->getReferencePoint()[2];
02018
02019 out << setw(30) << setfill(' ') << left << "ReferencePoint" << right << setw(40) << tmp.str() << endl;
02020 out << setw(30) << setfill(' ') << left << "ParticleIDUsed";
02021
02022
02023 if(part->getParticleIDUsed() != 0 ){
02024 tmp.str("");
02025 tmp << "0x" << hex << part->getParticleIDUsed()->id() << dec;
02026 out << hex << right << setw(40) << tmp.str() << endl;
02027 }else{
02028 out << right << setw(40) << 0 << endl;
02029 }
02030
02031 out << "Covariance p,E: ";
02032
02033 for(int l=0;l<10;l++){
02034 if(l==5) { out << endl << " ";}
02035 if(l==9){
02036 out << scientific << setprecision(2) << part->getCovMatrix()[l];
02037 }else{
02038 out << scientific << setprecision(2) << part->getCovMatrix()[l] << ", ";
02039 }
02040 }
02041
02042
02043 out << endl << "Particles id: ";
02044 for(unsigned int l=0;l<part->getParticles().size();l++){
02045 if(l == part->getParticles().size()-1){
02046 out << hex << setfill('0') << "[" <<setw(8) << part->getParticles()[l]->id() << "]";
02047 }else{
02048 out << hex << setfill('0') << "[" <<setw(8) << part->getParticles()[l]->id() << "], ";
02049 }
02050 if(! ((l+1)%4)) { out << endl <<" ";}
02051 }
02052
02053
02054 out << endl << "Tracks id: ";
02055 for(unsigned int l=0;l<part->getTracks().size();l++){
02056 if(! ((l+1)%5)){ out << endl << " ";}
02057 if(l == part->getTracks().size()-1){
02058 out << hex << setfill('0') << "[" << setw(8) << part->getTracks()[l]->id() << "]";
02059 }else{
02060 out << hex << setfill('0') << "[" << setw(8) << part->getTracks()[l]->id() << "], ";
02061 }
02062
02063 }
02064
02065 out << endl << "Clusters id: ";
02066 for(unsigned int l=0;l<part->getClusters().size();l++){
02067 if(! ((l+1)%5)){ out << endl << " ";}
02068
02069 if(l == part->getClusters().size()-1){
02070 out << hex << setfill('0') << "[" << setw(8) << part->getClusters()[l]->id() << "]";
02071 }else{
02072 out << hex << setfill('0') << "[" << setw(8) << part->getClusters()[l]->id() << "], ";
02073 }
02074
02075 }
02076 out << endl << "Particle ids ( [id], PDG, (type)): " << endl;
02077 for(unsigned int l=0;l<part->getParticleIDs().size();l++){
02078 ParticleID* pid = part->getParticleIDs()[l] ;
02079 out << hex << " " << "[" << setw(8) <<pid->id() << "], " << dec << setw(6) << pid->getPDG() << ", " << "(" << setw(6) <<pid->getType() << ") " << endl;
02080 }
02081 out << endl ;
02082
02083 setflags(out, flags);
02084 return(out);
02085 }
02086
02087 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::SimCalorimeterHit> ll){
02088 const EVENT::SimCalorimeterHit *hit = ll.object();
02089 const EVENT::LCCollection *col = ll.collection();
02090
02091 using namespace std;
02092 ostream_flags flags=saveflags(out);
02093
02094 stringstream tmp;
02095
02096
02097 out << noshowpos;
02098 out << setw(46) << std::setfill('-') << right << " SimCalorimeterHit " << setfill('-') << setw(24) << "-" << endl;
02099
02100 if(col != NULL){
02101 if(col->getTypeName() != LCIO::SIMCALORIMETERHIT){
02102 out << "Warning: collection not of type " << LCIO::SIMCALORIMETERHIT << endl ;
02103 setflags(out, flags);
02104 return(out);
02105
02106 }
02107 tmp.str("");
02108 tmp << "0x" << hex << col->getFlag() << dec;
02109 out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
02110 LCTOOLS::printParameters(col->getParameters());
02111
02112 LCFlagImpl flag( col->getFlag() ) ;
02113 cout << " -> LCIO::CHBIT_LONG : " << flag.bitSet( LCIO::CHBIT_LONG ) << endl ;
02114 cout << " LCIO::CHBIT_BARREL : " << flag.bitSet( LCIO::CHBIT_BARREL ) << endl ;
02115 cout << " LCIO::CHBIT_ID1 : " << flag.bitSet( LCIO::CHBIT_ID1 ) << endl ;
02116 cout << " LCIO::CHBIT_PDG : " << flag.bitSet( LCIO::CHBIT_PDG ) << endl ;
02117 }
02118 tmp << "0x" << hex << hit->id() << dec;
02119 out << setw(30) << setfill(' ') << std::left << "Id" << right << setw(40) << tmp.str() << endl;
02120
02121 out << setw(30) << left << "CellID0"<< setfill(' ') << right << setw(40) << hex << hit->getCellID0() << endl;
02122 out << setw(30) << left << "CellID1"<< setfill(' ') << right << setw(40) << hex << hit->getCellID1() << endl;
02123 out << setw(30) << left << "Energy [GeV]" << right << setw(40) << dec << hit->getEnergy() << std::endl;
02124
02125 tmp.str("");
02126 tmp << hit->getPosition()[0] << ", " << hit->getPosition()[1] << ", " << hit->getPosition()[2];
02127 if(col != NULL){
02128 LCFlagImpl flag(col->getFlag());
02129 if(flag.bitSet(LCIO::CHBIT_LONG)){
02130 out <<setw(30) << left << showpos << "Position (x,y,z) " << setfill(' ') << right <<setw(40) << tmp.str() << endl;
02131 }
02132 else{
02133 out <<setw(30) << left << showpos << "Position (x,y,z) " << setfill(' ') << right <<setw(40) << "no position available" << endl;
02134 }
02135 }else{
02136 out <<setw(40) << left << showpos << "Position (x,y,z) [not verified]" << setfill(' ') << right <<setw(30) << tmp.str() << endl;
02137 }
02138
02139
02140
02141 out << setw(30) << std::left << "N MC Contributions: "<< setfill(' ') << right << setw(40) << hit->getNMCContributions() << endl;
02142 for(int k=0;k < hit->getNMCContributions();k++){
02143 try{
02144 out << setw(30) << left << "Particle Number" << right << setw(40) << k << endl;
02145 out << setw(30) << left << " Prim. PDG" << right << setw(40) << hit->getParticleCont( k)->getPDG() << endl;
02146 out << setw(30) << left << " Energy [GeV]" << right << setw(40) << hit->getEnergyCont(k) << endl;
02147 out << setw(30) << left << " Time" << right << setw(40) << hit->getTimeCont(k) << endl;
02148 out << setw(30) << left << " Sec. PDG" << right << setw(40) << hit->getPDGCont(k) << endl;
02149 }catch(exception& e){
02150 out << e.what() << endl ;
02151 }
02152 }
02153
02154 out << noshowpos;
02155
02156 setflags(out, flags);
02157 return(out);
02158 }
02159
02160 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::TrackerHit> ll){
02161 const EVENT::TrackerHit *hit = ll.object();
02162 const EVENT::LCCollection *col = ll.collection();
02163
02164 using namespace std;
02165 ostream_flags flags=saveflags(out);
02166
02167 stringstream tmp;
02168 out << noshowpos;
02169 out << setw(41) << setfill('-') << right << " TrackerHit " << setfill('-') << setw(29) << "-" << endl;
02170 if(col != NULL){
02171 if(col->getTypeName() != LCIO::TRACKERHIT){
02172 out << "Warning: collection not of type " << LCIO::TRACKERHIT << endl ;
02173 setflags(out, flags);
02174 return(out);
02175
02176 }
02177 tmp.str("");
02178 tmp << "0x" << hex << col->getFlag() << dec;
02179 out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
02180 LCTOOLS::printParameters(col->getParameters());
02181
02182 LCFlagImpl flag( col->getFlag() ) ;
02183 cout << " LCIO::CHBIT_BARREL : " << flag.bitSet( LCIO::CHBIT_BARREL ) << endl ;
02184 }
02185 tmp.str("");
02186 tmp << "0x" << hex << hit->id() << dec;
02187 out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
02188 tmp.str("");
02189 tmp << hit->getPosition()[0] << ", " << hit->getPosition()[1] << ", " << hit->getPosition()[2];
02190 out << setw(30) << left << "Position (x,y,z) " << setfill(' ') << right <<setw(40) << tmp.str() << endl;
02191 out << setw(30) << left << "E_deposited " << setfill(' ') << right << setw(40) << hit->getEDep() << endl;
02192 out << setw(30) << left << "Time " << setfill(' ') << right << setw(40) << hit->getTime() << endl;
02193 out << setw(30) << left << "Type " << setfill(' ') << right << setw(40) << hit->getType() << endl;
02194 out << noshowpos;
02195
02196 setflags(out, flags);
02197 return(out);
02198 }
02199
02200
02201 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::SimTrackerHit> ll){
02202 const EVENT::SimTrackerHit *hit = ll.object();
02203 const EVENT::LCCollection *col = ll.collection();
02204
02205 using namespace std;
02206 ostream_flags flags=saveflags(out);
02207
02208 stringstream tmp;
02209 out << noshowpos;
02210
02211 out << setw(42) << std::setfill('-') << right << " SimTrackerHit " << setfill('-') << setw(28) << "-" << endl;
02212 if(col != NULL){
02213 if(col->getTypeName() != LCIO::SIMTRACKERHIT){
02214 out << "Warning: collection not of type " << LCIO::SIMTRACKERHIT << endl ;
02215 setflags(out, flags);
02216 return(out);
02217
02218 }
02219 tmp.str("");
02220 tmp << "0x" << hex << col->getFlag() << dec;
02221 out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
02222 LCTOOLS::printParameters(col->getParameters());
02223
02224 LCFlagImpl flag( col->getFlag() ) ;
02225 cout << " LCIO::THBIT_BARREL : " << flag.bitSet( LCIO::THBIT_BARREL ) << endl ;
02226 cout << " LCIO::THBIT_MOMENTUM : " << flag.bitSet( LCIO::THBIT_MOMENTUM ) << endl ;
02227 }
02228
02229 tmp.str("");
02230 tmp << "0x" << hex << hit->getCellID() << dec;
02231 out << setw(30) << setfill(' ') << std::left << "CellID" << right << setw(40) << tmp.str() << endl;
02232 tmp.str("");
02233 tmp << dec << hit->getPosition()[0] << ", " << hit->getPosition()[1] << ", " << hit->getPosition()[2];
02234 out <<setw(30) << std::left << "Position [mm] (x,y,z) " << dec << setfill(' ') << right <<setw(40) << tmp.str() << endl;
02235 out <<setw(30) << std::left << "dE/dx [GeV]" << setfill(' ') << right <<setw(40) << hit->getEDep() << endl;
02236 out <<setw(30) << std::left << "Time [ns]" << setfill(' ') << right <<setw(40) << hit->getTime() << endl;
02237 if(hit->getMCParticle() != NULL){
02238 out <<std::setw(30) << std::left << "PDG of MCParticle " << setfill(' ') << right <<setw(40) << hit->getMCParticle()->getPDG() << std::endl;
02239 }else{
02240 out <<std::setw(30) << std::left << "PDG of MCParticle " << setfill(' ') << right <<setw(40) << "[Empty]" << std::endl;
02241 }
02242
02243
02244 tmp << hit->getMomentum()[0] << ", " << hit->getMomentum()[1] << ", " << hit->getMomentum()[2];
02245 if(col != NULL){
02246 LCFlagImpl flag(col->getFlag());
02247 if(flag.bitSet(LCIO::THBIT_MOMENTUM)){
02248 out <<setw(40) << left << "Momentum [GeV] (x,y,z) [not verified]" << setfill(' ') << right <<setw(30) << tmp.str() << endl;
02249 }else{
02250 out <<setw(30) << left << "Momentum [GeV] (x,y,z)" << setfill(' ') << right <<setw(40) << "not available" << endl;
02251 }
02252 }else{
02253 out <<setw(40) << left << "Momentum [GeV] (x,y,z) [not verified]" << setfill(' ') << right <<setw(30) << tmp.str() << endl;
02254 }
02255 out <<setw(30) << left << "PathLength " << setfill(' ') << right <<setw(40) << hit->getPathLength() << endl;
02256
02257 setflags(out, flags);
02258 return(out);
02259 }
02260
02261
02262 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::MCParticle> ll){
02263 const EVENT::MCParticle *mcp = ll.object();
02264 const EVENT::LCCollection *col = ll.collection();
02265
02266 using namespace std;
02267 ostream_flags flags=saveflags(out);
02268
02269 stringstream tmp;
02270 out << noshowpos;
02271
02272
02273 out << setw(41) << std::setfill('-') << right << " MCParticle " << setfill('-') << setw(29) << "-" << std::endl;
02274 if(col != NULL){
02275 if(col->getTypeName() != LCIO::MCPARTICLE){
02276 out << "Warning: collection not of type " << LCIO::MCPARTICLE << endl ;
02277 setflags(out, flags);
02278 return(out);
02279
02280 }
02281 tmp.str("");
02282 tmp << "0x" << hex << col->getFlag() << dec;
02283 out << setw(30) << setfill(' ') << left << "Collection Flag" << right << setw(40) << tmp.str() << endl;
02284 LCTOOLS::printParameters(col->getParameters());
02285 }
02286
02287 tmp.str("");
02288 tmp << "0x" << hex << mcp->id() << dec;
02289 out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
02290 out << setw(30) << left << "PDG"<< setfill(' ') << right << setw(40) << mcp->getPDG() << endl;
02291 out << setw(30) << std::left << "Energy [GeV]" << right << setw(40) << mcp->getEnergy() << endl;
02292
02293
02294 tmp.str("");
02295 tmp << mcp->getMomentum()[0] << ", " << mcp->getMomentum()[1] << ", " << mcp->getMomentum()[2];
02296 out << setw(30) << left << "Momentum [GeV] (x,y,z) " << setfill(' ') << right <<setw(40) << tmp.str() << endl;
02297
02298
02299 out << setw(30) << left <<"GeneratorStatus" << setfill(' ') << right << setw(40) << mcp->getGeneratorStatus() << endl;
02300
02301
02302
02303 tmp.str("");
02304 tmp << mcp->getVertex()[0] << ", " << mcp->getVertex()[1] << ", " << mcp->getVertex()[2];
02305 out << setw(30) << left << "Vertex [mm] (x,y,z) " << setfill(' ') << right << setw(40) << right << tmp.str() << endl;
02306
02307 tmp.str("");
02308 tmp << mcp->getEndpoint()[0] << ", " << mcp->getEndpoint()[1] << ", " << mcp->getEndpoint()[2] ;
02309 out << setw(30) << left <<"Endpoint [mm] (x,y,z) " << setfill(' ') << setw(40) << right << tmp.str() << endl;
02310 out << setw(30) << left << "Mass [GeV] " << right << setw(40) << mcp->getMass() << endl;
02311 out << setw(30) << left << "Charge " << right << setw(40) << mcp->getCharge() << endl;
02312 out << setw(30) << left << "Parents " <<right << setw(40) << mcp->getParents().size() << endl;
02313 out << setw(30) << left << "Daughters " << right << setw(40) << mcp->getDaughters().size() << endl;
02314
02315
02316 if(mcp->getSimulatorStatus() != 0){
02317 out<<LCTOOLS::getSimulatorStatusString() << LCTOOLS::getSimulatorStatusString((MCParticle *) mcp) << endl;
02318 }
02319
02320 setflags(out, flags);
02321 return(out);
02322 }
02323
02324 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::Vertex> ll){
02325 const EVENT::Vertex *v = ll.object();
02326 const EVENT::LCCollection *col = ll.collection();
02327
02328 using namespace std;
02329 ostream_flags flags=saveflags(out);
02330
02331 stringstream tmp;
02332 out << noshowpos;
02333
02334 out << setw(41) << std::setfill('-') << right << " Vertex " << setfill('-') << setw(29) << "-" << endl;
02335 if(col != NULL){
02336 if(col->getTypeName() != LCIO::VERTEX){
02337 out << "Warning: collection not of type " << LCIO::VERTEX << endl ;
02338 setflags(out, flags);
02339 return(out);
02340 }
02341 }
02342
02343 tmp.str("");
02344 tmp << "0x" << hex << v->id() << dec;
02345
02346 out << setw(30) << setfill(' ') << left << "Id" << right << setw(40) << tmp.str() << endl;
02347 out << setw(30) << setfill(' ') << left << "Is Primary Vertex" << right << setw(40) << (v->isPrimary() ? "yes":"no") << endl;
02348 out << setw(30) << setfill(' ') << left << "Algorithm Type" << right << setw(40) << v->getAlgorithmType() << endl;
02349 out << scientific << setprecision(5);
02350
02351 out << setw(30) << setfill(' ') << left << "Chi2" << right << setw(40) << v->getChi2() << endl;
02352 out << setw(30) << setfill(' ') << left << "Probability" << right << setw(40) << v->getProbability() << endl;
02353 tmp.str("");
02354 tmp<<setprecision(5);
02355 tmp << v->getPosition()[0] <<", "<<v->getPosition()[0] <<", "<<v->getPosition()[0];
02356 out << setw(30) << setfill(' ') << left << "Position (x,y,z)" << right << setw(40) << tmp.str() << endl;
02357
02358 out << "Covariance Matrix ";
02359 for(unsigned int i=0; i<v->getCovMatrix().size(); i++){
02360 out << v->getCovMatrix()[i] << (i<(v->getCovMatrix().size()-1)?", ":"\n");
02361 if((! ((i+1)%3)) && i < v->getCovMatrix().size()- 1){ cout << endl << " "; }
02362 }
02363
02364 out << setw(30) << setfill(' ') << left << "Parameters";
02365
02366 if(v->getParameters().size()==0){
02367 out << right << setw(40) << "[Empty]" << endl;
02368 } else { out << endl; }
02369
02370 for(unsigned int i=0; i < v->getParameters().size(); i++){
02371 out << " Parameter [";
02372 out << setw(3) << i << "]:\t";
02373 out << scientific << setprecision(5) << v->getParameters()[i] << endl;
02374 }
02375
02376 out << setw(30) << setfill(' ') << left << "ARP ID" << right << setw(40) << (v->getAssociatedParticle()!=NULL?v->getAssociatedParticle()->id():0) << endl;
02377
02378 setflags(out, flags);
02379 return out;
02380 }
02381
02382
02383 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCRelation> ll){
02384 const EVENT::LCRelation *v = ll.object();
02385 const EVENT::LCCollection *col = ll.collection();
02386
02387 using namespace std;
02388 ostream_flags flags=saveflags(out);
02389
02390 stringstream tmp;
02391 out << noshowpos;
02392
02393 out << setw(41) << std::setfill('-') << right << " LCRelation " << setfill('-') << setw(29) << "-" << endl;
02394 if(col != NULL){
02395 if(col->getTypeName() != LCIO::LCRELATION){
02396 out << "Warning: collection not of type " << LCIO::LCRELATION << endl ;
02397 setflags(out, flags);
02398 return(out);
02399 }
02400 }
02401
02402 out << setw(30) << setfill(' ') << left << "From [id]" << right << hex << (v->getFrom())->id() << endl;
02403 out << setw(30) << setfill(' ') << left << "To [id]" << right << (v->getTo())->id() << endl;
02404 out << setw(30) << setfill(' ') << left << "Weight" << right << v->getWeight() << endl;
02405
02406 setflags(out, flags);
02407 return out;
02408 }
02409
02410
02411 std::ostream& operator<<( std::ostream& out, const LCIO_LONG<EVENT::LCFloatVec> ll){
02412 const EVENT::LCFloatVec *v = ll.object();
02413 const EVENT::LCCollection *col = ll.collection();
02414
02415 using namespace std;
02416 ostream_flags flags=saveflags(out);
02417
02418 stringstream tmp;
02419 out << noshowpos;
02420
02421 out << setw(41) << std::setfill('-') << right << " LCFloatVec " << setfill('-') << setw(29) << "-" << endl;
02422 if(col != NULL){
02423 if(col->getTypeName() != LCIO::LCFLOATVEC){
02424 out << "Warning: collection not of type " << LCIO::LCFLOATVEC << endl ;
02425 setflags(out, flags);
02426 return(out);
02427 }
02428 }
02429 tmp.str("");
02430 tmp << "0x" << hex << v->id() << dec;
02431 out << setw(30) << setfill(' ') << left << "Id" << right << tmp.str() << endl;
02432
02433 setflags(out, flags);
02434 return out;
02435 }
02436
02437
02438
02439
02440
02441
02442
02443
02444
02445
02446
02447
02448
02449
02450
02451
02452
02453
02454
02455
02456
02457
02458
02459
02460
02461
02462
02463
02464 }
02465