CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

EcalBoundaryInfoCalculator< EcalDetId > Class Template Reference

#include <EcalBoundaryInfoCalculator.h>

List of all members.

Public Member Functions

BoundaryInformation boundaryRecHits (const edm::Handle< EcalRecHitCollection > &, const EcalRecHit *, const edm::ESHandle< CaloTopology > theCaloTopology, const edm::ESHandle< EcalChannelStatus > ecalStatus, const edm::ESHandle< CaloGeometry > geometry)
bool checkRecHitHasDeadNeighbour (const EcalRecHit hit, const edm::ESHandle< EcalChannelStatus > ecalStatus, vector< int > &stati)
bool checkRecHitHasInvalidNeighbour (const EcalRecHit hit, const edm::ESHandle< EcalChannelStatus > ecalStatus)
 EcalBoundaryInfoCalculator ()
BoundaryInformation gapRecHits (const edm::Handle< EcalRecHitCollection > &, const EcalRecHit *, const edm::ESHandle< CaloTopology > theCaloTopology, const edm::ESHandle< EcalChannelStatus > ecalStatus, const edm::ESHandle< CaloGeometry > geometry)
void setDebugMode ()
 ~EcalBoundaryInfoCalculator ()

Private Member Functions

CdOrientation goBackOneCell (CdOrientation currDirection, EcalDetId prev)
void initializeEcalNavigator (DetId startE, const edm::ESHandle< CaloTopology > theCaloTopology, EcalSubdetector ecalSubDet)
EcalDetId makeStepInDirection (CdOrientation direction, CaloNavigator< EcalDetId > *theNavi)
CdOrientation turnLeft (CdOrientation currDirection, bool reverseOrientation)
CdOrientation turnRight (CdOrientation currDirection, bool reverseOrientation)

Private Attributes

bool debug
map< CdOrientation, CdOrientationnextDirs
map< CdOrientation, CdOrientationoppositeDirs
map< CdOrientation, CdOrientationprevDirs
CaloNavigator< EcalDetId > * theEcalNav

Detailed Description

template<class EcalDetId>
class EcalBoundaryInfoCalculator< EcalDetId >

Definition at line 26 of file EcalBoundaryInfoCalculator.h.


Constructor & Destructor Documentation

template<class EcalDetId >
EcalBoundaryInfoCalculator< EcalDetId >::EcalBoundaryInfoCalculator ( )
template<class EcalDetId >
EcalBoundaryInfoCalculator< EcalDetId >::~EcalBoundaryInfoCalculator ( )

Definition at line 332 of file EcalBoundaryInfoCalculator.h.

                                                                                             {
    delete theEcalNav;
}

Member Function Documentation

template<class EcalDetId >
BoundaryInformation EcalBoundaryInfoCalculator< EcalDetId >::boundaryRecHits ( const edm::Handle< EcalRecHitCollection > &  RecHits,
const EcalRecHit hit,
const edm::ESHandle< CaloTopology theCaloTopology,
const edm::ESHandle< EcalChannelStatus ecalStatus,
const edm::ESHandle< CaloGeometry geometry 
)

Definition at line 336 of file EcalBoundaryInfoCalculator.h.

References BoundaryInformation::boundaryEnergy, BoundaryInformation::boundaryET, BoundaryInformation::channelStatus, gather_cfg::cout, cond::rpcobimon::current, debug, BoundaryInformation::detIds, EcalBarrel, EcalEndcap, CaloRecHit::energy(), eta(), PV3DBase< T, PVType, FrameType >::eta(), CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), EcalRecHit::id(), BoundaryInformation::nextToBorder, north, BoundaryInformation::recHits, alignCSCRings::s, errorMatrix2Lands_multiChannel::start, ntuplemaker::status, and BoundaryInformation::subdet.

