Bool_t bResult = kTRUE;
- if ( ! strcmp(obj->ClassName(),"AliHLTJETConeJetCandidate") )
- bResult = IsSelected( dynamic_cast<AliHLTJETConeJetCandidate*> (obj));
- else if ( ! strcmp(obj->ClassName(),"AliAODJet") )
- bResult = IsSelected( dynamic_cast<AliAODJet*> (obj));
+ if ( obj->IsA() == AliHLTJETConeJetCandidate::Class() )
+ bResult = IsSelected( static_cast<AliHLTJETConeJetCandidate*> (obj));
+ else if ( obj->IsA() == AliAODJet::Class() )
+ bResult = IsSelected( static_cast<AliAODJet*> (obj));
else {
HLTError("Unknown object type %s", obj->ClassName() );
bResult = kFALSE;
// -- Loop over particles
// ------------------------
- for ( Int_t iter = 0; iter < fESD->GetNumberOfTracks() && !bResult; iter++ ) {
+ // for ( Int_t iter = 0; iter < fESD->GetNumberOfTracks() && !bResult; iter++ ) { JMT Coverity
+ for ( Int_t iter = 0; iter < fESD->GetNumberOfTracks() && bResult; iter++ ) {
AliESDtrack* esdTrack = fESD->GetTrack(iter);
if ( ! esdTrack ) {
Bool_t bResult = kTRUE;
- if ( ! strcmp(obj->ClassName(),"TParticle") )
- bResult = IsSelected( dynamic_cast<TParticle*> (obj));
- else if ( ! strcmp(obj->ClassName(),"AliESDtrack") )
- bResult = IsSelected( dynamic_cast<AliESDtrack*> (obj));
+ if ( obj->IsA() == TParticle::Class() )
+ bResult = IsSelected( static_cast<TParticle*> (obj));
+ else if ( obj->IsA() == AliESDtrack::Class() )
+ bResult = IsSelected( static_cast<AliESDtrack*> (obj));
else {
HLTError("Unknown object type %s", obj->ClassName() );
bResult = kFALSE;
// -- Initialize Reader
AliHLTJETReader *reader = dynamic_cast<AliHLTJETReader*> (fReader);
-
+ if (!reader) {
+ HLTError( "Casting Reader failed!");
+ return -EINPROGRESS;
+ }
+
iResult = reader->Initialize();
if ( iResult ) {
HLTError( "Initializing Reader failed!");
- return iResult;
+ return -EINPROGRESS;
}
// -- Initialize Header
AliHLTJETConeHeader *header = dynamic_cast<AliHLTJETConeHeader*> (fHeader);
+ if (!header) {
+ HLTError( "Casting Header failed!");
+ return -EINPROGRESS;
+ }
iResult = header->Initialize();
if ( iResult ) {
HLTError( "Initializing Header failed!");
- return iResult;
+ return -EINPROGRESS;
}
// -- Set ptr to grid
Int_t AliHLTJETConeJetCandidate::Compare( const TObject* obj) const {
// see header file for class documentation
- if (this == obj)
+ if (this == obj )
return 0;
-
- if ( fSeedPt < (dynamic_cast<AliHLTJETConeJetCandidate*>
- ( const_cast<TObject*>(obj)))->GetSeedPt() )
- return 1;
+
+ AliHLTJETConeJetCandidate * cand = dynamic_cast<AliHLTJETConeJetCandidate*>(const_cast<TObject*>(obj));
+ if (cand) {
+ if ( fSeedPt < cand->GetSeedPt() )
+ return 1;
+ else
+ return -1;
+ }
else
- return -1;
+ return 0;
}
/*
Bool_t bResult = kTRUE;
- if ( ! strcmp(obj->ClassName(),"TParticle") )
- bResult = IsSelected( dynamic_cast<TParticle*> (obj));
- else if ( ! strcmp(obj->ClassName(),"AliESDtrack") )
- bResult = IsSelected( dynamic_cast<AliESDtrack*> (obj));
+ if ( obj->IsA() == TParticle::Class() )
+ bResult = IsSelected( static_cast<TParticle*> (obj));
+ else if ( obj->IsA() == AliESDtrack::Class() )
+ bResult = IsSelected( static_cast<AliESDtrack*> (obj));
else {
HLTError("Unknown object type %s", obj->ClassName() );
bResult = kFALSE;