Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:08

0001 // -*- C++ -*-
0002 // AID-GENERATED
0003 // =========================================================================
0004 // This class was generated by AID - Abstract Interface Definition          
0005 // DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it. 
0006 // =========================================================================
0007 #ifndef AIDA_IFITDATA_H
0008 #define AIDA_IFITDATA_H 1
0009 
0010 //  This file is part of the AIDA library
0011 //  Copyright (C) 2002 by the AIDA team.  All rights reserved.
0012 //  This library is free software and under the terms of the
0013 //  GNU Library General Public License described in the LGPL.txt 
0014 
0015 #include <string>
0016 #include <vector>
0017 
0018 namespace AIDA {
0019 
0020 class ICloud1D;
0021 class ICloud2D;
0022 class ICloud3D;
0023 class IDataPointSet;
0024 class IEvaluator;
0025 class IHistogram1D;
0026 class IHistogram2D;
0027 class IHistogram3D;
0028 class IProfile1D;
0029 class IProfile2D;
0030 class IRangeSet;
0031 class ITuple;
0032 
0033 /** @interface
0034  *
0035  * Abstract representation of the fit data. Serves for several purposes:
0036  *  - decouple fitter from the details of the particular data 
0037  *    objects (Histograms etc)
0038  *  - provide range restriction capability ("cut of the tails...")
0039  *  - creates the image of the virtual data source
0040  *
0041  * Design notes:
0042  *
0043  * 1)
0044  * we try to be explicit in the method names which should indicate the
0045  * dimensionality of the fit data.
0046  *
0047  * this way we have more compile-time/run-time safety and clearer code.
0048  * in C++ we can handle default arguments which otherwise would be ambigeous.
0049  *
0050  * 2) 
0051  * string names of the arguments are at the end of the methods'
0052  * signatures and have default (empty) values.
0053  * so if function argument name is missing,
0054  * assume the ordering is taken from the histogram axis it connects to
0055  * the name of the pipes then are generated automatically using 
0056  * the same default scheme as for functions x[1], x[2] etc.
0057  *
0058  * 3)
0059  * There are two ends to pipes: one connected to the
0060  * data source and one pouring data out. Both their orders has to be specified.
0061  *
0062  * For IHistogram, ICloud, IProfile the connections to the data source are
0063  * ordered as the axis (x=0, y=1, z=2); the user has to provide the order
0064  * with which the pipes are providing the data. So for example in the constructor
0065  *   create2DConnection(hist2D,xIndex,yIndex);
0066  * xIndex specifies the exit order of the pipe connected to the x Axis (and similarly
0067  * for yIndex). So the default method
0068  *   create2DConnection(hist2D);
0069  * corresponds to
0070  *   create2DConnection(hist2D,0,1);
0071  * In the methods for IHistograms, IClouds, and IProfiles one index could have
0072  * been dropped as the second could be inferred by the dimensionality. We
0073  * preferred being redundant just to avoid confusion in interpreting what
0074  *   create2DConnection(hist2D,1);
0075  * really means.
0076  *
0077  * For ITuple and IDataPointSet the order in the connection to the data source
0078  * is specified by the user by providing, respectively, the array of column names (or evaluators)
0079  * and the array of coordinate indexes to which to connect the pipes.
0080  * In this case we assume that the pipes are parallel, i.e. the exit order is the same
0081  * as the one of the connection to the data source.
0082  * In the createXDConnection methods to IDataPointSets we preferred not to provide
0083  * defaults for the valIndex to avoid confusion in interpreting it.
0084  * We can always add it later.
0085  *
0086  * PENDING: clarify the relation between data range and normalization range
0087  *
0088  * @author The AIDA Team.
0089  *
0090  */
0091 
0092 class IFitData {
0093 
0094 public: 
0095     /// Destructor.
0096     virtual ~IFitData() { /* nop */; }
0097 
0098     /**
0099      * One dimensional connections.
0100      *
0101      */
0102 
0103     /**
0104      * Create a one dimensional connection to an IHistogram1D.
0105      * @param h       The 1D histogram to which to connect to.
0106      * @return false If something is wrong.
0107      *
0108      */
0109     virtual bool create1DConnection(const IHistogram1D & h) = 0;
0110 
0111     /**
0112      * Create a one dimensional connection to an ICloud1D.
0113      * @param c       The 1D cloud to which to connect to.
0114      * @return false If something is wrong.
0115      *
0116      */
0117     virtual bool create1DConnection(const ICloud1D & c) = 0;
0118 
0119     /**
0120      * Create a one dimensional connection to an IProfile1D.
0121      * @param p       The 1D profile to which to connect to.
0122      * @return false If something is wrong.
0123      *
0124      */
0125     virtual bool create1DConnection(const IProfile1D & p) = 0;
0126 
0127     /**
0128      * Create a one dimensional connection to an IDataPointSet.
0129      * @param dp       The dataPointSet to which to connect to.
0130      * @param xIndex   The index of the coordinate to which the variable is connected.
0131      * @param valIndex The index of the coordinate used as "height".
0132      * @return false If something is wrong.
0133      *
0134      */
0135     virtual bool create1DConnection(const IDataPointSet & dp, int xIndex, int valIndex) = 0;
0136 
0137     /**
0138      * Two dimensional connections.
0139      *
0140      */
0141 
0142     /**
0143      * Create a two dimensional connection to an IHistogram2D.
0144      * @param h        The 2D histogram to which to connect to.
0145      * @return false If something is wrong.
0146      *
0147      */
0148     virtual bool create2DConnection(const IHistogram2D & h) = 0;
0149 
0150     /**
0151      * Create a two dimensional connection to an IHistogram2D.
0152      * @param h        The 2D histogram to which to connect to.
0153      * @param xIndex   The index of the axis to which the x variable is connected.
0154      * @param yIndex   The index of the axis to which the y variable is connected.
0155      * @return false If something is wrong.
0156      *
0157      */
0158     virtual bool create2DConnection(const IHistogram2D & h, int xIndex, int yIndex) = 0;
0159 
0160     /**
0161      * Create a two dimensional connection to an ICloud2D.
0162      * @param c        The 2D cloud to which to connect to.
0163      * @return false If something is wrong.
0164      *
0165      */
0166     virtual bool create2DConnection(const ICloud2D & c) = 0;
0167 
0168     /**
0169      * Create a two dimensional connection to an ICloud2D.
0170      * @param c        The 2D cloud to which to connect to.
0171      * @param xIndex   The index of the axis to which the x variable is connected.
0172      * @param yIndex   The index of the axis to which the y variable is connected.
0173      * @return false If something is wrong.
0174      *
0175      */
0176     virtual bool create2DConnection(const ICloud2D & c, int xIndex, int yIndex) = 0;
0177 
0178     /**
0179      * Create a two dimensional connection to an IProfile2D.
0180      * @param p       The 2D profile to which to connect to.
0181      * @return false If something is wrong.
0182      *
0183      */
0184     virtual bool create2DConnection(const IProfile2D & p) = 0;
0185 
0186     /**
0187      * Create a two dimensional connection to an IProfile2D.
0188      * @param p        The 2D profile to which to connect to.
0189      * @param xIndex   The index of the axis to which the x variable is connected.
0190      * @param yIndex   The index of the axis to which the y variable is connected.
0191      * @return false If something is wrong.
0192      *
0193      */
0194     virtual bool create2DConnection(const IProfile2D & p, int xIndex, int yIndex) = 0;
0195 
0196     /**
0197      * Create a two dimensional connection to an IDataPointSet.
0198      * @param dp       The dataPointSet to which to connect to.
0199      * @param xIndex   The index of the coordinate to which the x variable is connected.
0200      * @param yIndex   The index of the coordinate to which the y variable is connected.
0201      * @param valIndex The index of the coordinate used as "height".
0202      * @return false If something is wrong.
0203      *
0204      */
0205     virtual bool create2DConnection(const IDataPointSet & dp, int xIndex, int yIndex, int valIndex) = 0;
0206 
0207     /**
0208      * Three dimensional connections.
0209      *
0210      */
0211 
0212     /**
0213      * Create a three dimensional connection to an IHistogram3D.
0214      * @param h        The 3D histogram to which to connect to.
0215      * @return false If something is wrong.
0216      *
0217      */
0218     virtual bool create3DConnection(const IHistogram3D & h) = 0;
0219 
0220     /**
0221      * Create a three dimensional connection to an IHistogram3D.
0222      * @param h        The 3D histogram to which to connect to.
0223      * @param xIndex   The index of the axis to which the x variable is connected.
0224      * @param yIndex   The index of the axis to which the y variable is connected.
0225      * @param zIndex   The index of the axis to which the z variable is connected.
0226      * @return false If something is wrong.
0227      *
0228      */
0229     virtual bool create3DConnection(const IHistogram3D & h, int xIndex, int yIndex, int zIndex) = 0;
0230 
0231     /**
0232      * Create a three dimensional connection to an ICloud3D.
0233      * @param c        The 3D cloud to which to connect to.
0234      * @return false If something is wrong.
0235      *
0236      */
0237     virtual bool create3DConnection(const ICloud3D & c) = 0;
0238 
0239     /**
0240      * Create a three dimensional connection to an ICloud3D.
0241      * @param c        The 3D cloud to which to connect to.
0242      * @param xIndex   The index of the axis to which the x variable is connected.
0243      * @param yIndex   The index of the axis to which the y variable is connected.
0244      * @param zIndex   The index of the axis to which the z variable is connected.
0245      * @return false If something is wrong.
0246      *
0247      */
0248     virtual bool create3DConnection(const ICloud3D & c, int xIndex, int yIndex, int zIndex) = 0;
0249 
0250     /**
0251      * Create a three dimensional connection to an IDataPointSet.
0252      * @param dp       The dataPointSet to which to connect to.
0253      * @param xIndex   The index of the coordinate to which the x variable is connected.
0254      * @param yIndex   The index of the coordinate to which the y variable is connected.
0255      * @param zIndex   The index of the coordinate to which the z variable is connected.
0256      * @param valIndex The index of the coordinate used as "height".
0257      * @return false If something is wrong.
0258      *
0259      */
0260     virtual bool create3DConnection(const IDataPointSet & dp, int xIndex, int yIndex, int zIndex, int valIndex) = 0;
0261 
0262     /**
0263      * General connections.
0264      *
0265      */
0266 
0267     /**
0268      * Tuples are for UNBINNED fits, so no value column required.
0269      */
0270 
0271     /** 
0272      * Create a connection to an ITuple.
0273      * @param t        The ITuple.
0274      * @param colNames The names of the columns to which to connect.
0275      * @return false If something is wrong.
0276      *
0277      */
0278     virtual bool createConnection(const ITuple & t, std::vector<std::string>  colNames) = 0;
0279 
0280     /** 
0281      * Create a connection to an ITuple.
0282      * @param t     The ITuple.
0283      * @param evals The list of the IEvaluator used to calculate the variable's value.
0284      * @return false If something is wrong.
0285      *
0286      */
0287     virtual bool createConnection(const ITuple & t, std::vector<IEvaluator *>  & evals) = 0;
0288 
0289     /**
0290      * Create a connection to an IDataPointSet.
0291      * @param dp       The dataPointSet to which to connect to.
0292      * @param indeces  The indeces of the coordinates to which the variables are connected.
0293      * @param valIndex The index of the coordinate used as "height".
0294      * @return false If something is wrong.
0295      *
0296      */
0297     virtual bool createConnection(const IDataPointSet & dp, std::vector<int>  indeces, int valIndex) = 0;
0298 
0299     /**
0300      * Remove all Ranges and connections; after this is like newly create.
0301      *
0302      */
0303     virtual void reset() = 0;
0304 
0305     /**
0306      * The dimension of this IFitData, i.e. the number of connections.
0307      * @return The dimension of the IFitData.
0308      *
0309      */
0310     virtual int dimension() const = 0;
0311 
0312     /// Return a string describing the data. This should be considered as a
0313     /// hint to the user where to find the original data objects and how
0314     /// to connect the data pipes. PENDING: probably this can be part of
0315     /// XML streaming.
0316     virtual std::string dataDescription() const = 0;
0317 
0318     /**
0319      * Get Range of the corresponding connection by index. 
0320      * The index represent the order in which
0321      * connections are coming out of the IFitData.
0322      * @param  The index of the connection.
0323      * @return      The Range
0324      *
0325      */
0326     virtual IRangeSet & range(int index) const = 0;
0327 
0328     /** @link aggregation */
0329 }; // class
0330 } // namespace AIDA
0331 #endif /* ifndef AIDA_IFITDATA_H */