Referenced by EcalDeadCellBoundaryEnergyFilter::filter().

                                                                                       {

    //initialize boundary information
    std::vector<EcalRecHit> boundaryRecHits;
    std::vector<DetId> boundaryDetIds;
    std::vector<int> stati;

    double boundaryEnergy = 0;
    double boundaryET = 0;
    int beCellCounter = 0;
    bool nextToBorder = false;

    boundaryRecHits.push_back(*hit);
    ++beCellCounter;
    boundaryEnergy += hit->energy();
    EcalDetId hitdetid = (EcalDetId) hit->id();
    boundaryDetIds.push_back(hitdetid);
    const CaloSubdetectorGeometry* subGeom = geometry->getSubdetectorGeometry(hitdetid);
    const CaloCellGeometry* cellGeom = subGeom->getGeometry(hitdetid);
    double eta = cellGeom->getPosition().eta();
    boundaryET += hit->energy() / cosh(eta);

    if (debug) {
        std::cout << "Find Boundary RecHits..." << std::endl;

        if (hitdetid.subdet() == EcalBarrel) {
            std::cout << "Starting at : (" << ((EBDetId) hitdetid).ieta() << "," << ((EBDetId) hitdetid).iphi() << ")"
            << std::endl;

        } else if (hitdetid.subdet() == EcalEndcap) {
            std::cout << "Starting at : (" << ((EEDetId) hitdetid).ix() << "," << ((EEDetId) hitdetid).iy() << ")"
            << std::endl;
        }
    }

    //initialize navigator
    initializeEcalNavigator(hitdetid, theCaloTopology, EcalDetId::subdet());
    CdOrientation currDirection = north;
    bool reverseOrientation = false;

    EcalDetId next(0);
    EcalDetId start = hitdetid;
    EcalDetId current = start;
    int current_status = 0;

    // Search until a dead cell is ahead
    bool startAlgo = false;
    int noDirs = 0;
    while (!startAlgo) {
        next = makeStepInDirection(currDirection, theEcalNav);
        theEcalNav->setHome(current);
        theEcalNav->home();
        EcalChannelStatus::const_iterator chit = ecalStatus->find(next);
        int status = (chit != ecalStatus->end()) ? chit->getStatusCode() & 0x1F : -1;
        if (status > 0) {
            stati.push_back(status);
            startAlgo = true;
            break;
        }
        currDirection = turnLeft(currDirection, reverseOrientation);
        ++noDirs;
        if (noDirs > 4) {

            cout << "No starting direction can be found: This should never happen if RecHit has a dead neighbour!" << endl;
            throw "ERROR";
            break;
        }
    }

    // go around dead clusters counter clock wise
    currDirection = turnRight(currDirection, reverseOrientation);

    // Search for next boundary element
    bool nextIsStart = false;
    bool atBorder = false;

    while (!nextIsStart) {

        bool nextStepFound = false;
        int status = 0;
        noDirs = 0;
        while (!nextStepFound) {
            next = makeStepInDirection(currDirection, theEcalNav);
            theEcalNav->setHome(current);
            theEcalNav->home();
            EcalChannelStatus::const_iterator chit = ecalStatus->find(next);
            status = (chit != ecalStatus->end()) ? chit->getStatusCode() & 0x1F : -1;
            if (status > 0) {
                // New dead cell found: update status vector of dead channels
                bool present = false;
                for (vector<int>::const_iterator s = stati.begin(); s != stati.end(); ++s) {
                    if (*s == status) {
                        present = true;
                        break;
                    }
                }
                if (!present)
                    stati.push_back(status);

                if (atBorder) {
                    nextStepFound = true;
                } else {
                    currDirection = turnRight(currDirection, reverseOrientation);
                }
            } else if (next == EcalDetId(0)) {
                // In case the Ecal border is reached -> go along dead cells
                currDirection = turnLeft(currDirection, reverseOrientation);
                atBorder = true;
            } else if (status == 0) {
                nextStepFound = true;
            }
            ++noDirs;
            if (noDirs > 4) {
                cout << "No valid next direction can be found: This should never happen!" << endl;
                throw "ERROR";
                break;
            }
        }

        // make next step
        next = makeStepInDirection(currDirection, theEcalNav);

        if (next == start) {
            nextIsStart = true;
            if (debug)
                cout << "Boundary path reached starting position!" << endl;
        }

        if (debug)
            cout << "Next step: " << (EcalDetId) next << " Status: " << status << " Start: " << (EcalDetId) start << endl;

        // save recHits and add energy if on the boundary (and not inside at border)
        if ((!atBorder || status == 0) && !nextIsStart) {
            boundaryDetIds.push_back(next);
            if (RecHits->find(next) != RecHits->end() && status == 0) {
                EcalRecHit nexthit = *RecHits->find(next);
                ++beCellCounter;
                boundaryRecHits.push_back(nexthit);
                boundaryEnergy += nexthit.energy();
                cellGeom = subGeom->getGeometry(hitdetid);
                eta = cellGeom->getPosition().eta();
                boundaryET += nexthit.energy() / cosh(eta);
            }
        }

        if (current_status == 0 && status == 0 && atBorder) {
            // this is for a special case, where dead cells are at border corner
            currDirection = turnRight(currDirection, reverseOrientation);
        } else {
            // if dead region along a border is left, turn left
            if (status == 0 && atBorder) {
                atBorder = false;
                currDirection = turnLeft(currDirection, reverseOrientation);
            }
            if (status == 0) {
                // if outside the cluster turn left to follow boundary
                currDirection = turnLeft(currDirection, reverseOrientation);
            } else {
                // else turn right to check if dead region can be left
                currDirection = turnRight(currDirection, reverseOrientation);
            }
        }

        // save currect position
        current = next;
        current_status = status;

    }

    if (debug) {
        cout << "<<<<<<<<<<<<<<< Final Boundary object <<<<<<<<<<<<<<<" << endl;
        cout << "no of neighbouring RecHits: " << boundaryRecHits.size() << endl;
        cout << "no of neighbouring DetIds: " << boundaryDetIds.size() << endl;
        cout << "boundary energy: " << boundaryEnergy << endl;
        cout << "boundary ET: " << boundaryET << endl;
        cout << "no of cells contributing to boundary energy: " << beCellCounter << endl;
        cout << "Channel stati: ";
        for (vector<int>::iterator it = stati.begin(); it != stati.end(); ++it) {
            cout << *it << " ";
        }
        cout << endl;
    }

    BoundaryInformation boundInfo;
    boundInfo.subdet = hitdetid.subdet();
    boundInfo.detIds = boundaryDetIds;
    boundInfo.recHits = boundaryRecHits;
    boundInfo.boundaryEnergy = boundaryEnergy;
    boundInfo.boundaryET = boundaryET;
    boundInfo.nextToBorder = nextToBorder;
    boundInfo.channelStatus = stati;

    if (theEcalNav != 0) {
        delete theEcalNav;
        theEcalNav = 0;
    }
    return boundInfo;
}
template<class EcalDetId>
bool EcalBoundaryInfoCalculator< EcalDetId >::checkRecHitHasDeadNeighbour ( const EcalRecHit  hit,
const edm::ESHandle< EcalChannelStatus ecalStatus,
vector< int > &  stati 
) [inline]

