Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

AlJet.cpp

Go to the documentation of this file.
00001 
00002 //
00003 // Implementation of
00004 // CLASS AlJet
00005 // Concrete class for Jet Objects, inherits from QvecBase
00006 //
00007 // Author :  M. Hoerndl
00008 // modified by C. Delaere:
00009 //          - added lock, unlock, clearObjects, sig2,
00010 //            conversion constructors from protojets
00011 //          - fixed assignement operator
00012 //
00014 
00015 #include "AlJet.h"
00016 #include "DurhamProtoJet.h"
00017 #include "JadeProtoJet.h"
00018 #include "AlephCollection.h"
00019 
00020 // default constructor : has to do something,
00021 // since it is not created out of qvec
00022 AlJet::AlJet()
00023 {
00024   _objects = new AlephCollection<AlObject*>;
00025   _scheme = 0;
00026   _metric = 0;
00027 } 
00028 
00029 AlJet::~AlJet()
00030 {
00031   delete _objects;
00032 }
00033 
00034 AlJet::AlJet(const AlJet& oldAl):QvecBase(oldAl)
00035 {
00036   _objects = new AlephCollection<AlObject*>;
00037   *_objects = *(oldAl._objects);
00038   _scheme = oldAl._scheme;
00039   _metric = oldAl._metric;
00040 }
00041 
00042 AlJet::AlJet(const DurhamProtoJet& protojet)
00043 {
00044   float charge=0;
00045   setA4V(protojet.get4Momentum());
00046   setScheme(DurhamProtoJet::Scheme);
00047   setMetric(0);
00048   vector<const QvecBase *> aCandConstituants = protojet.getConstituants();
00049   vector<const QvecBase *>::iterator aCandIter;
00050   //loop on constituants to fill Objects vector of AlJet
00051   _objects = new AlephCollection<AlObject*>;
00052   for(aCandIter=aCandConstituants.begin();
00053       aCandIter!=aCandConstituants.end();
00054       aCandIter++)
00055     {
00056       charge += (*aCandIter)->QCH();
00057       addObject(*aCandIter);
00058     }
00059   setQCH(charge);
00060 }
00061 
00062 AlJet::AlJet(const JadeProtoJet& protojet)
00063 {
00064   float charge=0;
00065   setA4V(protojet.get4Momentum());
00066   setScheme(JadeProtoJet::Scheme);
00067   setMetric(1);
00068   const vector<const QvecBase *> aCandConstituants = protojet.getConstituants();
00069   vector<const QvecBase *>::const_iterator aCandIter;
00070   //loop on constituants to fill Objects vector of AlJet
00071   _objects = new AlephCollection<AlObject*>;
00072   for(aCandIter=aCandConstituants.begin();
00073       aCandIter!=aCandConstituants.end();
00074       aCandIter++)
00075     {
00076       charge += (*aCandIter)->QCH();
00077       addObject(*aCandIter);
00078     }
00079   setQCH(charge);
00080 }
00081 
00082 AlJet& AlJet::operator=(const AlJet& oldAl)
00083 {
00084  *_objects = *(oldAl._objects);
00085  _scheme   = oldAl._scheme;
00086  _metric   = oldAl._metric;
00087  _A4V      = oldAl._A4V;
00088  oVertex   = oldAl.oVertex;
00089  eVertex   = oldAl.eVertex;
00090  _locked   = oldAl._locked;
00091  _qch      = oldAl._qch;
00092  return *this;
00093 }
00094 
00095 
00096 // specialised lock
00097 void AlJet::Lock(bool recurse)
00098 {
00099   if (recurse)
00100     for (vector<AlObject*>::iterator i = _objects->begin();i<_objects->end();i++)
00101       (*i)->Lock(1);
00102   _locked = 1;
00103 }
00104 void AlJet::unLock(bool recurse)
00105 {
00106   if (recurse)
00107     for (vector<AlObject*>::iterator i = _objects->begin();i<_objects->end();i++)
00108       (*i)->unLock(1);
00109   _locked = 0;
00110 }
00111 
00112 AlephCollection<AlObject*>& AlJet::getObjects() const
00113 { return (AlephCollection<AlObject*>&)(*_objects); }
00114 
00115 void AlJet::addObject(const AlObject* a) 
00116 { 
00117         _objects->push_back((AlObject*)a); 
00118 }
00119 
00120 void AlJet::clearObjects() 
00121 { _objects->clear(); }
00122 
00123 void AlJet::setScheme(int s) 
00124 { _scheme = s; }
00125 
00126 int AlJet::getScheme() const
00127 { return _scheme; }
00128 
00129 void AlJet::setMetric(int m) 
00130 { _metric = m; }
00131 
00132 int AlJet::getMetric() const
00133 { return _metric; }
00134 

Generated at Wed Jun 18 17:19:10 2003 for ALPHA++ by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001