Definition at line 41 of file EcalBoundaryInfoCalculator.h.

Referenced by EcalDeadCellBoundaryEnergyFilter::filter().

                                                  {

        stati.clear();
        EcalDetId hitdetid = EcalDetId(hit.id());

        if (hitdetid.subdet() == EcalBarrel) {

            EBDetId ebhitdetid = (EBDetId) hitdetid;

            int hitIeta = ebhitdetid.ieta();
            int hitIphi = ebhitdetid.iphi();

            for (int ieta = -1; ieta <= 1; ieta++) {
                for (int iphi = -1; iphi <= 1; iphi++) {
                    if ((iphi == 0 && ieta == 0) || iphi * ieta != 0)
                        //if (iphi == 0 && ieta == 0)
                        continue;
                    int neighbourIeta = hitIeta + ieta;
                    int neighbourIphi = hitIphi + iphi;
                    if (!EBDetId::validDetId(neighbourIeta, neighbourIphi)) {
                        if (neighbourIphi < 1)
                            neighbourIphi += 360;
                        if (neighbourIphi > 360)
                            neighbourIphi -= 360;
                        if (neighbourIeta == 0) {
                            neighbourIeta += ieta;
                        }
                    }

                    if (EBDetId::validDetId(neighbourIeta, neighbourIphi)) {

                        const EBDetId detid = EBDetId(neighbourIeta, neighbourIphi, EBDetId::ETAPHIMODE);
                        EcalChannelStatus::const_iterator chit = ecalStatus->find(detid);
                        int status = (chit != ecalStatus->end()) ? chit->getStatusCode() & 0x1F : -1;

                        if (status > 0) {
                            bool present = false;
                            for (vector<int>::const_iterator s = stati.begin(); s != stati.end(); ++s) {
                                if (*s == status) {
                                    present = true;
                                    break;
                                }
                            }
                            if (!present)
                                stati.push_back(status);
                        }
                    }
                }
            }

        } else if (hitdetid.subdet() == EcalEndcap) {

            EEDetId eehitdetid = (EEDetId) hitdetid;
            int hitIx = eehitdetid.ix();
            int hitIy = eehitdetid.iy();
            int hitIz = eehitdetid.zside();

            for (int ix = -1; ix <= 1; ix++) {
                for (int iy = -1; iy <= 1; iy++) {
                    if ((ix == 0 && iy == 0) || ix * iy != 0)
                        //if (ix == 0 && iy == 0)
                        continue;
                    int neighbourIx = hitIx + ix;
                    int neighbourIy = hitIy + iy;

                    if (EEDetId::validDetId(neighbourIx, neighbourIy, hitIz)) {

                        const EEDetId detid = EEDetId(neighbourIx, neighbourIy, hitIz, EEDetId::XYMODE);
                        EcalChannelStatus::const_iterator chit = ecalStatus->find(detid);
                        int status = (chit != ecalStatus->end()) ? chit->getStatusCode() & 0x1F : -1;

                        if (status > 0) {
                            bool present = false;
                            for (vector<int>::const_iterator s = stati.begin(); s != stati.end(); ++s) {
                                if (*s == status) {
                                    present = true;
                                    break;
                                }
                            }
                            if (!present)
                                stati.push_back(status);
                        }
                    }
                }
            }

        } else {
            cout << "ERROR - RecHit belongs to wrong sub detector" << endl;
        }

        if (stati.size() > 0)
            return true;
        return false;

    }
template<class EcalDetId>
bool EcalBoundaryInfoCalculator< EcalDetId >::checkRecHitHasInvalidNeighbour ( const EcalRecHit  hit,
const edm::ESHandle< EcalChannelStatus ecalStatus 
) [inline]

Definition at line 138 of file EcalBoundaryInfoCalculator.h.

Referenced by EcalDeadCellBoundaryEnergyFilter::filter().

                                                                                                               {

        EcalDetId hitdetid = EcalDetId(hit.id());

        if (hitdetid.subdet() == EcalBarrel) {

            EBDetId ebhitdetid = (EBDetId) hitdetid;

            int hitIeta = ebhitdetid.ieta();
            int hitIphi = ebhitdetid.iphi();

            for (int ieta = -1; ieta <= 1; ieta++) {
                for (int iphi = -1; iphi <= 1; iphi++) {
                    if ((iphi == 0 && ieta == 0) || iphi * ieta != 0)
                        //if (iphi == 0 && ieta == 0)
                        continue;
                    int neighbourIeta = hitIeta + ieta;
                    int neighbourIphi = hitIphi + iphi;
                    if (!EBDetId::validDetId(neighbourIeta, neighbourIphi)) {
                        if (neighbourIphi < 1)
                            neighbourIphi += 360;
                        if (neighbourIphi > 360)
                            neighbourIphi -= 360;
                        if (neighbourIeta == 0) {
                            neighbourIeta += ieta;
                        }
                    }

                    if (!EBDetId::validDetId(neighbourIeta, neighbourIphi)) {
                        return true;
                    }
                }
            }

        } else if (hitdetid.subdet() == EcalEndcap) {

            EEDetId eehitdetid = (EEDetId) hitdetid;
            int hitIx = eehitdetid.ix();
            int hitIy = eehitdetid.iy();
            int hitIz = eehitdetid.zside();

            for (int ix = -1; ix <= 1; ix++) {
                for (int iy = -1; iy <= 1; iy++) {
                    if ((ix == 0 && iy == 0) || ix * iy != 0)
                        //if (ix == 0 && iy == 0)
                        continue;
                    int neighbourIx = hitIx + ix;
                    int neighbourIy = hitIy + iy;

                    if (!EEDetId::validDetId(neighbourIx, neighbourIy, hitIz)) {
                        return true;
                    }
                }
            }

        } else {
            cout << "ERROR - RecHit belongs to wrong sub detector" << endl;
        }

        return false;
    }
template<class EcalDetId >
BoundaryInformation EcalBoundaryInfoCalculator< EcalDetId >::gapRecHits ( const edm::Handle< EcalRecHitCollection > &  RecHits,
const EcalRecHit hit,
const edm::ESHandle< CaloTopology theCaloTopology,
const edm::ESHandle< EcalChannelStatus ecalStatus,
const edm::ESHandle< CaloGeometry geometry 
)

Definition at line 537 of file EcalBoundaryInfoCalculator.h.

References BoundaryInformation::boundaryEnergy, BoundaryInformation::boundaryET, BoundaryInformation::channelStatus, gather_cfg::cout, cond::rpcobimon::current, debug, BoundaryInformation::detIds, EcalBarrel, EcalEndcap, CaloRecHit::energy(), eta(), PV3DBase< T, PVType, FrameType >::eta(), CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), EcalRecHit::id(), BoundaryInformation::nextToBorder, north, BoundaryInformation::recHits, errorMatrix2Lands_multiChannel::start, ntuplemaker::status, and BoundaryInformation::subdet.

Referenced by EcalDeadCellBoundaryEnergyFilter::filter().

                                                                                       {

    //initialize boundary information
    std::vector<EcalRecHit> gapRecHits;
    std::vector<DetId> gapDetIds;

    double gapEnergy = 0;
    double gapET = 0;
    int gapCellCounter = 0;
    bool nextToBorder = false;

    gapRecHits.push_back(*hit);
    ++gapCellCounter;
    gapEnergy += hit->energy();
    EcalDetId hitdetid = (EcalDetId) hit->id();
    gapDetIds.push_back(hitdetid);
    const CaloSubdetectorGeometry* subGeom = geometry->getSubdetectorGeometry(hitdetid);
    const CaloCellGeometry* cellGeom = subGeom->getGeometry(hitdetid);
    double eta = cellGeom->getPosition().eta();
    gapET += hit->energy() / cosh(eta);

    if (debug) {
        std::cout << "Find Border RecHits..." << std::endl;

        if (hitdetid.subdet() == EcalBarrel) {
            std::cout << "Starting at : (" << ((EBDetId) hitdetid).ieta() << "," << ((EBDetId) hitdetid).iphi() << ")"
            << std::endl;

        } else if (hitdetid.subdet() == EcalEndcap) {
            std::cout << "Starting at : (" << ((EEDetId) hitdetid).ix() << "," << ((EEDetId) hitdetid).iy() << ")"
            << std::endl;
        }
    }

    //initialize navigator
    initializeEcalNavigator(hitdetid, theCaloTopology, EcalDetId::subdet());
    CdOrientation currDirection = north;
    bool reverseOrientation = false;

    EcalDetId next(0);
    EcalDetId start = hitdetid;
    EcalDetId current = start;

    // Search until a invalid cell is ahead
    bool startAlgo = false;
    int noDirs = 0;
    while (!startAlgo) {
        next = makeStepInDirection(currDirection, theEcalNav);
        theEcalNav->setHome(start);
        theEcalNav->home();
        if (next == EcalDetId(0)) {
            startAlgo = true;
            nextToBorder = true;
            break;
        }
        currDirection = turnLeft(currDirection, reverseOrientation);
        ++noDirs;
        if (noDirs > 4) {

            cout << "No starting direction can be found: This should never happen if RecHit is at border!" << endl;
            throw "ERROR";
            break;
        }
    }

    CdOrientation startDirection = currDirection;
    currDirection = turnLeft(currDirection, reverseOrientation);

    // Search for next border element
    bool endIsFound = false;
    bool startIsEnd = false;

    while (!endIsFound) {

        bool nextStepFound = false;
        int status = 0;
        noDirs = 0;
        while (!nextStepFound) {
            next = makeStepInDirection(currDirection, theEcalNav);
            theEcalNav->setHome(current);
            theEcalNav->home();
            EcalChannelStatus::const_iterator chit = ecalStatus->find(next);
            status = (chit != ecalStatus->end()) ? chit->getStatusCode() & 0x1F : -1;
            if (status > 0) {
                // Find dead cell along border -> end of cluster
                endIsFound = true;
                break;
            } else if (next == EcalDetId(0)) {
                // In case the Ecal border -> go along gap
                currDirection = turnLeft(currDirection, reverseOrientation);
            } else if (status == 0) {
                if (RecHits->find(next) != RecHits->end()) {
                    nextStepFound = true;
                } else {
                    endIsFound = true;
                    break;
                }
            }
            ++noDirs;
            if (noDirs > 4) {
                cout << "No valid next direction can be found: This should never happen!" << endl;
                throw "ERROR";
                break;
            }
        }

        // make next step
        next = makeStepInDirection(currDirection, theEcalNav);
        current = next;

        if (next == start) {
            startIsEnd = true;
            endIsFound = true;
            if (debug)
                cout << "Path along gap reached starting position!" << endl;
        }

        if (debug) {
            cout << "Next step: " << (EcalDetId) next << " Status: " << status << " Start: " << (EcalDetId) start << endl;
            if (endIsFound)
                cout << "End of gap cluster is found going left" << endl;
        }

        // save recHits and add energy
        if (!endIsFound) {
            gapDetIds.push_back(next);
            if (RecHits->find(next) != RecHits->end()) {
                EcalRecHit nexthit = *RecHits->find(next);
                ++gapCellCounter;
                gapRecHits.push_back(nexthit);
                gapEnergy += nexthit.energy();
                cellGeom = subGeom->getGeometry(next);
                eta = cellGeom->getPosition().eta();
                gapET += nexthit.energy() / cosh(eta);
            }
        }

        // turn right to follow gap
        currDirection = turnRight(currDirection, reverseOrientation);

    }

    theEcalNav->setHome(start);
    theEcalNav->home();
    current = start;
    currDirection = startDirection;
    currDirection = turnRight(currDirection, reverseOrientation);

    // Search for next border element
    endIsFound = false;

    if (!startIsEnd) {

        while (!endIsFound) {

            bool nextStepFound = false;
            int status = 0;
            noDirs = 0;
            while (!nextStepFound) {
                next = makeStepInDirection(currDirection, theEcalNav);
                theEcalNav->setHome(current);
                theEcalNav->home();
                EcalChannelStatus::const_iterator chit = ecalStatus->find(next);
                status = (chit != ecalStatus->end()) ? chit->getStatusCode() & 0x1F : -1;
                if (status > 0) {
                    // Find dead cell along border -> end of cluster
                    endIsFound = true;
                    break;
                } else if (next == EcalDetId(0)) {
                    // In case the Ecal border -> go along gap
                    currDirection = turnRight(currDirection, reverseOrientation);
                } else if (status == 0) {
                    if (RecHits->find(next) != RecHits->end()) {
                        nextStepFound = true;
                    } else {
                        endIsFound = true;
                        break;
                    }
                }
                ++noDirs;
                if (noDirs > 4) {
                    cout << "No valid next direction can be found: This should never happen!" << endl;
                    throw "ERROR";
                    break;
                }
            }

            // make next step
            next = makeStepInDirection(currDirection, theEcalNav);
            current = next;

            if (debug) {
                cout << "Next step: " << (EcalDetId) next << " Status: " << status << " Start: " << (EcalDetId) start
                << endl;
                if (endIsFound)
                    cout << "End of gap cluster is found going right" << endl;
            }

            // save recHits and add energy
            if (!endIsFound) {
                gapDetIds.push_back(next);
                if (RecHits->find(next) != RecHits->end()) {
                    EcalRecHit nexthit = *RecHits->find(next);
                    ++gapCellCounter;
                    gapRecHits.push_back(nexthit);
                    gapEnergy += nexthit.energy();
                    cellGeom = subGeom->getGeometry(next);
                    eta = cellGeom->getPosition().eta();
                    gapET += nexthit.energy() / cosh(eta);
                }
            }

            // turn left to follow gap
            currDirection = turnLeft(currDirection, reverseOrientation);

        }
    }

    if (debug) {
        cout << "<<<<<<<<<<<<<<< Final Gap object <<<<<<<<<<<<<<<" << endl;
        cout << "No of RecHits along gap: " << gapRecHits.size() << endl;
        cout << "No of DetIds along gap: " << gapDetIds.size() << endl;
        cout << "Gap energy: " << gapEnergy << endl;
        cout << "Gap ET: " << gapET << endl;
    }

    BoundaryInformation gapInfo;
    gapInfo.subdet = hitdetid.subdet();
    gapInfo.detIds = gapDetIds;
    gapInfo.recHits = gapRecHits;
    gapInfo.boundaryEnergy = gapEnergy;
    gapInfo.boundaryET = gapET;
    gapInfo.nextToBorder = nextToBorder;
    vector<int> stati;
    gapInfo.channelStatus = stati;

    if (theEcalNav != 0) {
        delete theEcalNav;
        theEcalNav = 0;
    }
    return gapInfo;
}
template<class EcalDetId>
CdOrientation EcalBoundaryInfoCalculator< EcalDetId >::goBackOneCell ( CdOrientation  currDirection,
EcalDetId  prev 
) [inline, private]

Definition at line 237 of file EcalBoundaryInfoCalculator.h.

                                                                             {
        map<CdOrientation, CdOrientation>::iterator oIt = oppositeDirs.find(currDirection);
        CdOrientation oppDirection=none;
        if (oIt != oppositeDirs.end()) {
            oppDirection = oIt->second;
            theEcalNav->setHome(prev);
        }
        EcalDetId currDetId = theEcalNav->pos();

        return oppDirection;
    }
template<class EcalDetId>
void EcalBoundaryInfoCalculator< EcalDetId >::initializeEcalNavigator ( DetId  startE,
const edm::ESHandle< CaloTopology theCaloTopology,
EcalSubdetector  ecalSubDet 
) [inline, private]

Definition at line 277 of file EcalBoundaryInfoCalculator.h.

                                                             {
        if (ecalSubDet == EcalBarrel) {
            if (theEcalNav != 0) {
                delete theEcalNav;
                theEcalNav = 0;
            }
            theEcalNav = new CaloNavigator<EcalDetId> ((EBDetId) startE, (theCaloTopology->getSubdetectorTopology(
                             DetId::Ecal, ecalSubDet)));
        } else if (ecalSubDet == EcalEndcap) {
            if (theEcalNav != 0) {
                delete theEcalNav;
                theEcalNav = 0;
            }
            theEcalNav = new CaloNavigator<EcalDetId> ((EEDetId) startE, (theCaloTopology->getSubdetectorTopology(
                             DetId::Ecal, ecalSubDet)));
        } else {
            cout << "initializeEcalNavigator not implemented for subDet: " << ecalSubDet << endl;
        }

    }
template<class EcalDetId>
EcalDetId EcalBoundaryInfoCalculator< EcalDetId >::makeStepInDirection ( CdOrientation  direction,
CaloNavigator< EcalDetId > *  theNavi 
) [inline, private]

Definition at line 208 of file EcalBoundaryInfoCalculator.h.

                                                                                               {
        EcalDetId next;
        switch (direction) {
        case north: {
                //cout<<"go north"<<endl;
                next = theNavi->north();
                break;
            }
        case east: {
                //cout<<"go east"<<endl;
                next = theNavi->east();
                break;
            }
        case south: {
                //cout<<"go south"<<endl;
                next = theNavi->south();
                break;
            }
        case west: {
                //cout<<"go west"<<endl;
                next = theNavi->west();
                break;
            }
        default:
                break;
        }
        return next;
    }
template<class EcalDetId>
void EcalBoundaryInfoCalculator< EcalDetId >::setDebugMode ( ) [inline]

Definition at line 201 of file EcalBoundaryInfoCalculator.h.

Referenced by EcalDeadCellBoundaryEnergyFilter::filter().

                        {
        cout << "set Debug Mode!" << endl;
        debug = true;
    }
template<class EcalDetId>
CdOrientation EcalBoundaryInfoCalculator< EcalDetId >::turnLeft ( CdOrientation  currDirection,
bool  reverseOrientation 
) [inline, private]

Definition at line 263 of file EcalBoundaryInfoCalculator.h.

                                                                                 {
        //read nextDirection
        map<CdOrientation, CdOrientation> turnMap = prevDirs;
        if (reverseOrientation)
            turnMap = nextDirs;
        map<CdOrientation, CdOrientation>::iterator nIt = turnMap.find(currDirection);
        CdOrientation nextDirection=none;
        if (nIt != turnMap.end())
            nextDirection = (*nIt).second;
        else
            cout << "ERROR - no Next Direction found!?!?" << endl;
        return nextDirection;
    }
template<class EcalDetId>
CdOrientation EcalBoundaryInfoCalculator< EcalDetId >::turnRight ( CdOrientation  currDirection,
bool  reverseOrientation 
) [inline, private]

Definition at line 249 of file EcalBoundaryInfoCalculator.h.

                                                                                  {
        //read nextDirection
        map<CdOrientation, CdOrientation> turnMap = nextDirs;
        if (reverseOrientation)
            turnMap = prevDirs;
        map<CdOrientation, CdOrientation>::iterator nIt = turnMap.find(currDirection);
        CdOrientation nextDirection=none;
        if (nIt != turnMap.end())
            nextDirection = (*nIt).second;
        else
            cout << "ERROR - no Next Direction found!?!?" << endl;
        return nextDirection;
    }

Member Data Documentation

template<class EcalDetId>
bool EcalBoundaryInfoCalculator< EcalDetId >::debug [private]

Definition at line 303 of file EcalBoundaryInfoCalculator.h.

template<class EcalDetId>
map<CdOrientation, CdOrientation> EcalBoundaryInfoCalculator< EcalDetId >::nextDirs [private]

Definition at line 299 of file EcalBoundaryInfoCalculator.h.

template<class EcalDetId>
map<CdOrientation, CdOrientation> EcalBoundaryInfoCalculator< EcalDetId >::oppositeDirs [private]

Definition at line 301 of file EcalBoundaryInfoCalculator.h.

template<class EcalDetId>
map<CdOrientation, CdOrientation> EcalBoundaryInfoCalculator< EcalDetId >::prevDirs [private]

Definition at line 300 of file EcalBoundaryInfoCalculator.h.

template<class EcalDetId>
CaloNavigator<EcalDetId>* EcalBoundaryInfoCalculator< EcalDetId >::theEcalNav [private]

Definition at line 302 of file EcalBoundaryInfoCalculator.h.