diff --git a/TIMBER/Framework/README.md b/TIMBER/Framework/README.md index 6adf656..1d6c7aa 100644 --- a/TIMBER/Framework/README.md +++ b/TIMBER/Framework/README.md @@ -3,7 +3,7 @@ ## Notes to developers Adding C++ modules for use in TIMBER is relatively simple but the code makes several -assumptions about the structure of the module if you'd like to use it as a @ref TIMBER.Analyzer.Correction. +assumptions about the structure of the module if you'd like to use it as a `TIMBER.Analyzer.Correction`. A correction module should be built as a class so that the initializer can be used to book objects like files, histograms, etc that we want to load before looping over the RDataFrame. diff --git a/TIMBER/Framework/include/common.h b/TIMBER/Framework/include/common.h index 3abe94f..8974f6a 100644 --- a/TIMBER/Framework/include/common.h +++ b/TIMBER/Framework/include/common.h @@ -52,7 +52,6 @@ namespace hardware { * * @param v1 * @param v2 - * @param inTIMBER If file is in TIMBERPATH. Defaults to true. * @return RVec */ RVec HadamardProduct(RVec v1, RVec v2); diff --git a/docs/_b_tag_calibration_standalone_8h_source.html b/docs/_b_tag_calibration_standalone_8h_source.html index a85db8c..5bc473e 100644 --- a/docs/_b_tag_calibration_standalone_8h_source.html +++ b/docs/_b_tag_calibration_standalone_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/ext/BTagCalibrationStandalone.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@ - + +/* @license-end */
BTagCalibrationStandalone.h
-
1 #ifndef BTagEntry_H
2 #define BTagEntry_H
3 
18 #include <string>
19 #include <TF1.h>
20 #include <TH1.h>
21 
22 
23 class BTagEntry
24 {
25 public:
26  enum OperatingPoint {
27  OP_LOOSE=0,
28  OP_MEDIUM=1,
29  OP_TIGHT=2,
30  OP_RESHAPING=3,
31  };
32  enum JetFlavor {
33  FLAV_B=0,
34  FLAV_C=1,
35  FLAV_UDSG=2,
36  };
37  struct Parameters {
38  OperatingPoint operatingPoint;
39  std::string measurementType;
40  std::string sysType;
41  JetFlavor jetFlavor;
42  float etaMin;
43  float etaMax;
44  float ptMin;
45  float ptMax;
46  float discrMin;
47  float discrMax;
48 
49  // default constructor
50  Parameters(
51  OperatingPoint op=OP_TIGHT,
52  std::string measurement_type="comb",
53  std::string sys_type="central",
54  JetFlavor jf=FLAV_B,
55  float eta_min=-99999.,
56  float eta_max=99999.,
57  float pt_min=0.,
58  float pt_max=99999.,
59  float discr_min=0.,
60  float discr_max=99999.
61  );
62 
63  };
64 
65  BTagEntry() {}
66  BTagEntry(const std::string &csvLine);
67  BTagEntry(const std::string &func, Parameters p);
68  BTagEntry(const TF1* func, Parameters p);
69  BTagEntry(const TH1* histo, Parameters p);
70  ~BTagEntry() {}
71  static std::string makeCSVHeader();
72  std::string makeCSVLine() const;
73  static std::string trimStr(std::string str);
74 
75  // public, no getters needed
76  std::string formula;
77  Parameters params;
78 
79 };
80 
81 #endif // BTagEntry_H
82 
83 
84 #ifndef BTagCalibration_H
85 #define BTagCalibration_H
86 
101 #include <map>
102 #include <vector>
103 #include <string>
104 #include <istream>
105 #include <ostream>
106 
107 
109 {
110 public:
111  BTagCalibration() {}
112  BTagCalibration(const std::string &tagger);
113  BTagCalibration(const std::string &tagger, const std::string &filename);
114  ~BTagCalibration() {}
115 
116  std::string tagger() const {return tagger_;}
117 
118  void addEntry(const BTagEntry &entry);
119  const std::vector<BTagEntry>& getEntries(const BTagEntry::Parameters &par) const;
120 
121  void readCSV(std::istream &s);
122  void readCSV(const std::string &s);
123  void makeCSV(std::ostream &s) const;
124  std::string makeCSV() const;
125 
126 protected:
127  static std::string token(const BTagEntry::Parameters &par);
128 
129  std::string tagger_;
130  std::map<std::string, std::vector<BTagEntry> > data_;
131 
132 };
133 
134 #endif // BTagCalibration_H
135 
136 
137 #ifndef BTagCalibrationReader_H
138 #define BTagCalibrationReader_H
139 
148 #include <memory>
149 #include <string>
150 
151 
152 
154 {
155 public:
157 
159  BTagCalibrationReader(BTagEntry::OperatingPoint op,
160  const std::string & sysType="central",
161  const std::vector<std::string> & otherSysTypes={});
162 
163  void load(const BTagCalibration & c,
164  BTagEntry::JetFlavor jf,
165  const std::string & measurementType="comb");
166 
167  double eval(BTagEntry::JetFlavor jf,
168  float eta,
169  float pt,
170  float discr=0.) const;
171 
172  double eval_auto_bounds(const std::string & sys,
173  BTagEntry::JetFlavor jf,
174  float eta,
175  float pt,
176  float discr=0.) const;
177 
178  std::pair<float, float> min_max_pt(BTagEntry::JetFlavor jf,
179  float eta,
180  float discr=0.) const;
181 protected:
182  std::shared_ptr<BTagCalibrationReaderImpl> pimpl;
183 };
184 
185 
186 #endif // BTagCalibrationReader_H
187 
188 
Definition: BTagCalibrationStandalone.h:153
-
Definition: BTagCalibrationStandalone.cpp:369
-
Definition: BTagCalibrationStandalone.h:108
-
Definition: BTagCalibrationStandalone.h:23
-
Definition: BTagCalibrationStandalone.h:37
+
1 #ifndef BTagEntry_H
+
2 #define BTagEntry_H
+
3 
+
18 #include <string>
+
19 #include <TF1.h>
+
20 #include <TH1.h>
+
21 
+
22 
+
23 class BTagEntry
+
24 {
+
25 public:
+
26  enum OperatingPoint {
+
27  OP_LOOSE=0,
+
28  OP_MEDIUM=1,
+
29  OP_TIGHT=2,
+
30  OP_RESHAPING=3,
+
31  };
+
32  enum JetFlavor {
+
33  FLAV_B=0,
+
34  FLAV_C=1,
+
35  FLAV_UDSG=2,
+
36  };
+
37  struct Parameters {
+
38  OperatingPoint operatingPoint;
+
39  std::string measurementType;
+
40  std::string sysType;
+
41  JetFlavor jetFlavor;
+
42  float etaMin;
+
43  float etaMax;
+
44  float ptMin;
+
45  float ptMax;
+
46  float discrMin;
+
47  float discrMax;
+
48 
+
49  // default constructor
+
50  Parameters(
+
51  OperatingPoint op=OP_TIGHT,
+
52  std::string measurement_type="comb",
+
53  std::string sys_type="central",
+
54  JetFlavor jf=FLAV_B,
+
55  float eta_min=-99999.,
+
56  float eta_max=99999.,
+
57  float pt_min=0.,
+
58  float pt_max=99999.,
+
59  float discr_min=0.,
+
60  float discr_max=99999.
+
61  );
+
62 
+
63  };
+
64 
+
65  BTagEntry() {}
+
66  BTagEntry(const std::string &csvLine);
+
67  BTagEntry(const std::string &func, Parameters p);
+
68  BTagEntry(const TF1* func, Parameters p);
+
69  BTagEntry(const TH1* histo, Parameters p);
+
70  ~BTagEntry() {}
+
71  static std::string makeCSVHeader();
+
72  std::string makeCSVLine() const;
+
73  static std::string trimStr(std::string str);
+
74 
+
75  // public, no getters needed
+
76  std::string formula;
+
77  Parameters params;
+
78 
+
79 };
+
80 
+
81 #endif // BTagEntry_H
+
82 
+
83 
+
84 #ifndef BTagCalibration_H
+
85 #define BTagCalibration_H
+
86 
+
101 #include <map>
+
102 #include <vector>
+
103 #include <string>
+
104 #include <istream>
+
105 #include <ostream>
+
106 
+
107 
+ +
109 {
+
110 public:
+
111  BTagCalibration() {}
+
112  BTagCalibration(const std::string &tagger);
+
113  BTagCalibration(const std::string &tagger, const std::string &filename);
+
114  ~BTagCalibration() {}
+
115 
+
116  std::string tagger() const {return tagger_;}
+
117 
+
118  void addEntry(const BTagEntry &entry);
+
119  const std::vector<BTagEntry>& getEntries(const BTagEntry::Parameters &par) const;
+
120 
+
121  void readCSV(std::istream &s);
+
122  void readCSV(const std::string &s);
+
123  void makeCSV(std::ostream &s) const;
+
124  std::string makeCSV() const;
+
125 
+
126 protected:
+
127  static std::string token(const BTagEntry::Parameters &par);
+
128 
+
129  std::string tagger_;
+
130  std::map<std::string, std::vector<BTagEntry> > data_;
+
131 
+
132 };
+
133 
+
134 #endif // BTagCalibration_H
+
135 
+
136 
+
137 #ifndef BTagCalibrationReader_H
+
138 #define BTagCalibrationReader_H
+
139 
+
148 #include <memory>
+
149 #include <string>
+
150 
+
151 
+
152 
+ +
154 {
+
155 public:
+ +
157 
+ +
159  BTagCalibrationReader(BTagEntry::OperatingPoint op,
+
160  const std::string & sysType="central",
+
161  const std::vector<std::string> & otherSysTypes={});
+
162 
+
163  void load(const BTagCalibration & c,
+
164  BTagEntry::JetFlavor jf,
+
165  const std::string & measurementType="comb");
+
166 
+
167  double eval(BTagEntry::JetFlavor jf,
+
168  float eta,
+
169  float pt,
+
170  float discr=0.) const;
+
171 
+
172  double eval_auto_bounds(const std::string & sys,
+
173  BTagEntry::JetFlavor jf,
+
174  float eta,
+
175  float pt,
+
176  float discr=0.) const;
+
177 
+
178  std::pair<float, float> min_max_pt(BTagEntry::JetFlavor jf,
+
179  float eta,
+
180  float discr=0.) const;
+
181 protected:
+
182  std::shared_ptr<BTagCalibrationReaderImpl> pimpl;
+
183 };
+
184 
+
185 
+
186 #endif // BTagCalibrationReader_H
+
187 
+
188 
+
Definition: BTagCalibrationStandalone.h:37
+
Definition: BTagCalibrationStandalone.h:153
+
Definition: BTagCalibrationStandalone.cpp:369
+
Definition: BTagCalibrationStandalone.h:108
+
Definition: BTagCalibrationStandalone.h:23
diff --git a/docs/_collection_8h_source.html b/docs/_collection_8h_source.html index 17c2bcf..53fa26e 100644 --- a/docs/_collection_8h_source.html +++ b/docs/_collection_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/Collection.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
Collection.h
-
1 #ifndef _TIMBER_COLLECTION
2 #define _TIMBER_COLLECTION
3 #include <map>
4 #include <string>
5 #include <ROOT/RVec.hxx>
6 
7 using namespace ROOT::VecOps;
8 using namespace std;
9 
16 struct Collection {
17  map<string,int*> Int;
18  map<string,bool*> Bool;
19  map<string,RVec<float>*> RVecFloat;
20  map<string,RVec<int>*> RVecInt;
21 };
22 
23 #endif
map< string, RVec< int > * > RVecInt
Definition: Collection.h:20
-
C++ structure to store maps of the various types of objects in a collection. OUTDATED BY analyzer...
Definition: Collection.h:16
-
map< string, RVec< float > * > RVecFloat
Definition: Collection.h:19
- -
map< string, int * > Int
Definition: Collection.h:17
-
map< string, bool * > Bool
Definition: Collection.h:18
- +
1 #ifndef _TIMBER_COLLECTION
+
2 #define _TIMBER_COLLECTION
+
3 #include <map>
+
4 #include <string>
+
5 #include <ROOT/RVec.hxx>
+
6 
+
7 using namespace ROOT::VecOps;
+
8 using namespace std;
+
9 
+
16 struct Collection {
+
17  map<string,int*> Int;
+
18  map<string,bool*> Bool;
+
19  map<string,RVec<float>*> RVecFloat;
+
20  map<string,RVec<int>*> RVecInt;
+
21 };
+
22 
+
23 #endif
+
map< string, RVec< float > * > RVecFloat
Definition: Collection.h:19
+
map< string, bool * > Bool
Definition: Collection.h:18
+
map< string, RVec< int > * > RVecInt
Definition: Collection.h:20
+
map< string, int * > Int
Definition: Collection.h:17
+
C++ structure to store maps of the various types of objects in a collection. OUTDATED BY analyzer....
Definition: Collection.h:16
diff --git a/docs/_deep_a_k8__helper_8h_source.html b/docs/_deep_a_k8__helper_8h_source.html index c0aeb29..0b4ef06 100644 --- a/docs/_deep_a_k8__helper_8h_source.html +++ b/docs/_deep_a_k8__helper_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/DeepAK8_helper.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
DeepAK8_helper.h
-
1 #ifndef _TIMBER_DEEPAK8_HELPER
2 #define _TIMBER_DEEPAK8_HELPER
3 #include <vector>
4 #include <map>
5 #include <string>
6 #include <fstream>
7 #include <iostream>
8 #include <cstdlib>
9 #include <sstream>
10 
15  private:
16  std::string entry_to_find;
17  std::vector<std::vector<float> > _values;
18  std::string _p = std::string(std::getenv("TIMBERPATH"))+"TIMBER/data/OfficialSFs/DeepAK8V2_Top_W_SFs.csv";
19 
20  public:
29  DeepAK8_helper(std::string particle, int year, std::string workingpoint, bool massDecorr);
30  ~DeepAK8_helper(){};
38  std::vector<float> eval(float pt);
39 };
40 #endif
DeepAK8_helper(std::string particle, int year, std::string workingpoint, bool massDecorr)
Construct a new DeepAK8_helper object.
Definition: DeepAK8_helper.cc:3
-
C++ class to access scale factors associated with DeepAK8 tagging.
Definition: DeepAK8_helper.h:14
-
std::vector< float > eval(float pt)
Lookup the scale factor and variations based on the AK8 jet momentum. Returned values are absolute {n...
Definition: DeepAK8_helper.cc:43
+
1 #ifndef _TIMBER_DEEPAK8_HELPER
+
2 #define _TIMBER_DEEPAK8_HELPER
+
3 #include <vector>
+
4 #include <map>
+
5 #include <string>
+
6 #include <fstream>
+
7 #include <iostream>
+
8 #include <cstdlib>
+
9 #include <sstream>
+
10 
+ +
15  private:
+
16  std::string entry_to_find;
+
17  std::vector<std::vector<float> > _values;
+
18  std::string _p = std::string(std::getenv("TIMBERPATH"))+"TIMBER/data/OfficialSFs/DeepAK8V2_Top_W_SFs.csv";
+
19 
+
20  public:
+
29  DeepAK8_helper(std::string particle, int year, std::string workingpoint, bool massDecorr);
+
30  ~DeepAK8_helper(){};
+
38  std::vector<float> eval(float pt);
+
39 };
+
40 #endif
+
C++ class to access scale factors associated with DeepAK8 tagging.
Definition: DeepAK8_helper.h:14
+
DeepAK8_helper(std::string particle, int year, std::string workingpoint, bool massDecorr)
Construct a new DeepAK8_helper object.
Definition: DeepAK8_helper.cc:3
+
std::vector< float > eval(float pt)
Lookup the scale factor and variations based on the AK8 jet momentum. Returned values are absolute {n...
Definition: DeepAK8_helper.cc:43
diff --git a/docs/_eff_loader_8h_source.html b/docs/_eff_loader_8h_source.html index c2a3bc8..7beccfe 100644 --- a/docs/_eff_loader_8h_source.html +++ b/docs/_eff_loader_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/EffLoader.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
EffLoader.h
-
1 #include <string>
2 #include "TFile.h"
3 #include "TEfficiency.h"
4 
9 class EffLoader {
10  private:
11  TFile *file;
12  TEfficiency *efficiency;
13  int binx;
14  int globalbin;
15  float effval;
16  float effup;
17  float effdown;
18 
19  public:
23  EffLoader();
30  EffLoader(std::string filename, std::string histname);
37  std::vector<float> eval_byglobal(int globalbin);
46  std::vector<float> eval_bybin(int binx, int biny = 0, int binz = 0);
55  std::vector<float> eval(float xval, float yval = 0, float zval = 0);
56 
57 };
C++ class. Generic histogram loader with methods to return bin values.
Definition: EffLoader.h:9
-
std::vector< float > eval(float xval, float yval=0, float zval=0)
Evaluate by axis value.
Definition: EffLoader.cc:22
-
EffLoader()
Empty constructor.
Definition: EffLoader.cc:3
-
std::vector< float > eval_bybin(int binx, int biny=0, int binz=0)
Evaluate by per-axis bin numbers.
Definition: EffLoader.cc:17
-
std::vector< float > eval_byglobal(int globalbin)
Evaluate by global bin number.
Definition: EffLoader.cc:10
+
1 #ifndef _TIMBER_EFFLOADER
+
2 #define _TIMBER_EFFLOADER
+
3 #include <string>
+
4 #include "TFile.h"
+
5 #include "TEfficiency.h"
+
6 
+
11 class EffLoader {
+
12  private:
+
13  TFile *file;
+
14  TEfficiency *efficiency;
+
15  int binx;
+
16  int globalbin;
+
17  float effval;
+
18  float effup;
+
19  float effdown;
+
20 
+
21  public:
+
25  EffLoader();
+
32  EffLoader(std::string filename, std::string histname);
+
39  std::vector<float> eval_byglobal(int globalbin);
+
48  std::vector<float> eval_bybin(int binx, int biny = 0, int binz = 0);
+
57  std::vector<float> eval(float xval, float yval = 0, float zval = 0);
+
58 };
+
59 #endif
+
std::vector< float > eval(float xval, float yval=0, float zval=0)
Evaluate by axis value.
Definition: EffLoader.cc:22
+
EffLoader()
Empty constructor.
Definition: EffLoader.cc:3
+
std::vector< float > eval_bybin(int binx, int biny=0, int binz=0)
Evaluate by per-axis bin numbers.
Definition: EffLoader.cc:17
+
std::vector< float > eval_byglobal(int globalbin)
Evaluate by global bin number.
Definition: EffLoader.cc:10
+
C++ class. Generic histogram loader with methods to return bin values.
Definition: EffLoader.h:11
diff --git a/docs/_gen_matching_8h_source.html b/docs/_gen_matching_8h_source.html index 24c15e3..ebb6f96 100644 --- a/docs/_gen_matching_8h_source.html +++ b/docs/_gen_matching_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/GenMatching.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
GenMatching.h
-
1 #ifndef _TIMBER_GENMATCHING
2 #define _TIMBER_GENMATCHING
3 #include <map>
4 #include <algorithm>
5 #include <numeric>
6 #include <math.h>
7 #include <cstdlib>
8 #include "common.h"
9 #include <Math/Vector4D.h>
10 #include <Math/VectorUtil.h>
11 
12 using namespace ROOT::VecOps;
13 using LVector = ROOT::Math::PtEtaPhiMVector;
14 
15 namespace GenMatching {
23  bool BitChecker(const int &bit, int &number);
24 
27  extern std::map <int, std::string> PDGIds;
28 
31  extern std::map <std::string, int> GenParticleStatusFlags;
32 }
33 
38 class Particle {
39  public:
40  bool flag = true;
41  int index;
42  std::map <std::string, int> statusFlags;
44  std::vector<int> childIndex;
45  LVector vect;
47  int pdgId;
48  int status;
52  Particle();
60  template <class T>
61  Particle(int i, T p) :
62  vect(LVector(p.pt, p.eta, p.phi, p.mass)), index(i), genPartIdxMother(p.genPartIdxMother),
63  pdgId(p.pdgId), status(p.status) {
64  SetStatusFlags(p.statusFlags);
65  };
71  void AddParent(int idx);
77  void AddChild(int idx);
83  int GetParent();
89  std::vector<int> GetChild();
96  float DeltaR(LVector input_vector);
101  void SetStatusFlags(int flags);
106  int GetStatusFlag(std::string flagName);
114  std::map< std::string, bool> CompareToVector(LVector vect);
115 };
116 
117 
124 {
125  private:
126  std::vector<Particle> _nodes;
127  std::vector<Particle*> _heads;
128  // std::vector<int> _storedIndexes;
129 
130  bool _matchParticleToString(Particle* particle, std::string string);
131  std::vector<Particle*> _runChain(Particle* node, std::vector<std::string> chain);
132 
133  Particle _noneParticle;
134 
135  public:
141  GenParticleTree(int nParticles);
147  Particle* AddParticle(Particle particle);
156  template <class T>
157  Particle* AddParticle(int index, T p) {
158  Particle particle(index, p);
159  return AddParticle(particle);
160  }
166  std::vector<Particle*> GetParticles() {
167  std::vector<Particle*> out;
168  for (int inode = 0; inode<_nodes.size(); inode++) {
169  out.push_back(&_nodes[inode]);
170  }
171  return out;
172  }
179  std::vector<Particle*> GetChildren(Particle* particle);
186  Particle* GetParent(Particle* particle);
193  std::vector<std::vector<Particle*>> FindChain(std::string chainstring);
194 };
195 #endif
std::vector< Particle * > GetParticles()
Get the list of particle objects.
Definition: GenMatching.h:166
-
int index
Definition: GenMatching.h:41
-
Particle(int i, T p)
Construct a new Particle object with TIMBER collection struct as input.
Definition: GenMatching.h:61
-
C++ class. Stores identifying features of a particle in the GenPart collection.
Definition: GenMatching.h:38
-
C++ class. Constructs tree by adding particles. Establish relationships between particles (parent...
Definition: GenMatching.h:123
-
int pdgId
Definition: GenMatching.h:47
-
LVector vect
Definition: GenMatching.h:45
-
int parentIndex
Definition: GenMatching.h:43
-
std::vector< int > childIndex
Definition: GenMatching.h:44
- -
int status
Definition: GenMatching.h:48
-
std::map< std::string, int > statusFlags
Definition: GenMatching.h:42
-
Particle * AddParticle(int index, T p)
Add particle to tree.
Definition: GenMatching.h:157
-
int genPartIdxMother
Definition: GenMatching.h:46
-
Definition: GenMatching.h:15
+
1 #ifndef _TIMBER_GENMATCHING
+
2 #define _TIMBER_GENMATCHING
+
3 #include <map>
+
4 #include <algorithm>
+
5 #include <numeric>
+
6 #include <math.h>
+
7 #include <cstdlib>
+
8 #include "common.h"
+
9 #include <Math/Vector4D.h>
+
10 #include <Math/VectorUtil.h>
+
11 
+
12 using namespace ROOT::VecOps;
+
13 using LVector = ROOT::Math::PtEtaPhiMVector;
+
14 
+
15 namespace GenMatching {
+
23  bool BitChecker(const int &bit, int &number);
+
24 
+
27  extern std::map <int, std::string> PDGIds;
+
28 
+
31  extern std::map <std::string, int> GenParticleStatusFlags;
+
32 }
+
33 
+
38 class Particle {
+
39  public:
+
40  bool flag = true;
+
41  int index;
+
42  std::map <std::string, int> statusFlags;
+ +
44  std::vector<int> childIndex;
+
45  LVector vect;
+ +
47  int pdgId;
+
48  int status;
+
52  Particle();
+
60  template <class T>
+
61  Particle(int i, T p) :
+
62  vect(LVector(p.pt, p.eta, p.phi, p.mass)), index(i), genPartIdxMother(p.genPartIdxMother),
+
63  pdgId(p.pdgId), status(p.status) {
+
64  SetStatusFlags(p.statusFlags);
+
65  };
+
71  void AddParent(int idx);
+
77  void AddChild(int idx);
+
83  int GetParent();
+
89  std::vector<int> GetChild();
+
96  float DeltaR(LVector input_vector);
+
101  void SetStatusFlags(int flags);
+
106  int GetStatusFlag(std::string flagName);
+
114  std::map< std::string, bool> CompareToVector(LVector vect);
+
115 };
+
116 
+
117 
+ +
124 {
+
125  private:
+
126  std::vector<Particle> _nodes;
+
127  std::vector<Particle*> _heads;
+
128  // std::vector<int> _storedIndexes;
+
129 
+
130  bool _matchParticleToString(Particle* particle, std::string string);
+
131  std::vector<Particle*> _runChain(Particle* node, std::vector<std::string> chain);
+
132 
+
133  Particle _noneParticle;
+
134 
+
135  public:
+
141  GenParticleTree(int nParticles);
+
147  Particle* AddParticle(Particle particle);
+
156  template <class T>
+
157  Particle* AddParticle(int index, T p) {
+
158  Particle particle(index, p);
+
159  return AddParticle(particle);
+
160  }
+
166  std::vector<Particle*> GetParticles() {
+
167  std::vector<Particle*> out;
+
168  for (int inode = 0; inode<_nodes.size(); inode++) {
+
169  out.push_back(&_nodes[inode]);
+
170  }
+
171  return out;
+
172  }
+
179  std::vector<Particle*> GetChildren(Particle* particle);
+
186  Particle* GetParent(Particle* particle);
+
193  std::vector<std::vector<Particle*>> FindChain(std::string chainstring);
+
194 };
+
195 #endif
+
C++ class. Stores identifying features of a particle in the GenPart collection.
Definition: GenMatching.h:38
+
Particle(int i, T p)
Construct a new Particle object with TIMBER collection struct as input.
Definition: GenMatching.h:61
+
int status
Definition: GenMatching.h:48
+
int parentIndex
Definition: GenMatching.h:43
+
std::vector< Particle * > GetParticles()
Get the list of particle objects.
Definition: GenMatching.h:166
+
std::vector< int > childIndex
Definition: GenMatching.h:44
+
int genPartIdxMother
Definition: GenMatching.h:46
+
LVector vect
Definition: GenMatching.h:45
+
std::map< std::string, int > statusFlags
Definition: GenMatching.h:42
+
int pdgId
Definition: GenMatching.h:47
+
int index
Definition: GenMatching.h:41
+
Particle * AddParticle(int index, T p)
Add particle to tree.
Definition: GenMatching.h:157
+
C++ class. Constructs tree by adding particles. Establish relationships between particles (parent,...
Definition: GenMatching.h:123
diff --git a/docs/_h_e_m__drop_8h_source.html b/docs/_h_e_m__drop_8h_source.html index 3b3ae9f..f550c38 100644 --- a/docs/_h_e_m__drop_8h_source.html +++ b/docs/_h_e_m__drop_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/HEM_drop.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
HEM_drop.h
-
1 #ifndef _TIMBER_HEM_DROP
2 #define _TIMBER_HEM_DROP
3 #include "common.h"
4 #include <iostream>
5 #include <string>
6 #include <numeric>
7 
8 using namespace Pythonic;
17 class HEM_drop {
18  private:
19  bool _isAffectedData;
20  bool _isDataB;
21  std::vector<int> _idxToCheck;
22  std::string _setname;
23  public:
30  HEM_drop(std::string setname, std::vector<int> idxToCheck = {});
39  std::vector<float> eval(RVec<float> FatJet_eta, RVec<float> FatJet_phi, int run = 0);
40 };
41 #endif
C++ class to weight events as if one were dropping any events with a jet in the effected region...
Definition: HEM_drop.h:17
-
Definition: common.h:201
+
1 #ifndef _TIMBER_HEM_DROP
+
2 #define _TIMBER_HEM_DROP
+
3 #include "common.h"
+
4 #include <iostream>
+
5 #include <string>
+
6 #include <numeric>
+
7 
+
8 using namespace Pythonic;
+
17 class HEM_drop {
+
18  private:
+
19  bool _isAffectedData;
+
20  bool _isDataB;
+
21  std::vector<int> _idxToCheck;
+
22  std::string _setname;
+
23  public:
+
30  HEM_drop(std::string setname, std::vector<int> idxToCheck = {});
+
39  std::vector<float> eval(RVec<float> FatJet_eta, RVec<float> FatJet_phi, int run = 0);
+
40 };
+
41 #endif
+
C++ class to weight events as if one were dropping any events with a jet in the effected region....
Definition: HEM_drop.h:17
diff --git a/docs/_hist_loader_8h_source.html b/docs/_hist_loader_8h_source.html index 0b998d1..18d89fe 100644 --- a/docs/_hist_loader_8h_source.html +++ b/docs/_hist_loader_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/HistLoader.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
HistLoader.h
-
1 #ifndef _TIMBER_HISTLOADER
2 #define _TIMBER_HISTLOADER
3 #include <string>
4 #include "TFile.h"
5 #include "TH1.h"
6 #include "TH2.h"
7 #include "TH3.h"
8 
13 class HistLoader {
14  private:
15  TFile *file;
16  int dim;
17 
26  void checkDim(int x, int y, int z);
27  public:
28  TH1 *hist;
29 
39  HistLoader(std::string filename, std::string histname);
48  std::vector<float> eval_bybin(int binx, int biny = 0, int binz = 0);
57  std::vector<float> eval(float xval, float yval = 0., float zval = 0.);
58 
59 };
60 #endif
TH1 * hist
Histogram object.
Definition: HistLoader.h:28
-
std::vector< float > eval(float xval, float yval=0., float zval=0.)
Evaluate by axis value.
Definition: HistLoader.cc:52
-
HistLoader()
Empty constructor.
Definition: HistLoader.h:32
-
std::vector< float > eval_bybin(int binx, int biny=0, int binz=0)
Evaluate by bin numbers.
Definition: HistLoader.cc:28
-
C++ class. Generic histogram loader with methods to return bin values.
Definition: HistLoader.h:13
+
1 #ifndef _TIMBER_HISTLOADER
+
2 #define _TIMBER_HISTLOADER
+
3 #include <string>
+
4 #include "TFile.h"
+
5 #include "TH1.h"
+
6 #include "TH2.h"
+
7 #include "TH3.h"
+
8 
+
13 class HistLoader {
+
14  private:
+
15  TFile *file;
+
16  int dim;
+
17 
+
26  void checkDim(int x, int y, int z);
+
27  public:
+
28  TH1 *hist;
+
29 
+ +
39  HistLoader(std::string filename, std::string histname);
+
48  std::vector<float> eval_bybin(int binx, int biny = 0, int binz = 0);
+
57  std::vector<float> eval(float xval, float yval = 0., float zval = 0.);
+
58 
+
59 };
+
60 #endif
+
HistLoader()
Empty constructor.
Definition: HistLoader.h:32
+
C++ class. Generic histogram loader with methods to return bin values.
Definition: HistLoader.h:13
+
std::vector< float > eval_bybin(int binx, int biny=0, int binz=0)
Evaluate by bin numbers.
Definition: HistLoader.cc:28
+
TH1 * hist
Histogram object.
Definition: HistLoader.h:28
+
std::vector< float > eval(float xval, float yval=0., float zval=0.)
Evaluate by axis value.
Definition: HistLoader.cc:52
diff --git a/docs/_j_e_r__weight_8h_source.html b/docs/_j_e_r__weight_8h_source.html index fea08dc..ccfdfcf 100644 --- a/docs/_j_e_r__weight_8h_source.html +++ b/docs/_j_e_r__weight_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/JER_weight.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
JER_weight.h
-
1 #ifndef _TIMBER_JER_WEIGHT
2 #define _TIMBER_JER_WEIGHT
3 #include <string>
4 #include <ROOT/RVec.hxx>
5 #include "JetSmearer.h"
6 
7 using namespace ROOT::VecOps;
11 class JER_weight {
12  private:
13  JetSmearer _smearer;
14  public:
21  JER_weight(std::string jerTag, std::string jetType);
22  ~JER_weight(){};
36  template <class Tjet, class TgenJet>
37  RVec< RVec<float> > eval(std::vector<Tjet> jets, std::vector<TgenJet> genJets, float fixedGridRhoFastjetAll){
38  RVec< RVec<float> > out (jets.size());
39  for (size_t ijet = 0; ijet < jets.size(); ijet++) {
40  out[ijet] = (RVec<float>)_smearer.GetSmearValsPt(hardware::TLvector(jets[ijet]), hardware::TLvector(genJets), fixedGridRhoFastjetAll);
41  }
42  return out;
43  }
44 };
45 #endif
C++ class to handle the JER weight calculations.
Definition: JER_weight.h:11
- -
RVec< RVec< float > > eval(std::vector< Tjet > jets, std::vector< TgenJet > genJets, float fixedGridRhoFastjetAll)
Evaluation calculates the factor necessary for each jet in the provided vector of jets* in order to s...
Definition: JER_weight.h:37
-
C++ class to handle the smearing of jet pt and mass using the JER and JMR inputs, respectively...
Definition: JetSmearer.h:62
-
ROOT::Math::PtEtaPhiMVector TLvector(float pt, float eta, float phi, float m)
Create a ROOT::Math::PtEtaPhiMVector.
Definition: common.cc:61
-
std::vector< float > GetSmearValsPt(LorentzV jet, RVec< LorentzV > genJets, float fixedGridRhoFastjetAll)
Smear jet pT to account for measured difference in JER between data and simulation. The function computes the nominal smeared jet pT simultaneously with the JER up and down shifts, in order to use the same random number to smear all three (for consistency reasons).
Definition: JetSmearer.cc:51
+
1 #ifndef _TIMBER_JER_WEIGHT
+
2 #define _TIMBER_JER_WEIGHT
+
3 #include <string>
+
4 #include <ROOT/RVec.hxx>
+
5 #include "JetSmearer.h"
+
6 
+
7 using namespace ROOT::VecOps;
+
11 class JER_weight {
+
12  private:
+
13  JetSmearer _smearer;
+
14  public:
+
21  JER_weight(std::string jerTag, std::string jetType);
+
22  ~JER_weight(){};
+
36  template <class Tjet, class TgenJet>
+
37  RVec<RVec<float>> eval(std::vector<Tjet> jets, std::vector<TgenJet> genJets, float fixedGridRhoFastjetAll){
+
38  RVec< RVec<float> > out (jets.size());
+
39  for (size_t ijet = 0; ijet < jets.size(); ijet++) {
+
40  out[ijet] = (RVec<float>)_smearer.GetSmearValsPt(hardware::TLvector(jets[ijet]), hardware::TLvector(genJets), fixedGridRhoFastjetAll);
+
41  }
+
42  return out;
+
43  }
+
44 };
+
45 #endif
+
RVec< RVec< float > > eval(std::vector< Tjet > jets, std::vector< TgenJet > genJets, float fixedGridRhoFastjetAll)
Evaluation calculates the factor necessary for each jet in the provided vector of jets* in order to s...
Definition: JER_weight.h:37
+
C++ class to handle the JER weight calculations.
Definition: JER_weight.h:11
+
C++ class to handle the smearing of jet pt and mass using the JER and JMR inputs, respectively.
Definition: JetSmearer.h:62
+
std::vector< float > GetSmearValsPt(LorentzV jet, RVec< LorentzV > genJets, float fixedGridRhoFastjetAll)
Smear jet pT to account for measured difference in JER between data and simulation....
Definition: JetSmearer.cc:51
+
ROOT::Math::PtEtaPhiMVector TLvector(float pt, float eta, float phi, float m)
Create a ROOT::Math::PtEtaPhiMVector.
Definition: common.cc:78
diff --git a/docs/_j_e_s__weight_8h_source.html b/docs/_j_e_s__weight_8h_source.html index 856bbbd..779eb96 100644 --- a/docs/_j_e_s__weight_8h_source.html +++ b/docs/_j_e_s__weight_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/JES_weight.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
JES_weight.h
-
1 #ifndef _TIMBER_JES_WEIGHT
2 #define _TIMBER_JES_WEIGHT
3 // Requires CMSSW
4 #include <string>
5 #include <vector>
6 #include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"
7 #include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h"
8 #include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h"
9 #include <ROOT/RVec.hxx>
10 #include "JetRecalibrator.h"
11 #include "common.h"
12 
13 using namespace ROOT::VecOps;
17 class JES_weight {
18  private:
19  const std::string _jecTag, _jetType, _uncertType;
20  const bool _redoJECs;
21  JetRecalibrator _jetRecalib;
22  bool check_type_exists();
23  std::vector<std::string> get_sources();
24 
25  public:
37  JES_weight(str jecTag, str jetType, str uncertType = "", bool redoJECs=false);
38  ~JES_weight(){};
56  template <class T>
57  RVec< RVec<float> > eval(std::vector<T> jets, float fixedGridRhoFastjetAll){
58  RVec< RVec<float> > out (jets.size());
59 
60  for (size_t ijet = 0; ijet < jets.size(); ijet++) {
61  RVec<float> ijet_out {1.0, 1.0, 1.0};
62 
63  if (_redoJECs) {
64  _jetRecalib.CalculateCorrection(jets[ijet], fixedGridRhoFastjetAll);
65  _jetRecalib.CalculateUncertainty(jets[ijet]);
66 
67  ijet_out[0] = _jetRecalib.GetCorrection();
68  ijet_out[1] = _jetRecalib.GetCorrection()*(1+_jetRecalib.GetUncertainty());
69  ijet_out[2] = _jetRecalib.GetCorrection()*(1-_jetRecalib.GetUncertainty());
70  } else {
71  _jetRecalib.CalculateUncertainty(jets[ijet], fixedGridRhoFastjetAll);
72  ijet_out[1] = 1+_jetRecalib.GetUncertainty();
73  ijet_out[2] = 1-_jetRecalib.GetUncertainty();
74  }
75  out[ijet] = ijet_out;
76  }
77  return out;
78  };
79 };
80 #endif
void CalculateUncertainty(T jet, float delta=1)
Calculate the correction uncertainty for a given jet and store the value internally. WARNING: CalculateCorrection must be run first.
Definition: JetRecalibrator.h:88
-
C++ class to handle the JES/JEC weight calculations.
Definition: JES_weight.h:17
-
float GetCorrection()
Return the internally stored correction value that was calculated during CalculateCorrection.
Definition: JetRecalibrator.h:105
- -
RVec< RVec< float > > eval(std::vector< T > jets, float fixedGridRhoFastjetAll)
If redoJECs is true, evaluation calculates the weight necessary to uncorrect and recorrect the jet en...
Definition: JES_weight.h:57
-
C++ class to recalibrate the of jets. Initialized with basic parameters and calculations done on vec...
Definition: JetRecalibrator.h:23
-
void CalculateCorrection(T jet, float fixedGridRhoFastjetAll)
Calculate the correction for a given jet and rho and store the value internally.
Definition: JetRecalibrator.h:71
-
float GetUncertainty()
Return the internally stored uncertainty value that was calculated during CalculateUncertainty.
Definition: JetRecalibrator.h:112
+
1 #ifndef _TIMBER_JES_WEIGHT
+
2 #define _TIMBER_JES_WEIGHT
+
3 // Requires CMSSW
+
4 #include <string>
+
5 #include <vector>
+
6 #include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"
+
7 #include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h"
+
8 #include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h"
+
9 #include <ROOT/RVec.hxx>
+
10 #include "JetRecalibrator.h"
+
11 #include "common.h"
+
12 
+
13 using namespace ROOT::VecOps;
+
17 class JES_weight {
+
18  private:
+
19  const std::string _jecTag, _jetType, _uncertType;
+
20  const bool _redoJECs;
+
21  JetRecalibrator _jetRecalib;
+
22  bool check_type_exists();
+
23  std::vector<std::string> get_sources();
+
24 
+
25  public:
+
37  JES_weight(str jecTag, str jetType, str uncertType = "", bool redoJECs=false);
+
38  ~JES_weight(){};
+
56  template <class T>
+
57  RVec<RVec<float>> eval(std::vector<T> jets, float fixedGridRhoFastjetAll){
+
58  RVec<RVec<float>> out (jets.size());
+
59 
+
60  for (size_t ijet = 0; ijet < jets.size(); ijet++) {
+
61  RVec<float> ijet_out {1.0, 1.0, 1.0};
+
62 
+
63  if (_redoJECs) {
+
64  _jetRecalib.CalculateCorrection(jets[ijet], fixedGridRhoFastjetAll);
+
65  _jetRecalib.CalculateUncertainty(jets[ijet]);
+
66 
+
67  ijet_out[0] = _jetRecalib.GetCorrection();
+
68  ijet_out[1] = _jetRecalib.GetCorrection()*(1+_jetRecalib.GetUncertainty());
+
69  ijet_out[2] = _jetRecalib.GetCorrection()*(1-_jetRecalib.GetUncertainty());
+
70  } else {
+
71  _jetRecalib.CalculateUncertainty(jets[ijet], fixedGridRhoFastjetAll);
+
72  ijet_out[1] = 1+_jetRecalib.GetUncertainty();
+
73  ijet_out[2] = 1-_jetRecalib.GetUncertainty();
+
74  }
+
75  out[ijet] = ijet_out;
+
76  }
+
77  return out;
+
78  };
+
79 };
+
80 #endif
+
void CalculateUncertainty(T jet, float delta=1)
Calculate the correction uncertainty for a given jet and store the value internally....
Definition: JetRecalibrator.h:88
+
C++ class to recalibrate the of jets. Initialized with basic parameters and calculations done on vec...
Definition: JetRecalibrator.h:23
+
RVec< RVec< float > > eval(std::vector< T > jets, float fixedGridRhoFastjetAll)
If redoJECs is true, evaluation calculates the weight necessary to uncorrect and recorrect the jet en...
Definition: JES_weight.h:57
+
float GetCorrection()
Return the internally stored correction value that was calculated during CalculateCorrection.
Definition: JetRecalibrator.h:105
+
void CalculateCorrection(T jet, float fixedGridRhoFastjetAll)
Calculate the correction for a given jet and rho and store the value internally.
Definition: JetRecalibrator.h:71
+
C++ class to handle the JES/JEC weight calculations.
Definition: JES_weight.h:17
+
float GetUncertainty()
Return the internally stored uncertainty value that was calculated during CalculateUncertainty.
Definition: JetRecalibrator.h:112
diff --git a/docs/_j_m_e__common_8h_source.html b/docs/_j_m_e__common_8h_source.html index bd2a2b8..dfcc8c8 100644 --- a/docs/_j_m_e__common_8h_source.html +++ b/docs/_j_m_e__common_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/JME_common.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
JME_common.h
-
1 #ifndef _TIMBER_JME_COMMON
2 #define _TIMBER_JME_COMMON
3 #include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"
4 #include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h"
5 #include "JetMETCorrections/Modules/interface/JetResolution.h"
6 #include "common.h"
7 
8 using str = std::string;
9 
14 class JMEpaths {
15  protected:
19  const str _timberPath;
23  const str _jmeArchivePath;
29 
30  public:
34  JMEpaths();
43  str _GetPath(str tarfile, str jmefile);
51  str _GetTxtFileStr(str tarfile, str jmefile);
52 };
57 class JESpaths : JMEpaths {
58  private:
59  const str _jecTag, _jetType;
60  const str _jesArchivePath;
61  str GetLevelStr(str level);
62  str GetPath(str level);
63 
64  public:
68  JESpaths();
75  JESpaths(str jecTag, str jetType);
82  str GetTxtFileStr(str level);
90  JetCorrectorParameters GetParameters(str level, str uncertType = "");
91 };
96 class JERpaths : JMEpaths {
97  private:
98  const str _jerTag, _jetType;
99  const str _jerArchivePath;
100 
101  str GetPath(str resOrSF);
102  str GetTxtFileStr(str resOrSF);
103 
104  public:
108  JERpaths();
116  JERpaths(str jerTag, str jetType);
122  JME::JetResolution GetResolution();
128  JME::JetResolutionScaleFactor GetSF();
129 };
130 #endif
C++ class to handle the extraction of JES objects (aka JEC) starting from the JEC tags and jet types...
Definition: JME_common.h:57
-
const str _jmeArchivePath
Full path to the tarball archives being accessed.
Definition: JME_common.h:23
-
JMEpaths()
Construct a new JMEpaths object.
Definition: JME_common.cc:5
-
const str _timberPath
Full path to TIMBER&#39;s home.
Definition: JME_common.h:19
-
str _GetPath(str tarfile, str jmefile)
Extract jmefile from tarfile into a temporary directory and return the path to that directory...
Definition: JME_common.cc:10
-
str _GetTxtFileStr(str tarfile, str jmefile)
Extract jmefile from tarfile into a string which is returned.
Definition: JME_common.cc:15
-
C++ class to handle the extraction of JER objects starting from the JER tags and jet types...
Definition: JME_common.h:96
-
C++ class. Parent class to handle shared attributes and methods among JESpaths and JERpaths...
Definition: JME_common.h:14
-
C++ class. Creates a temporary directory that is destroyed on delete.
Definition: common.h:338
-
TempDir _tempdir
Temporary directory object which makes and deletes a staging area for the extracted JME text files...
Definition: JME_common.h:28
+
1 #ifndef _TIMBER_JME_COMMON
+
2 #define _TIMBER_JME_COMMON
+
3 #include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"
+
4 #include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h"
+
5 #include "JetMETCorrections/Modules/interface/JetResolution.h"
+
6 #include "common.h"
+
7 
+
8 using str = std::string;
+
9 
+
14 class JMEpaths {
+
15  protected:
+
19  const str _timberPath;
+
23  const str _jmeArchivePath;
+ +
29 
+
30  public:
+
34  JMEpaths();
+
43  str _GetPath(str tarfile, str jmefile);
+
51  str _GetTxtFileStr(str tarfile, str jmefile);
+
52 };
+
57 class JESpaths : JMEpaths {
+
58  private:
+
59  const str _jecTag, _jetType;
+
60  const str _jesArchivePath;
+
61  str GetLevelStr(str level);
+
62  str GetPath(str level);
+
63 
+
64  public:
+
68  JESpaths();
+
75  JESpaths(str jecTag, str jetType);
+
82  str GetTxtFileStr(str level);
+
90  JetCorrectorParameters GetParameters(str level, str uncertType = "");
+
91 };
+
96 class JERpaths : JMEpaths {
+
97  private:
+
98  const str _jerTag, _jetType;
+
99  const str _jerArchivePath;
+
100 
+
101  str GetPath(str resOrSF);
+
102  str GetTxtFileStr(str resOrSF);
+
103 
+
104  public:
+
108  JERpaths();
+
116  JERpaths(str jerTag, str jetType);
+
122  JME::JetResolution GetResolution();
+
128  JME::JetResolutionScaleFactor GetSF();
+
129 };
+
130 #endif
+
C++ class to handle the extraction of JES objects (aka JEC) starting from the JEC tags and jet types.
Definition: JME_common.h:57
+
const str _timberPath
Full path to TIMBER's home.
Definition: JME_common.h:19
+
JMEpaths()
Construct a new JMEpaths object.
Definition: JME_common.cc:5
+
str GetTxtFileStr(str level)
Get the JEC file as a string. Used in JES_weight for parsing possible uncertainty sources.
Definition: JME_common.cc:42
+
str _GetPath(str tarfile, str jmefile)
Extract jmefile from tarfile into a temporary directory and return the path to that directory.
Definition: JME_common.cc:10
+
JetCorrectorParameters GetParameters(str level, str uncertType="")
Get the JetCorrectorParameters object.
Definition: JME_common.cc:48
+
JME::JetResolution GetResolution()
Get the JetResolution object.
Definition: JME_common.cc:71
+
C++ class. Parent class to handle shared attributes and methods among JESpaths and JERpaths.
Definition: JME_common.h:14
+
JESpaths()
Construct a new JESpaths object.
Definition: JME_common.cc:19
+
C++ class. Creates a temporary directory that is destroyed on delete.
Definition: common.h:348
+
str _GetTxtFileStr(str tarfile, str jmefile)
Extract jmefile from tarfile into a string which is returned.
Definition: JME_common.cc:15
+
JME::JetResolutionScaleFactor GetSF()
Get the JetResolutionScaleFactor object.
Definition: JME_common.cc:75
+
C++ class to handle the extraction of JER objects starting from the JER tags and jet types.
Definition: JME_common.h:96
+
JERpaths()
Construct a new JERpaths object.
Definition: JME_common.cc:52
+
TempDir _tempdir
Temporary directory object which makes and deletes a staging area for the extracted JME text files.
Definition: JME_common.h:28
+
const str _jmeArchivePath
Full path to the tarball archives being accessed.
Definition: JME_common.h:23
diff --git a/docs/_j_m_r__weight_8h_source.html b/docs/_j_m_r__weight_8h_source.html index e741aeb..d4e5906 100644 --- a/docs/_j_m_r__weight_8h_source.html +++ b/docs/_j_m_r__weight_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/JMR_weight.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
JMR_weight.h
-
1 #ifndef _TIMBER_JMR_WEIGHT
2 #define _TIMBER_JMR_WEIGHT
3 #include <string>
4 #include <ROOT/RVec.hxx>
5 #include <TF1.h>
6 #include "JetSmearer.h"
7 
8 using namespace ROOT::VecOps;
16 class JMR_weight {
17  private:
18  std::map< int, std::vector<float> > _jmrTable {
19  {2016, {1.00, 1.2, 0.8 } },
20  {2017, {1.09, 1.14, 1.04} },
21  {2018, {1.09, 1.14, 1.04} }
22  };
23  JetSmearer _smearer;
24 
25  public:
31  JMR_weight(int year);
32  ~JMR_weight(){};
50  template <class Tjet, class TgenJet>
51  RVec< RVec<float> > eval(std::vector<Tjet> jets, std::vector<TgenJet> genJets){
52  RVec< RVec<float> > out (jets.size());
53 
54  for (size_t ijet = 0; ijet < jets.size(); ijet++) {
55  RVec<LorentzV> genJetsV = hardware::TLvector(genJets);
56  out[ijet] = (RVec<float>)_smearer.GetSmearValsM(hardware::TLvector(jets[ijet]), hardware::TLvector(genJets));
57  }
58  return out;
59  }
60 };
61 #endif
C++ class to directly handle JMR weights in the case of tau21 jet substructure. The values used (nomi...
Definition: JMR_weight.h:16
-
std::vector< float > GetSmearValsM(LorentzV jet, RVec< LorentzV > genJets)
Smear jet mass to account for measured difference in JMR between data and simulation. The function computes the nominal smeared jet mass simultaneously with the JMR up and down shifts, in order to use the same random number to smear all three (for consistency reasons).
Definition: JetSmearer.cc:93
-
RVec< RVec< float > > eval(std::vector< Tjet > jets, std::vector< TgenJet > genJets)
Evaluation calculates the factor necessary for each jet in the provided vector of jets* in order to s...
Definition: JMR_weight.h:51
- -
C++ class to handle the smearing of jet pt and mass using the JER and JMR inputs, respectively...
Definition: JetSmearer.h:62
-
ROOT::Math::PtEtaPhiMVector TLvector(float pt, float eta, float phi, float m)
Create a ROOT::Math::PtEtaPhiMVector.
Definition: common.cc:61
+
1 #ifndef _TIMBER_JMR_WEIGHT
+
2 #define _TIMBER_JMR_WEIGHT
+
3 #include <string>
+
4 #include <ROOT/RVec.hxx>
+
5 #include <TF1.h>
+
6 #include "JetSmearer.h"
+
7 
+
8 using namespace ROOT::VecOps;
+
16 class JMR_weight {
+
17  private:
+
18  std::map< int, std::vector<float> > _jmrTable {
+
19  {2016, {1.00, 1.2, 0.8 } },
+
20  {2017, {1.09, 1.14, 1.04} },
+
21  {2018, {1.09, 1.14, 1.04} }
+
22  };
+
23  JetSmearer _smearer;
+
24 
+
25  public:
+
31  JMR_weight(int year);
+
32  ~JMR_weight(){};
+
50  template <class Tjet, class TgenJet>
+
51  RVec<RVec<float>> eval(std::vector<Tjet> jets, std::vector<TgenJet> genJets){
+
52  RVec<RVec<float>> out (jets.size());
+
53 
+
54  for (size_t ijet = 0; ijet < jets.size(); ijet++) {
+
55  RVec<LorentzV> genJetsV = hardware::TLvector(genJets);
+
56  out[ijet] = (RVec<float>)_smearer.GetSmearValsM(hardware::TLvector(jets[ijet]), hardware::TLvector(genJets));
+
57  }
+
58  return out;
+
59  }
+
60 };
+
61 #endif
+
RVec< RVec< float > > eval(std::vector< Tjet > jets, std::vector< TgenJet > genJets)
Evaluation calculates the factor necessary for each jet in the provided vector of jets* in order to s...
Definition: JMR_weight.h:51
+
C++ class to handle the smearing of jet pt and mass using the JER and JMR inputs, respectively.
Definition: JetSmearer.h:62
+
C++ class to directly handle JMR weights in the case of tau21 jet substructure. The values used (nomi...
Definition: JMR_weight.h:16
+
ROOT::Math::PtEtaPhiMVector TLvector(float pt, float eta, float phi, float m)
Create a ROOT::Math::PtEtaPhiMVector.
Definition: common.cc:78
+
std::vector< float > GetSmearValsM(LorentzV jet, RVec< LorentzV > genJets)
Smear jet mass to account for measured difference in JMR between data and simulation....
Definition: JetSmearer.cc:93
diff --git a/docs/_j_m_s__weight_8h_source.html b/docs/_j_m_s__weight_8h_source.html index 74aba79..a6e092e 100644 --- a/docs/_j_m_s__weight_8h_source.html +++ b/docs/_j_m_s__weight_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/JMS_weight.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
JMS_weight.h
-
1 #ifndef _TIMBER_JMS_WEIGHT
2 #define _TIMBER_JMS_WEIGHT
3 #include <string>
4 #include <cstdlib>
5 #include <map>
6 #include <vector>
7 #include <ROOT/RVec.hxx>
8 
9 using namespace ROOT::VecOps;
10 
18 class JMS_weight {
19  private:
20  std::map< int, std::vector<float> > _jmsTable {
21  {2016, {1.000, 1.0094, 0.9906} },
22  {2017, {0.982, 0.986 , 0.978 } },
23  {2018, {0.982, 0.986 , 0.978 } }
24  };
25  std::vector<float> _jmsVals;
26  public:
32  JMS_weight(int year);
33  ~JMS_weight(){};
44  RVec< RVec<float>> eval(size_t nJets);
45 };
46 #endif
C++ class to directly handle JMS weights in the case of tau21 jet substructure. The values used (nomi...
Definition: JMS_weight.h:18
- +
1 #ifndef _TIMBER_JMS_WEIGHT
+
2 #define _TIMBER_JMS_WEIGHT
+
3 #include <string>
+
4 #include <cstdlib>
+
5 #include <map>
+
6 #include <vector>
+
7 #include <ROOT/RVec.hxx>
+
8 
+
9 using namespace ROOT::VecOps;
+
10 
+
18 class JMS_weight {
+
19  private:
+
20  std::map< int, std::vector<float> > _jmsTable {
+
21  {2016, {1.000, 1.0094, 0.9906} },
+
22  {2017, {0.982, 0.986 , 0.978 } },
+
23  {2018, {0.982, 0.986 , 0.978 } }
+
24  };
+
25  std::vector<float> _jmsVals;
+
26  public:
+
32  JMS_weight(int year);
+
33  ~JMS_weight(){};
+
44  RVec<RVec<float>> eval(size_t nJets);
+
45 };
+
46 #endif
+
C++ class to directly handle JMS weights in the case of tau21 jet substructure. The values used (nomi...
Definition: JMS_weight.h:18
diff --git a/docs/_jet_recalibrator_8h_source.html b/docs/_jet_recalibrator_8h_source.html index 15dc4bf..42fb3ab 100644 --- a/docs/_jet_recalibrator_8h_source.html +++ b/docs/_jet_recalibrator_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/JetRecalibrator.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
JetRecalibrator.h
-
1 #ifndef _TIMBER_JETRECALIBRATOR
2 #define _TIMBER_JETRECALIBRATOR
3 #include <string>
4 #include <map>
5 #include <vector>
6 #include <algorithm>
7 // #include <boost/filesystem.hpp>
8 #include "Collection.h"
9 #include "JME_common.h"
10 #include <ROOT/RVec.hxx>
11 #include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h"
12 #include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"
13 #include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h"
14 
15 typedef std::string str;
16 typedef ROOT::VecOps::RVec<float> rvec_f;
17 typedef std::vector<JetCorrectorParameters> vJCP;
24  private:
25  bool _doResidualJECs;//, _calculateSeparateCorrections, _calculateType1METCorrection;
26  str _jecTag, _jetType, _uncertType;
27  int _upToLevel;
28  // std::map<str, float> _type1METParams;
29  FactorizedJetCorrector* _JetCorrector;
30  float _correction;
31  float _uncertainty;
32  JetCorrectorParameters _L1JetPar, _L2JetPar, _L3JetPar, _ResJetPar;
33  JetCorrectionUncertainty* _JetUncertainty;
34  JESpaths _paths;
35 
36  public:
51  JetRecalibrator( str jecTag, str jetType, bool doResidualJECs,
52  str uncertType, int upToLevel=3
53  // bool calculateSeparateCorrections=false,
54  // bool calculateType1METCorrection=false,
55  // std::map<str, float> type1METParams = {
56  // {'jetPtThreshold', 15.},
57  // {'skipEMfractionThreshold', 0.9},
58  // {'skipMuons', 1} // True
59  // }
60  );
61  ~JetRecalibrator();
70  template <class T>
71  void CalculateCorrection(T jet, float fixedGridRhoFastjetAll){
72  _JetCorrector->setJetPhi(jet.phi);
73  _JetCorrector->setJetEta(jet.eta);
74  _JetCorrector->setJetPt(jet.pt * (1. - jet.rawFactor));
75  _JetCorrector->setJetA(jet.area);
76  _JetCorrector->setRho(fixedGridRhoFastjetAll);
77  _correction = _JetCorrector->getCorrection() * (1. - jet.rawFactor);
78  };
87  template <class T>
88  void CalculateUncertainty(T jet, float delta = 1){
89  if (delta != 0) {
90  _JetUncertainty->setJetPhi(jet.phi);
91  _JetUncertainty->setJetEta(jet.eta);
92  _JetUncertainty->setJetPt(_correction * jet.pt);
93  _uncertainty = delta*_JetUncertainty->getUncertainty(true);
94 
95  } else {
96  _uncertainty = 0;
97  }
98  };
105  float GetCorrection() {return _correction;};
112  float GetUncertainty() {return _uncertainty;};
113 };
114 #endif
void CalculateUncertainty(T jet, float delta=1)
Calculate the correction uncertainty for a given jet and store the value internally. WARNING: CalculateCorrection must be run first.
Definition: JetRecalibrator.h:88
-
C++ class to handle the extraction of JES objects (aka JEC) starting from the JEC tags and jet types...
Definition: JME_common.h:57
-
JetRecalibrator()
Construct a new Jet Recalibrator object.
Definition: JetRecalibrator.cc:3
-
float GetCorrection()
Return the internally stored correction value that was calculated during CalculateCorrection.
Definition: JetRecalibrator.h:105
-
C++ class to recalibrate the of jets. Initialized with basic parameters and calculations done on vec...
Definition: JetRecalibrator.h:23
-
void CalculateCorrection(T jet, float fixedGridRhoFastjetAll)
Calculate the correction for a given jet and rho and store the value internally.
Definition: JetRecalibrator.h:71
-
float GetUncertainty()
Return the internally stored uncertainty value that was calculated during CalculateUncertainty.
Definition: JetRecalibrator.h:112
+
1 #ifndef _TIMBER_JETRECALIBRATOR
+
2 #define _TIMBER_JETRECALIBRATOR
+
3 #include <string>
+
4 #include <map>
+
5 #include <vector>
+
6 #include <algorithm>
+
7 // #include <boost/filesystem.hpp>
+
8 #include "Collection.h"
+
9 #include "JME_common.h"
+
10 #include <ROOT/RVec.hxx>
+
11 #include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h"
+
12 #include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"
+
13 #include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h"
+
14 
+
15 typedef std::string str;
+
16 typedef ROOT::VecOps::RVec<float> rvec_f;
+
17 typedef std::vector<JetCorrectorParameters> vJCP;
+ +
24  private:
+
25  bool _doResidualJECs;//, _calculateSeparateCorrections, _calculateType1METCorrection;
+
26  str _jecTag, _jetType, _uncertType;
+
27  int _upToLevel;
+
28  // std::map<str, float> _type1METParams;
+
29  FactorizedJetCorrector* _JetCorrector;
+
30  float _correction;
+
31  float _uncertainty;
+
32  JetCorrectorParameters _L1JetPar, _L2JetPar, _L3JetPar, _ResJetPar;
+
33  JetCorrectionUncertainty* _JetUncertainty;
+
34  JESpaths _paths;
+
35 
+
36  public:
+ +
51  JetRecalibrator( str jecTag, str jetType, bool doResidualJECs,
+
52  str uncertType, int upToLevel=3
+
53  // bool calculateSeparateCorrections=false,
+
54  // bool calculateType1METCorrection=false,
+
55  // std::map<str, float> type1METParams = {
+
56  // {'jetPtThreshold', 15.},
+
57  // {'skipEMfractionThreshold', 0.9},
+
58  // {'skipMuons', 1} // True
+
59  // }
+
60  );
+
61  ~JetRecalibrator();
+
70  template <class T>
+
71  void CalculateCorrection(T jet, float fixedGridRhoFastjetAll){
+
72  _JetCorrector->setJetPhi(jet.phi);
+
73  _JetCorrector->setJetEta(jet.eta);
+
74  _JetCorrector->setJetPt(jet.pt * (1. - jet.rawFactor));
+
75  _JetCorrector->setJetA(jet.area);
+
76  _JetCorrector->setRho(fixedGridRhoFastjetAll);
+
77  _correction = _JetCorrector->getCorrection() * (1. - jet.rawFactor);
+
78  };
+
87  template <class T>
+
88  void CalculateUncertainty(T jet, float delta = 1){
+
89  if (delta != 0) {
+
90  _JetUncertainty->setJetPhi(jet.phi);
+
91  _JetUncertainty->setJetEta(jet.eta);
+
92  _JetUncertainty->setJetPt(_correction * jet.pt);
+
93  _uncertainty = delta*_JetUncertainty->getUncertainty(true);
+
94 
+
95  } else {
+
96  _uncertainty = 0;
+
97  }
+
98  };
+
105  float GetCorrection() {return _correction;};
+
112  float GetUncertainty() {return _uncertainty;};
+
113 };
+
114 #endif
+
void CalculateUncertainty(T jet, float delta=1)
Calculate the correction uncertainty for a given jet and store the value internally....
Definition: JetRecalibrator.h:88
+
C++ class to handle the extraction of JES objects (aka JEC) starting from the JEC tags and jet types.
Definition: JME_common.h:57
+
JetRecalibrator()
Construct a new Jet Recalibrator object.
Definition: JetRecalibrator.cc:3
+
C++ class to recalibrate the of jets. Initialized with basic parameters and calculations done on vec...
Definition: JetRecalibrator.h:23
+
float GetCorrection()
Return the internally stored correction value that was calculated during CalculateCorrection.
Definition: JetRecalibrator.h:105
+
void CalculateCorrection(T jet, float fixedGridRhoFastjetAll)
Calculate the correction for a given jet and rho and store the value internally.
Definition: JetRecalibrator.h:71
+
float GetUncertainty()
Return the internally stored uncertainty value that was calculated during CalculateUncertainty.
Definition: JetRecalibrator.h:112
diff --git a/docs/_jet_smearer_8h_source.html b/docs/_jet_smearer_8h_source.html index 131dbf4..16cfb54 100644 --- a/docs/_jet_smearer_8h_source.html +++ b/docs/_jet_smearer_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/JetSmearer.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
JetSmearer.h
-
1 #ifndef _TIMBER_JETSMEARER
2 #define _TIMBER_JETSMEARER
3 // Requires CMSSW
4 #include <string>
5 #include <vector>
6 #include <cstdlib>
7 #include <unistd.h>
8 #include <math.h>
9 #include <limits>
10 #include <random>
11 
12 #include <TRandom3.h>
13 #include <TFile.h>
14 #include <TF1.h>
15 #include <TString.h>
16 #include <TSystem.h>
17 #include <ROOT/RVec.hxx>
18 #include <Math/GenVector/LorentzVector.h>
19 #include <Math/GenVector/PtEtaPhiM4D.h>
20 #include <Math/Vector4Dfwd.h>
21 #include "JME_common.h"
22 #include "common.h"
23 
24 using namespace ROOT::VecOps;
25 using LorentzV = ROOT::Math::PtEtaPhiMVector;
26 
33  private:
34  float _dRMax, _dPtMaxFactor;
35 
36  public:
45  GenJetMatcher(float dRMax, float dPtMaxFactor = 3);
54  LorentzV match(LorentzV& jet, RVec<LorentzV> genJets, float resolution);
55 };
56 
62 class JetSmearer {
63  private:
64  const std::string _jetType, _jerTag;
65  const std::vector<float> _jmrVals;
66 
67  std::mt19937 _rnd;
68  JERpaths _path;
69  JME::JetParameters _paramsSF;
70  JME::JetParameters _paramsRes;
71  JME::JetResolution _jer;
72  JME::JetResolutionScaleFactor _jerSF;
73 
74  std::vector<Variation> _variationIndex;
75 
76  std::shared_ptr<GenJetMatcher> _genJetMatcher;
77  static constexpr const double MIN_JET_ENERGY = 1e-2;
78 
79  TF1* _puppisd_res_central;
80  TF1* _puppisd_res_forward;
81 
82  public:
90  JetSmearer( std::string jerTag, std::string jetType);
98  JetSmearer(std::vector<float> jmrVals);
99 
100  ~JetSmearer();
120  std::vector<float> GetSmearValsPt(LorentzV jet, RVec<LorentzV> genJets, float fixedGridRhoFastjetAll);
141  std::vector<float> GetSmearValsM(LorentzV jet, RVec<LorentzV> genJets);
147  TFile* GetPuppiJMRFile();
153  TF1* GetPuppiSDResolutionCentral();
159  TF1* GetPuppiSDResolutionForward();
160 };
161 #endif
-
C++ class to handle the extraction of JER objects starting from the JER tags and jet types...
Definition: JME_common.h:96
-
C++ class to handle the smearing of jet pt and mass using the JER and JMR inputs, respectively...
Definition: JetSmearer.h:62
-
C++ class to match single reconstructed jet (represented as a Lorentz vector) to the closest generato...
Definition: JetSmearer.h:32
+
1 #ifndef _TIMBER_JETSMEARER
+
2 #define _TIMBER_JETSMEARER
+
3 // Requires CMSSW
+
4 #include <string>
+
5 #include <vector>
+
6 #include <cstdlib>
+
7 #include <unistd.h>
+
8 #include <math.h>
+
9 #include <limits>
+
10 #include <random>
+
11 
+
12 #include <TRandom3.h>
+
13 #include <TFile.h>
+
14 #include <TF1.h>
+
15 #include <TString.h>
+
16 #include <TSystem.h>
+
17 #include <ROOT/RVec.hxx>
+
18 #include <Math/GenVector/LorentzVector.h>
+
19 #include <Math/GenVector/PtEtaPhiM4D.h>
+
20 #include <Math/Vector4Dfwd.h>
+
21 #include "JME_common.h"
+
22 #include "common.h"
+
23 
+
24 using namespace ROOT::VecOps;
+
25 using LorentzV = ROOT::Math::PtEtaPhiMVector;
+
26 
+ +
33  private:
+
34  float _dRMax, _dPtMaxFactor;
+
35 
+
36  public:
+
45  GenJetMatcher(float dRMax, float dPtMaxFactor = 3);
+
54  LorentzV match(LorentzV& jet, RVec<LorentzV> genJets, float resolution);
+
55 };
+
56 
+
62 class JetSmearer {
+
63  private:
+
64  const std::string _jetType, _jerTag;
+
65  const std::vector<float> _jmrVals;
+
66 
+
67  std::mt19937 _rnd;
+
68  JERpaths _path;
+
69  JME::JetParameters _paramsSF;
+
70  JME::JetParameters _paramsRes;
+
71  JME::JetResolution _jer;
+
72  JME::JetResolutionScaleFactor _jerSF;
+
73 
+
74  std::vector<Variation> _variationIndex;
+
75 
+
76  std::shared_ptr<GenJetMatcher> _genJetMatcher;
+
77  static constexpr const double MIN_JET_ENERGY = 1e-2;
+
78 
+
79  TF1* _puppisd_res_central;
+
80  TF1* _puppisd_res_forward;
+
81 
+
82  public:
+
90  JetSmearer( std::string jerTag, std::string jetType);
+
98  JetSmearer(std::vector<float> jmrVals);
+
99 
+
100  ~JetSmearer();
+
120  std::vector<float> GetSmearValsPt(LorentzV jet, RVec<LorentzV> genJets, float fixedGridRhoFastjetAll);
+
141  std::vector<float> GetSmearValsM(LorentzV jet, RVec<LorentzV> genJets);
+
147  TFile* GetPuppiJMRFile();
+
153  TF1* GetPuppiSDResolutionCentral();
+
159  TF1* GetPuppiSDResolutionForward();
+
160 };
+
161 #endif
+
C++ class to match single reconstructed jet (represented as a Lorentz vector) to the closest generato...
Definition: JetSmearer.h:32
+
C++ class to handle the smearing of jet pt and mass using the JER and JMR inputs, respectively.
Definition: JetSmearer.h:62
+
C++ class to handle the extraction of JER objects starting from the JER tags and jet types.
Definition: JME_common.h:96
diff --git a/docs/_lumi_filter_8h_source.html b/docs/_lumi_filter_8h_source.html index 919fe8d..1014978 100644 --- a/docs/_lumi_filter_8h_source.html +++ b/docs/_lumi_filter_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/LumiFilter.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
LumiFilter.h
-
1 #ifndef _TIMBER_LUMIFILTER
2 #define _TIMBER_LUMIFILTER
3 #include <boost/property_tree/ptree.hpp>
4 #include <boost/property_tree/json_parser.hpp>
5 #include <vector>
6 #include <string>
7 #include <algorithm>
8 #include <iostream>
9 
15 class LumiFilter {
16  private:
17  boost::property_tree::ptree ptree;
18  unsigned int lumStart;
19  unsigned int lumEnd;
20 
21  public:
27  LumiFilter(std::string filename);
34  LumiFilter(int year);
35  ~LumiFilter();
44  bool eval(unsigned int run, unsigned int lumi);
45 };
46 
47 
48 #endif
bool eval(unsigned int run, unsigned int lumi)
Evaluate whether the given run and lumi pass the luminosity JSON filter.
Definition: LumiFilter.cc:21
-
LumiFilter(std::string filename)
Construct a new Lumi Filter object with a custom json file name.
Definition: LumiFilter.cc:3
-
C++ class. Tool to filter luminosity block/run based on golden JSONs. Golden JSONs are provided in TI...
Definition: LumiFilter.h:15
+
1 #ifndef _TIMBER_LUMIFILTER
+
2 #define _TIMBER_LUMIFILTER
+
3 #include <boost/property_tree/ptree.hpp>
+
4 #include <boost/property_tree/json_parser.hpp>
+
5 #include <vector>
+
6 #include <string>
+
7 #include <algorithm>
+
8 #include <iostream>
+
9 
+
15 class LumiFilter {
+
16  private:
+
17  boost::property_tree::ptree ptree;
+
18  unsigned int lumStart;
+
19  unsigned int lumEnd;
+
20 
+
21  public:
+
27  LumiFilter(std::string filename);
+
34  LumiFilter(int year);
+
35  ~LumiFilter();
+
44  bool eval(unsigned int run, unsigned int lumi);
+
45 };
+
46 
+
47 
+
48 #endif
+
LumiFilter(std::string filename)
Construct a new Lumi Filter object with a custom json file name.
Definition: LumiFilter.cc:3
+
bool eval(unsigned int run, unsigned int lumi)
Evaluate whether the given run and lumi pass the luminosity JSON filter.
Definition: LumiFilter.cc:23
+
C++ class. Tool to filter luminosity block/run based on golden JSONs. Golden JSONs are provided in TI...
Definition: LumiFilter.h:15
diff --git a/docs/_p_d_fweight__uncert_8h_source.html b/docs/_p_d_fweight__uncert_8h_source.html index 2c588e3..c875cfc 100644 --- a/docs/_p_d_fweight__uncert_8h_source.html +++ b/docs/_p_d_fweight__uncert_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/PDFweight_uncert.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
PDFweight_uncert.h
-
1 #ifndef _TIMBER_PDFWEIGHT_UNCERT
2 #define _TIMBER_PDFWEIGHT_UNCERT
3 #include <cmath>
4 #include <vector>
5 #include <numeric>
6 #include <fstream>
7 #include "ROOT/RVec.hxx"
8 #include "common.h"
9 
10 using namespace ROOT::VecOps;
11 
19  private:
20  bool hessian;
21  bool ignoreEmpty;
22  int lhaid;
23  public:
32  PDFweight_uncert(int lhaID, bool ignoreEmptyBranch = false);
40  std::vector<float> eval(RVec<float> LHEPdfWeight);
41 };
42 #endif
C++ class. PDF weight uncertainty lookup class.
Definition: PDFweight_uncert.h:18
- +
1 #ifndef _TIMBER_PDFWEIGHT_UNCERT
+
2 #define _TIMBER_PDFWEIGHT_UNCERT
+
3 #include <cmath>
+
4 #include <vector>
+
5 #include <numeric>
+
6 #include <fstream>
+
7 #include "ROOT/RVec.hxx"
+
8 #include "common.h"
+
9 
+
10 using namespace ROOT::VecOps;
+
11 
+ +
19  private:
+
20  bool hessian;
+
21  bool ignoreEmpty;
+
22  int lhaid;
+
23  public:
+
32  PDFweight_uncert(int lhaID, bool ignoreEmptyBranch = false);
+ +
40  std::vector<float> eval(RVec<float> LHEPdfWeight);
+
41 };
+
42 #endif
+
C++ class. PDF weight uncertainty lookup class.
Definition: PDFweight_uncert.h:18
diff --git a/docs/_pileup__weight_8h_source.html b/docs/_pileup__weight_8h_source.html index a6f3ce1..909cea0 100644 --- a/docs/_pileup__weight_8h_source.html +++ b/docs/_pileup__weight_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/Pileup_weight.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
Pileup_weight.h
-
1 #ifndef _TIMBER_PILEUP_WEIGHT
2 #define _TIMBER_PILEUP_WEIGHT
3 #include <iostream>
4 #include <TFile.h>
5 #include <TH1.h>
6 #include <TROOT.h>
7 #include <TTree.h>
8 #include "common.h"
9 #include "../ext/WeightCalculatorFromHistogram.h"
10 
15  private:
16  TFile *_dataFile, *_mcFile;
17  TH1 *_dataHist, *_dataHistUp, *_dataHistDown,
18  *_mcHist, *_mcHistUp, *_mcHistDown;
19  WeightCalculatorFromHistogram _worker, _worker_plus, _worker_minus;
20  bool _autoPU;
21 
22  void init(std::string filename_mc, std::string filename_data,
23  std::string histname_mc, std::string histname_data);
24 
25  public:
35  Pileup_weight(std::string filename_mc, std::string filename_data,
36  std::string histname_mc, std::string histname_data);
44  Pileup_weight(std::string era);
51  std::vector<float> eval(int Pileup_nTrueInt);
52  ~Pileup_weight(){};
53 };
54 #endif
Pileup_weight(std::string filename_mc, std::string filename_data, std::string histname_mc, std::string histname_data)
Construct a new Pileup_weight object, providing custom MC and data histograms to take the ratio of th...
Definition: Pileup_weight.cc:3
-
std::vector< float > eval(int Pileup_nTrueInt)
Evaluate the pileup weight (value of ratio of data to simulation).
Definition: Pileup_weight.cc:37
-
Definition: WeightCalculatorFromHistogram.h:11
-
C++ class to handle pileup reweighting. Used in AutoPU.py.
Definition: Pileup_weight.h:14
+
1 #ifndef _TIMBER_PILEUP_WEIGHT
+
2 #define _TIMBER_PILEUP_WEIGHT
+
3 #include <iostream>
+
4 #include <TFile.h>
+
5 #include <TH1.h>
+
6 #include <TROOT.h>
+
7 #include <TTree.h>
+
8 #include "common.h"
+
9 #include "../ext/WeightCalculatorFromHistogram.h"
+
10 
+ +
15  private:
+
16  TFile *_dataFile, *_mcFile;
+
17  TH1 *_dataHist, *_dataHistUp, *_dataHistDown,
+
18  *_mcHist, *_mcHistUp, *_mcHistDown;
+
19  WeightCalculatorFromHistogram _worker, _worker_plus, _worker_minus;
+
20  bool _autoPU;
+
21 
+
22  void init(std::string filename_mc, std::string filename_data,
+
23  std::string histname_mc, std::string histname_data);
+
24 
+
25  public:
+
35  Pileup_weight(std::string filename_mc, std::string filename_data,
+
36  std::string histname_mc, std::string histname_data);
+
44  Pileup_weight(std::string era);
+
51  std::vector<float> eval(int Pileup_nTrueInt);
+
52  ~Pileup_weight(){};
+
53 };
+
54 #endif
+
Definition: WeightCalculatorFromHistogram.h:11
+
Pileup_weight(std::string filename_mc, std::string filename_data, std::string histname_mc, std::string histname_data)
Construct a new Pileup_weight object, providing custom MC and data histograms to take the ratio of th...
Definition: Pileup_weight.cc:3
+
std::vector< float > eval(int Pileup_nTrueInt)
Evaluate the pileup weight (value of ratio of data to simulation).
Definition: Pileup_weight.cc:37
+
C++ class to handle pileup reweighting. Used in AutoPU.py.
Definition: Pileup_weight.h:14
diff --git a/docs/_prefire__weight_8h_source.html b/docs/_prefire__weight_8h_source.html index 7fbebfb..fd4455f 100644 --- a/docs/_prefire__weight_8h_source.html +++ b/docs/_prefire__weight_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/Prefire_weight.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
Prefire_weight.h
-
1 #ifndef _TIMBER_PREFIRE_WEIGHT
2 #define _TIMBER_PREFIRE_WEIGHT
3 #include "TFile.h"
4 #include "TH2F.h"
5 #include <ROOT/RVec.hxx>
6 #include <string>
7 #include <algorithm>
8 #include <math.h>
9 #include "common.h"
10 
16  private:
17  std::string _jetmapname, _photonmapname;
18  TFile *_jetroot, *_photonroot;
19  TH2F *_jetmap, *_photonmap;
20  std::pair<float,float> _jetPtRange, _jetEtaRange, _photonPtRange, _photonEtaRange;
21  std::vector<std::pair<int, std::string>> _variations = {{0,"PrefireWeight"},{1,"PrefireWeight_Up"},{-1,"PrefireWeight_Down"}};
22  int _variation;
23 
24  template <class Photon, class Electron>
25  float EGvalue(int jetidx, std::vector<Photon> PhoColl, std::vector<Electron> EleColl) {
26  float phopf = 1.0;
27  float phopf_temp, elepf_temp;
28  std::vector<int> PhotonInJet;
29  Photon *pho;
30  for (size_t pid = 0; pid < PhoColl.size(); pid++) {
31  pho = &PhoColl[pid];
32  if (pho->jetIdx == jetidx) {
33  if (PhotonInRange(pho->pt,pho->eta)) {
34  phopf_temp = 1 - GetPrefireProbability(_photonmap, pho->eta, pho->pt, _photonPtRange.second);
35  elepf_temp = 1.0;
36  if (pho->electronIdx > -1) {
37  Electron *matchEle = &EleColl[pho->electronIdx];
38  if (PhotonInRange(matchEle->pt,matchEle->eta)) {
39  elepf_temp = 1 - GetPrefireProbability(_photonmap,matchEle->eta,matchEle->pt,_photonPtRange.second);
40  }
41  }
42  phopf *= std::min(phopf_temp,elepf_temp);
43  PhotonInJet.push_back(pid);
44  }
45  }
46  }
47  Electron *ele;
48  for (size_t eid = 0; eid < EleColl.size(); eid++){
49  ele = &EleColl[eid];
50  if ((ele->jetIdx == jetidx) && (Pythonic::InList(ele->photonIdx, PhotonInJet) == -1)) {
51  if (PhotonInRange(ele->pt, ele->eta)) {
52  phopf *= 1 - GetPrefireProbability(_photonmap, ele->eta, ele->pt, _photonPtRange.second);
53  }
54  }
55  }
56  return phopf;
57  }
58 
59  float GetPrefireProbability(TH2F* map, float eta, float pt, float maxpt);
60  bool PhotonInRange(float pt, float eta);
61  bool JetInRange(float pt, float eta);
62  bool ObjInRange(float pt, float eta, std::pair<float,float> ptRange, std::pair<float,float> etaRange);
63 
64 
65  public:
72  Prefire_weight(int year, bool UseEMpt=false);
73  ~Prefire_weight();
85  template <class Jet, class Photon, class Electron>
86  ROOT::VecOps::RVec<float> eval(std::vector<Jet> Jets, std::vector<Photon> Photons, std::vector<Electron> Electrons) {
87  Jet *jet;
88  float weight, jetpf, phopf;
89  std::string branchname;
90  ROOT::VecOps::RVec<float> out(3);
91  for (size_t i = 0; i<_variations.size(); i++){
92  _variation = _variations[i].first;
93  branchname = _variations[i].second;
94  weight = 1.0;
95  for (size_t ijet = 0; ijet<Jets.size(); ijet++) {
96  jetpf = 1.0;
97  jet = &Jets[ijet];
98 
99  if (JetInRange(jet->pt,jet->eta)) {
100  jetpf *= 1 - GetPrefireProbability(_jetmap, jet->eta, jet->pt, _jetPtRange.second);
101  }
102  phopf = EGvalue(ijet, Photons, Electrons);
103  weight *= std::min(jetpf, phopf);
104  }
105  weight *= EGvalue(-1, Photons, Electrons);
106  out[i] = weight;
107  }
108  return out;
109  }
110 };
111 #endif
C++ class to handle the trigger prefire weighting. Based off of the equivalent NanoAOD-tools module...
Definition: Prefire_weight.h:15
-
Prefire_weight(int year, bool UseEMpt=false)
Construct a new Prefire_weight object.
Definition: Prefire_weight.cc:3
-
ROOT::VecOps::RVec< float > eval(std::vector< Jet > Jets, std::vector< Photon > Photons, std::vector< Electron > Electrons)
Calculate the value of the weight.
Definition: Prefire_weight.h:86
+
1 #ifndef _TIMBER_PREFIRE_WEIGHT
+
2 #define _TIMBER_PREFIRE_WEIGHT
+
3 #include "TFile.h"
+
4 #include "TH2F.h"
+
5 #include <ROOT/RVec.hxx>
+
6 #include <string>
+
7 #include <algorithm>
+
8 #include <math.h>
+
9 #include "common.h"
+
10 
+ +
16  private:
+
17  std::string _jetmapname, _photonmapname;
+
18  TFile *_jetroot, *_photonroot;
+
19  TH2F *_jetmap, *_photonmap;
+
20  std::pair<float,float> _jetPtRange, _jetEtaRange, _photonPtRange, _photonEtaRange;
+
21  std::vector<std::pair<int, std::string>> _variations = {{0,"PrefireWeight"},{1,"PrefireWeight_Up"},{-1,"PrefireWeight_Down"}};
+
22  int _variation;
+
23 
+
24  float EGvalue(int jetidx, RVec<float> Photon_pt, RVec<float> Photon_eta, RVec<int> Photon_jetIdx, RVec<int> Photon_electronIdx,
+
25  RVec<float> Electron_pt, RVec<float> Electron_eta, RVec<int> Electron_jetIdx, RVec<int> Electron_photonIdx);
+
26 
+
27  float GetPrefireProbability(TH2F* map, float eta, float pt, float maxpt);
+
28  bool PhotonInRange(float pt, float eta);
+
29  bool JetInRange(float pt, float eta);
+
30  bool ObjInRange(float pt, float eta, std::pair<float,float> ptRange, std::pair<float,float> etaRange);
+
31 
+
32  public:
+
39  Prefire_weight(int year, bool UseEMpt=false);
+
40  ~Prefire_weight();
+
56  ROOT::VecOps::RVec<float> eval(RVec<float> Jet_pt, RVec<float> Jet_eta,
+
57  RVec<float> Photon_pt, RVec<float> Photon_eta, RVec<int> Photon_jetIdx, RVec<int> Photon_electronIdx,
+
58  RVec<float> Electron_pt, RVec<float> Electron_eta, RVec<int> Electron_jetIdx, RVec<int> Electron_photonIdx);
+
59 };
+
60 #endif
+
ROOT::VecOps::RVec< float > eval(RVec< float > Jet_pt, RVec< float > Jet_eta, RVec< float > Photon_pt, RVec< float > Photon_eta, RVec< int > Photon_jetIdx, RVec< int > Photon_electronIdx, RVec< float > Electron_pt, RVec< float > Electron_eta, RVec< int > Electron_jetIdx, RVec< int > Electron_photonIdx)
Calculate the value of the weight.
Definition: Prefire_weight.cc:91
+
C++ class to handle the trigger prefire weighting. Based off of the equivalent NanoAOD-tools module.
Definition: Prefire_weight.h:15
+
Prefire_weight(int year, bool UseEMpt=false)
Construct a new Prefire_weight object.
Definition: Prefire_weight.cc:3
diff --git a/docs/_s_j_btag___s_f_8h_source.html b/docs/_s_j_btag___s_f_8h_source.html index cf5f9b4..3d937e9 100644 --- a/docs/_s_j_btag___s_f_8h_source.html +++ b/docs/_s_j_btag___s_f_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/SJBtag_SF.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
SJBtag_SF.h
-
1 #ifndef _TIMBER_SJBTAG_SF
2 #define _TIMBER_SJBTAG_SF
3 // without CMSSW / standalone:
4 #include "../ext/BTagCalibrationStandalone.h"
5 #include <ROOT/RVec.hxx>
6 
7 using namespace ROOT::VecOps;
8 
13 class SJBtag_SF {
14  private:
15  std::string csv_file;
16  BTagEntry::OperatingPoint operating_point;
17  BTagCalibration calib;
18  BTagCalibrationReader reader;
19 
20  public:
28  SJBtag_SF(int year, std::string tagger, std::string op_string);
29  ~SJBtag_SF(){};
37  RVec<float> eval(float pt, float eta);
38 };
39 #endif
Definition: BTagCalibrationStandalone.h:153
- -
C++ class. Subjet b tagging scale factor lookup.
Definition: SJBtag_SF.h:13
-
Definition: BTagCalibrationStandalone.h:108
+
1 #ifndef _TIMBER_SJBTAG_SF
+
2 #define _TIMBER_SJBTAG_SF
+
3 // without CMSSW / standalone:
+
4 #include "../ext/BTagCalibrationStandalone.h"
+
5 #include <ROOT/RVec.hxx>
+
6 
+
7 using namespace ROOT::VecOps;
+
8 
+
13 class SJBtag_SF {
+
14  private:
+
15  std::string csv_file;
+
16  BTagEntry::OperatingPoint operating_point;
+
17  BTagCalibration calib;
+
18  BTagCalibrationReader reader;
+
19 
+
20  public:
+
28  SJBtag_SF(int year, std::string tagger, std::string op_string);
+
29  ~SJBtag_SF(){};
+
37  RVec<float> eval(float pt, float eta);
+
38 };
+
39 #endif
+
Definition: BTagCalibrationStandalone.h:153
+
C++ class. Subjet b tagging scale factor lookup.
Definition: SJBtag_SF.h:13
+
Definition: BTagCalibrationStandalone.h:108
diff --git a/docs/_top_pt__weight_8h_source.html b/docs/_top_pt__weight_8h_source.html index ee6cb7f..e6182fd 100644 --- a/docs/_top_pt__weight_8h_source.html +++ b/docs/_top_pt__weight_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/TopPt_weight.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
TopPt_weight.h
-
1 #ifndef _TIMBER_TOPPT_WEIGHT
2 #define _TIMBER_TOPPT_WEIGHT
3 #include "common.h"
4 #include <cmath>
5 #include <stdbool.h>
6 #include <ctime>
7 #include <vector>
8 #include <stdio.h>
9 
10 using namespace ROOT::VecOps;
11 
23 class TopPt_weight {
24  private:
25  std::vector<float> matchingGenPt(RVec<int> GenPart_pdgId, RVec<int> GenPart_statusFlags, RVec<ROOT::Math::PtEtaPhiMVector> GenPart_vect,
26  ROOT::Math::PtEtaPhiMVector jet0, ROOT::Math::PtEtaPhiMVector jet1);
27 
28  public:
33  TopPt_weight();
34  ~TopPt_weight(){};
51  RVec<float> eval(
52  RVec<int> GenPart_pdgId, RVec<int> GenPart_statusFlags, RVec<ROOT::Math::PtEtaPhiMVector> GenPart_vect,
53  ROOT::Math::PtEtaPhiMVector jet0, ROOT::Math::PtEtaPhiMVector jet1, float scale = 0.5);
54 };
55 #endif
C++ class. Handles the top reweighting value for simulation based on doing gen particle matching...
Definition: TopPt_weight.h:23
- +
1 #ifndef _TIMBER_TOPPT_WEIGHT
+
2 #define _TIMBER_TOPPT_WEIGHT
+
3 #include "common.h"
+
4 #include <cmath>
+
5 #include <stdbool.h>
+
6 #include <ctime>
+
7 #include <vector>
+
8 #include <stdio.h>
+
9 
+
10 using namespace ROOT::VecOps;
+
11 
+
23 class TopPt_weight {
+
24  private:
+
25  std::vector<float> matchingGenPt(RVec<int> GenPart_pdgId, RVec<int> GenPart_statusFlags, RVec<ROOT::Math::PtEtaPhiMVector> GenPart_vect,
+
26  ROOT::Math::PtEtaPhiMVector jet0, ROOT::Math::PtEtaPhiMVector jet1);
+
27 
+
28  public:
+
33  TopPt_weight();
+
34  ~TopPt_weight(){};
+
51  RVec<float> eval(
+
52  RVec<int> GenPart_pdgId, RVec<int> GenPart_statusFlags, RVec<ROOT::Math::PtEtaPhiMVector> GenPart_vect,
+
53  ROOT::Math::PtEtaPhiMVector jet0, ROOT::Math::PtEtaPhiMVector jet1, float scale = 0.5);
+
54 };
+
55 #endif
+
C++ class. Handles the top reweighting value for simulation based on doing gen particle matching....
Definition: TopPt_weight.h:23
diff --git a/docs/_top_tag___s_f_8h_source.html b/docs/_top_tag___s_f_8h_source.html index a6e0cac..59b84f6 100644 --- a/docs/_top_tag___s_f_8h_source.html +++ b/docs/_top_tag___s_f_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/TopTag_SF.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
TopTag_SF.h
-
1 #ifndef _TIMBER_TOPTAG_SF
2 #define _TIMBER_TOPTAG_SF
3 #include <string>
4 #include <TFile.h>
5 #include <TH1F.h>
6 #include <TString.h>
7 #include <Math/Vector4Dfwd.h>
8 #include <Math/GenVector/LorentzVector.h>
9 #include <Math/GenVector/PtEtaPhiM4D.h>
10 #include "GenMatching.h"
11 using LVector = ROOT::Math::PtEtaPhiMVector;
12 
17 class TopTag_SF {
18  private:
19  std::string workpoint_name;
20  int _year;
21  std::map<int, std::map<std::string, TH1F*>> _hists;
22  TFile *_file;
23 
24  public:
32  TopTag_SF(int year, int workpoint, bool NoMassCut=false);
33  ~TopTag_SF(){};
45  int NMerged(LVector top_vect, RVec<Particle*> Ws,
46  RVec<Particle*> quarks, GenParticleTree GPT);
56  template <class T>
57  RVec<double> eval(LVector top_vect, std::vector<T> GenParts){
58  GenParticleTree GPT(GenParts.size());
59  // prongs are final particles we'll check
60  RVec<Particle*> Ws, quarks;
61  int this_pdgId;
62 
63  for (size_t i = 0; i < GenParts.size(); i++) {
64  Particle* this_particle = GPT.AddParticle(Particle(i,GenParts[i])); // add particle to tree
65  this_pdgId = this_particle->pdgId;
66  if (abs(this_pdgId) == 24) {
67  Ws.push_back(this_particle);
68  } else if (abs(this_pdgId) >= 1 && abs(this_pdgId) <= 5) {
69  quarks.push_back(this_particle);
70  }
71  }
72  int nMergedProngs = NMerged(top_vect, Ws, quarks, GPT);
73  std::vector<double> sfs(3);
74  if (nMergedProngs > 0){
75  if (top_vect.Pt() > 5000) {
76  sfs = {_hists[nMergedProngs]["nom"]->GetBinContent(_hists[nMergedProngs]["nom"]->GetNbinsX()),
77  _hists[nMergedProngs]["up"]->GetBinContent(_hists[nMergedProngs]["up"]->GetNbinsX()),
78  _hists[nMergedProngs]["down"]->GetBinContent(_hists[nMergedProngs]["down"]->GetNbinsX())
79  };
80  } else {
81  sfs = {_hists[nMergedProngs]["nom"]->GetBinContent(_hists[nMergedProngs]["nom"]->FindFixBin(top_vect.Pt())),
82  _hists[nMergedProngs]["up"]->GetBinContent(_hists[nMergedProngs]["up"]->FindFixBin(top_vect.Pt())),
83  _hists[nMergedProngs]["down"]->GetBinContent(_hists[nMergedProngs]["down"]->FindFixBin(top_vect.Pt()))
84  };
85  }
86  } else {
87  sfs = {1, 1, 1};
88  }
89  return sfs;
90  }
91 };
92 #endif
int NMerged(LVector top_vect, RVec< Particle *> Ws, RVec< Particle *> quarks, GenParticleTree GPT)
Finds the number of merged generator particles in the reconstructed jet.
Definition: TopTag_SF.cc:25
-
Particle * AddParticle(Particle particle)
Add particle to tree.
Definition: GenMatching.cc:73
-
C++ class. Stores identifying features of a particle in the GenPart collection.
Definition: GenMatching.h:38
-
C++ class. Constructs tree by adding particles. Establish relationships between particles (parent...
Definition: GenMatching.h:123
-
int pdgId
Definition: GenMatching.h:47
-
RVec< double > eval(LVector top_vect, std::vector< T > GenParts)
Evaluation function based on the reconstructed top jet pt and the matched generator particles (GenPar...
Definition: TopTag_SF.h:57
-
TopTag_SF(int year, int workpoint, bool NoMassCut=false)
Construct a new TopTag_SF object.
Definition: TopTag_SF.cc:3
-
C++ class to access scale factors associated with tau32+subjet btag(+mass) based top tagging...
Definition: TopTag_SF.h:17
+
1 #ifndef _TIMBER_TOPTAG_SF
+
2 #define _TIMBER_TOPTAG_SF
+
3 #include <string>
+
4 #include <TFile.h>
+
5 #include <TH1F.h>
+
6 #include <TString.h>
+
7 #include <Math/Vector4Dfwd.h>
+
8 #include <Math/GenVector/LorentzVector.h>
+
9 #include <Math/GenVector/PtEtaPhiM4D.h>
+
10 #include "GenMatching.h"
+
11 using LVector = ROOT::Math::PtEtaPhiMVector;
+
12 
+
17 class TopTag_SF {
+
18  private:
+
19  std::string workpoint_name;
+
20  int _year;
+
21  std::map<int, std::map<std::string, TH1F*>> _hists;
+
22  TFile *_file;
+
23 
+
24  public:
+
32  TopTag_SF(int year, int workpoint, bool NoMassCut=false);
+
33  ~TopTag_SF(){};
+
45  int NMerged(LVector top_vect, RVec<Particle*> Ws,
+
46  RVec<Particle*> quarks, GenParticleTree GPT);
+
56  template <class T>
+
57  RVec<double> eval(LVector top_vect, std::vector<T> GenParts){
+
58  GenParticleTree GPT(GenParts.size());
+
59  // prongs are final particles we'll check
+
60  RVec<Particle*> Ws, quarks;
+
61  int this_pdgId;
+
62 
+
63  for (size_t i = 0; i < GenParts.size(); i++) {
+
64  Particle* this_particle = GPT.AddParticle(Particle(i,GenParts[i])); // add particle to tree
+
65  this_pdgId = this_particle->pdgId;
+
66  if (abs(this_pdgId) == 24) {
+
67  Ws.push_back(this_particle);
+
68  } else if (abs(this_pdgId) >= 1 && abs(this_pdgId) <= 5) {
+
69  quarks.push_back(this_particle);
+
70  }
+
71  }
+
72  int nMergedProngs = NMerged(top_vect, Ws, quarks, GPT);
+
73  std::vector<double> sfs(3);
+
74  if (nMergedProngs > 0){
+
75  if (top_vect.Pt() > 5000) {
+
76  sfs = {_hists[nMergedProngs]["nom"]->GetBinContent(_hists[nMergedProngs]["nom"]->GetNbinsX()),
+
77  _hists[nMergedProngs]["up"]->GetBinContent(_hists[nMergedProngs]["up"]->GetNbinsX()),
+
78  _hists[nMergedProngs]["down"]->GetBinContent(_hists[nMergedProngs]["down"]->GetNbinsX())
+
79  };
+
80  } else {
+
81  sfs = {_hists[nMergedProngs]["nom"]->GetBinContent(_hists[nMergedProngs]["nom"]->FindFixBin(top_vect.Pt())),
+
82  _hists[nMergedProngs]["up"]->GetBinContent(_hists[nMergedProngs]["up"]->FindFixBin(top_vect.Pt())),
+
83  _hists[nMergedProngs]["down"]->GetBinContent(_hists[nMergedProngs]["down"]->FindFixBin(top_vect.Pt()))
+
84  };
+
85  }
+
86  } else {
+
87  sfs = {1, 1, 1};
+
88  }
+
89  return sfs;
+
90  }
+
91 };
+
92 #endif
+
RVec< double > eval(LVector top_vect, std::vector< T > GenParts)
Evaluation function based on the reconstructed top jet pt and the matched generator particles (GenPar...
Definition: TopTag_SF.h:57
+
Particle * AddParticle(Particle particle)
Add particle to tree.
Definition: GenMatching.cc:73
+
C++ class. Stores identifying features of a particle in the GenPart collection.
Definition: GenMatching.h:38
+
C++ class to access scale factors associated with tau32+subjet btag(+mass) based top tagging....
Definition: TopTag_SF.h:17
+
int pdgId
Definition: GenMatching.h:47
+
int NMerged(LVector top_vect, RVec< Particle * > Ws, RVec< Particle * > quarks, GenParticleTree GPT)
Finds the number of merged generator particles in the reconstructed jet.
Definition: TopTag_SF.cc:25
+
TopTag_SF(int year, int workpoint, bool NoMassCut=false)
Construct a new TopTag_SF object.
Definition: TopTag_SF.cc:3
+
C++ class. Constructs tree by adding particles. Establish relationships between particles (parent,...
Definition: GenMatching.h:123
diff --git a/docs/_top_tag_d_a_k8___s_f_8h_source.html b/docs/_top_tag_d_a_k8___s_f_8h_source.html index cb30a87..8c05255 100644 --- a/docs/_top_tag_d_a_k8___s_f_8h_source.html +++ b/docs/_top_tag_d_a_k8___s_f_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/TopTagDAK8_SF.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
TopTagDAK8_SF.h
-
1 #ifndef _TIMBER_TOPTAGDAK8_SF
2 #define _TIMBER_TOPTAGDAK8_SF
3 #include "DeepAK8_helper.h"
4 
8 class TopTagDAK8_SF {
9  private:
10  DeepAK8_helper helper;
11 
12  public:
20  TopTagDAK8_SF(int year, std::string workingpoint, bool massDecorr);
21  ~TopTagDAK8_SF(){};
29  std::vector<float> eval(float pt);
30 };
31 #endif
TopTagDAK8_SF(int year, std::string workingpoint, bool massDecorr)
Construct a new TopTagDAK8_SF object.
Definition: TopTagDAK8_SF.cc:3
-
C++ class to access scale factors associated with DeepAK8 tagging.
Definition: DeepAK8_helper.h:14
-
C++ class to access scale factors associated with DeepAK8 top tagging.
Definition: TopTagDAK8_SF.h:8
-
std::vector< float > eval(float pt)
Lookup the scale factor and variations based on the AK8 jet momentum. Returned values are absolute {n...
Definition: TopTagDAK8_SF.cc:6
+
1 #ifndef _TIMBER_TOPTAGDAK8_SF
+
2 #define _TIMBER_TOPTAGDAK8_SF
+
3 #include "DeepAK8_helper.h"
+
4 
+
8 class TopTagDAK8_SF {
+
9  private:
+
10  DeepAK8_helper helper;
+
11 
+
12  public:
+
20  TopTagDAK8_SF(int year, std::string workingpoint, bool massDecorr);
+
21  ~TopTagDAK8_SF(){};
+
29  std::vector<float> eval(float pt);
+
30 };
+
31 #endif
+
C++ class to access scale factors associated with DeepAK8 tagging.
Definition: DeepAK8_helper.h:14
+
std::vector< float > eval(float pt)
Lookup the scale factor and variations based on the AK8 jet momentum. Returned values are absolute {n...
Definition: TopTagDAK8_SF.cc:6
+
C++ class to access scale factors associated with DeepAK8 top tagging.
Definition: TopTagDAK8_SF.h:8
+
TopTagDAK8_SF(int year, std::string workingpoint, bool massDecorr)
Construct a new TopTagDAK8_SF object.
Definition: TopTagDAK8_SF.cc:3
diff --git a/docs/_trigger__weight_8h_source.html b/docs/_trigger__weight_8h_source.html index 69061f2..51ba291 100644 --- a/docs/_trigger__weight_8h_source.html +++ b/docs/_trigger__weight_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/Trigger_weight.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
Trigger_weight.h
-
1 #ifndef _TIMBER_TRIGGER_WEIGHT
2 #define _TIMBER_TRIGGER_WEIGHT
3 #include <cmath>
4 #include <algorithm>
5 #include "HistLoader.h"
6 #include <ROOT/RVec.hxx>
7 using namespace ROOT::VecOps;
8 
25 {
26  private:
27  TH1 *hist;
28  HistLoader HL;
29  public:
36  Trigger_weight(std::string filename, std::string histname){
37  HistLoader HL(filename,histname);
38  TH1 *hist = HL.hist;
39  };
40  ~Trigger_weight(){};
51  RVec<float> eval(float var,float plateau = 0);
52 };
53 #endif
TH1 * hist
Histogram object.
Definition: HistLoader.h:28
-
Trigger_weight(std::string filename, std::string histname)
Construct a new Trigger_weight object.
Definition: Trigger_weight.h:36
- -
C++ class. Generic histogram loader with methods to return bin values.
Definition: HistLoader.h:13
-
C++ class. Specializes in the construction of trigger efficiency weights stored as histograms...
Definition: Trigger_weight.h:24
+
1 #ifndef _TIMBER_TRIGGER_WEIGHT
+
2 #define _TIMBER_TRIGGER_WEIGHT
+
3 #include <cmath>
+
4 #include <algorithm>
+
5 #include "HistLoader.h"
+
6 #include <ROOT/RVec.hxx>
+
7 using namespace ROOT::VecOps;
+
8 
+ +
25 {
+
26  private:
+
27  TH1 *hist;
+
28  HistLoader HL;
+
29  public:
+
36  Trigger_weight(std::string filename, std::string histname){
+
37  HistLoader HL(filename,histname);
+
38  TH1 *hist = HL.hist;
+
39  };
+
40  ~Trigger_weight(){};
+
51  RVec<float> eval(float var,float plateau = 0);
+
52 };
+
53 #endif
+
C++ class. Generic histogram loader with methods to return bin values.
Definition: HistLoader.h:13
+
TH1 * hist
Histogram object.
Definition: HistLoader.h:28
+
Trigger_weight(std::string filename, std::string histname)
Construct a new Trigger_weight object.
Definition: Trigger_weight.h:36
+
C++ class. Specializes in the construction of trigger efficiency weights stored as histograms....
Definition: Trigger_weight.h:24
diff --git a/docs/_weight_calculator_from_histogram_8h_source.html b/docs/_weight_calculator_from_histogram_8h_source.html index b4092ac..546e1ac 100644 --- a/docs/_weight_calculator_from_histogram_8h_source.html +++ b/docs/_weight_calculator_from_histogram_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/ext/WeightCalculatorFromHistogram.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
WeightCalculatorFromHistogram.h
-
1 //https://raw.githubusercontent.com/cms-nanoAOD/nanoAOD-tools/master/interface/WeightCalculatorFromHistogram.h
2 #ifndef PhysicsTools_NanoAODTools_WeightCalculatorFromHistogram_h
3 #define PhysicsTools_NanoAODTools_WeightCalculatorFromHistogram_h
4 
5 #include <iostream>
6 #include <iomanip>
7 #include <vector>
8 #include <algorithm>
9 #include <TH1.h>
10 
12  public:
14  // get the weight from the bin content of the passed histogram
15  WeightCalculatorFromHistogram(TH1 *histogram, bool verbose=false) : histogram_(histogram), verbose_(verbose) {}
16  // get the weight from the bin content of the ratio hist/targethist
17  WeightCalculatorFromHistogram(TH1 *hist, TH1* targethist, bool norm=true, bool fixLargeWeights=true, bool verbose=false);
19 
20  float getWeight(float x, float y=0) const;
21  float getWeightErr(float x, float y=0) const;
22 
23  private:
24  std::vector<float> loadVals(TH1 *hist, bool norm=true);
25  TH1* ratio(TH1 *hist, TH1* targethist, bool fixLargeWgts);
26  void fixLargeWeights(std::vector<float> &weights, float maxshift=0.0025,float hardmax=3);
27  float checkIntegral(std::vector<float> wgt1, std::vector<float> wgt2);
28 
29  TH1* histogram_;
30  std::vector<float> refvals_,targetvals_;
31  bool verbose_;
32  bool norm_;
33 };
34 
35 #endif
Definition: WeightCalculatorFromHistogram.h:11
+
1 //https://raw.githubusercontent.com/cms-nanoAOD/nanoAOD-tools/master/interface/WeightCalculatorFromHistogram.h
+
2 #ifndef PhysicsTools_NanoAODTools_WeightCalculatorFromHistogram_h
+
3 #define PhysicsTools_NanoAODTools_WeightCalculatorFromHistogram_h
+
4 
+
5 #include <iostream>
+
6 #include <iomanip>
+
7 #include <vector>
+
8 #include <algorithm>
+
9 #include <TH1.h>
+
10 
+ +
12  public:
+ +
14  // get the weight from the bin content of the passed histogram
+
15  WeightCalculatorFromHistogram(TH1 *histogram, bool verbose=false) : histogram_(histogram), verbose_(verbose) {}
+
16  // get the weight from the bin content of the ratio hist/targethist
+
17  WeightCalculatorFromHistogram(TH1 *hist, TH1* targethist, bool norm=true, bool fixLargeWeights=true, bool verbose=false);
+ +
19 
+
20  float getWeight(float x, float y=0) const;
+
21  float getWeightErr(float x, float y=0) const;
+
22 
+
23  private:
+
24  std::vector<float> loadVals(TH1 *hist, bool norm=true);
+
25  TH1* ratio(TH1 *hist, TH1* targethist, bool fixLargeWgts);
+
26  void fixLargeWeights(std::vector<float> &weights, float maxshift=0.0025,float hardmax=3);
+
27  float checkIntegral(std::vector<float> wgt1, std::vector<float> wgt2);
+
28 
+
29  TH1* histogram_;
+
30  std::vector<float> refvals_,targetvals_;
+
31  bool verbose_;
+
32  bool norm_;
+
33 };
+
34 
+
35 #endif
+
Definition: WeightCalculatorFromHistogram.h:11
diff --git a/docs/_wtag___s_f_8h_source.html b/docs/_wtag___s_f_8h_source.html index db869c5..ade373f 100644 --- a/docs/_wtag___s_f_8h_source.html +++ b/docs/_wtag___s_f_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/Wtag_SF.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
Wtag_SF.h
-
1 #ifndef _TIMBER_WTAG_SF
2 #define _TIMBER_WTAG_SF
3 #include <ROOT/RVec.hxx>
4 
9 class Wtag_SF {
10  private:
11  int _year;
12  float _HP, _HPunc, _LP, _LPunc;
13  public:
19  Wtag_SF(int year);
20  ~Wtag_SF(){};
27  ROOT::VecOps::RVec<float> eval(float tau21);
28 };
29 #endif
C++ class to access scale factors associated with tau21+mass based W tagging. More details provided a...
Definition: Wtag_SF.h:9
-
ROOT::VecOps::RVec< float > eval(float tau21)
Get the scale factor for a given tau21 value.
Definition: Wtag_SF.cc:24
-
Wtag_SF(int year)
Construct a new Wtag_SF object.
Definition: Wtag_SF.cc:3
+
1 #ifndef _TIMBER_WTAG_SF
+
2 #define _TIMBER_WTAG_SF
+
3 #include <ROOT/RVec.hxx>
+
4 
+
9 class Wtag_SF {
+
10  private:
+
11  int _year;
+
12  float _HP, _HPunc, _LP, _LPunc;
+
13  public:
+
19  Wtag_SF(int year);
+
20  ~Wtag_SF(){};
+
27  ROOT::VecOps::RVec<float> eval(float tau21);
+
28 };
+
29 #endif
+
ROOT::VecOps::RVec< float > eval(float tau21)
Get the scale factor for a given tau21 value.
Definition: Wtag_SF.cc:24
+
C++ class to access scale factors associated with tau21+mass based W tagging. More details provided a...
Definition: Wtag_SF.h:9
+
Wtag_SF(int year)
Construct a new Wtag_SF object.
Definition: Wtag_SF.cc:3
diff --git a/docs/annotated.html b/docs/annotated.html index 17d2e12..66212a3 100644 --- a/docs/annotated.html +++ b/docs/annotated.html @@ -1,9 +1,9 @@ - + - + TIMBER: All Classes @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */ @@ -74,54 +78,41 @@
Here are the classes, structs, unions and interfaces with brief descriptions:
[detail level 123]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 NTIMBER
 NAnalyzer
 CanalyzerMain class for TIMBER
 CCalibrationClass to handle calibrations produced by C++ modules
 CCorrectionClass to handle corrections produced by C++ modules
 CCutGroupStores Cut actions
 CGroupOrganizes objects in OrderedDict with basic functionality to add and drop items, add Groups together, get keys, and access items
 CHistGroupStores histograms with dedicated function to use TH1/2/3 methods in a batch
 CModuleWorkerClass to handle C++ class modules generically
 CNodeClass to represent nodes in the DataFrame processing graph
 CVarGroupStores Define actions
 NCollectionOrganizer
 CCollectionOrganizerTracks the available collections, collection attributes, and solo branches in the dataframe while processing
 CBTagCalibration
 CBTagCalibrationReader
 CBTagCalibrationReaderImpl
 CTmpEntry
 CBTagEntry
 CParameters
 CCollectionC++ structure to store maps of the various types of objects in a collection. OUTDATED BY analyzer.CreateAllCollections UChar not considered. Use by building each map as <branchName, branchValue> and then assigning to the correct struct member
 CDeepAK8_helperC++ class to access scale factors associated with DeepAK8 tagging
 CEffLoaderC++ class. Generic histogram loader with methods to return bin values
 CGenJetMatcherC++ class to match single reconstructed jet (represented as a Lorentz vector) to the closest generator jet in a vector of generator jets (represented as Lorentz vectors)
 CGenParticleTreeC++ class. Constructs tree by adding particles. Establish relationships between particles (parent, child) and allows you to search for a chain of decays
 CHEM_dropC++ class to weight events as if one were dropping any events with a jet in the effected region. Information on the HEM15/16 issue here. Note that this class is not meant to scale jet energy as described at the link. In place of energy scaling, the evaluation will return 0 or 1 for data and either 0.353 or 1 for MC (affected and unaffected, respectively). The value of 0.353 is derived from the ratio of 2018 affected by this issue (that is, 35.3% of MC should be unaffected but MC obviously does not have run or luminosity blocks)
 CHistLoaderC++ class. Generic histogram loader with methods to return bin values
 CJER_weightC++ class to handle the JER weight calculations
 CJERpathsC++ class to handle the extraction of JER objects starting from the JER tags and jet types
 CJES_weightC++ class to handle the JES/JEC weight calculations
 CJESpathsC++ class to handle the extraction of JES objects (aka JEC) starting from the JEC tags and jet types
 CJetRecalibratorC++ class to recalibrate the \(p_{T}\) of jets. Initialized with basic parameters and calculations done on vectors of jets from an event using the class methods
 CJetSmearerC++ class to handle the smearing of jet pt and mass using the JER and JMR inputs, respectively
 CJMEpathsC++ class. Parent class to handle shared attributes and methods among JESpaths and JERpaths
 CJMR_weightC++ class to directly handle JMR weights in the case of tau21 jet substructure. The values used (nominal, up, down) are:
 CJMS_weightC++ class to directly handle JMS weights in the case of tau21 jet substructure. The values used (nominal, up, down) are:
 CLumiFilterC++ class. Tool to filter luminosity block/run based on golden JSONs. Golden JSONs are provided in TIMBER but a custom one can be provided
 CParticleC++ class. Stores identifying features of a particle in the GenPart collection
 CPDFweight_uncertC++ class. PDF weight uncertainty lookup class
 CPileup_weightC++ class to handle pileup reweighting. Used in AutoPU.py
 CPrefire_weightC++ class to handle the trigger prefire weighting. Based off of the equivalent NanoAOD-tools module
 CSJBtag_SFC++ class. Subjet b tagging scale factor lookup
 CTempDirC++ class. Creates a temporary directory that is destroyed on delete
 CTopPt_weightC++ class. Handles the top \(p_T\) reweighting value for \(t\bar{t}\) simulation based on doing gen particle matching. The weight is calculated as
 CTopTag_SFC++ class to access scale factors associated with tau32+subjet btag(+mass) based top tagging. More details provided at https://twiki.cern.ch/twiki/bin/viewauth/CMS/JetTopTagging](https://twiki.cern.ch/twiki/bin/viewauth/CMS/JetTopTagging)
 CTopTagDAK8_SFC++ class to access scale factors associated with DeepAK8 top tagging
 CTrigger_weightC++ class. Specializes in the construction of trigger efficiency weights stored as histograms. Uncertainties are calculated as one half of the trigger inefficiency (ie. (1-eff)/2)
 CWeightCalculatorFromHistogram
 CWtag_SFC++ class to access scale factors associated with tau21+mass based W tagging. More details provided at https://twiki.cern.ch/twiki/bin/view/CMS/JetWtagging
 CBTagCalibration
 CBTagCalibrationReader
 CBTagCalibrationReaderImpl
 CTmpEntry
 CBTagEntry
 CParameters
 CCollectionC++ structure to store maps of the various types of objects in a collection. OUTDATED BY analyzer.CreateAllCollections UChar not considered. Use by building each map as <branchName, branchValue> and then assigning to the correct struct member
 CDeepAK8_helperC++ class to access scale factors associated with DeepAK8 tagging
 CEffLoaderC++ class. Generic histogram loader with methods to return bin values
 CGenJetMatcherC++ class to match single reconstructed jet (represented as a Lorentz vector) to the closest generator jet in a vector of generator jets (represented as Lorentz vectors)
 CGenParticleTreeC++ class. Constructs tree by adding particles. Establish relationships between particles (parent, child) and allows you to search for a chain of decays
 CHEM_dropC++ class to weight events as if one were dropping any events with a jet in the effected region. Information on the HEM15/16 issue here. Note that this class is not meant to scale jet energy as described at the link. In place of energy scaling, the evaluation will return 0 or 1 for data and either 0.353 or 1 for MC (affected and unaffected, respectively). The value of 0.353 is derived from the ratio of 2018 affected by this issue (that is, 35.3% of MC should be unaffected but MC obviously does not have run or luminosity blocks)
 CHistLoaderC++ class. Generic histogram loader with methods to return bin values
 CJER_weightC++ class to handle the JER weight calculations
 CJERpathsC++ class to handle the extraction of JER objects starting from the JER tags and jet types
 CJES_weightC++ class to handle the JES/JEC weight calculations
 CJESpathsC++ class to handle the extraction of JES objects (aka JEC) starting from the JEC tags and jet types
 CJetRecalibratorC++ class to recalibrate the \(p_{T}\) of jets. Initialized with basic parameters and calculations done on vectors of jets from an event using the class methods
 CJetSmearerC++ class to handle the smearing of jet pt and mass using the JER and JMR inputs, respectively
 CJMEpathsC++ class. Parent class to handle shared attributes and methods among JESpaths and JERpaths
 CJMR_weightC++ class to directly handle JMR weights in the case of tau21 jet substructure. The values used (nominal, up, down) are:
 CJMS_weightC++ class to directly handle JMS weights in the case of tau21 jet substructure. The values used (nominal, up, down) are:
 CLumiFilterC++ class. Tool to filter luminosity block/run based on golden JSONs. Golden JSONs are provided in TIMBER but a custom one can be provided
 CParticleC++ class. Stores identifying features of a particle in the GenPart collection
 CPDFweight_uncertC++ class. PDF weight uncertainty lookup class
 CPileup_weightC++ class to handle pileup reweighting. Used in AutoPU.py
 CPrefire_weightC++ class to handle the trigger prefire weighting. Based off of the equivalent NanoAOD-tools module
 CSJBtag_SFC++ class. Subjet b tagging scale factor lookup
 CTempDirC++ class. Creates a temporary directory that is destroyed on delete
 CTopPt_weightC++ class. Handles the top \(p_T\) reweighting value for \(t\bar{t}\) simulation based on doing gen particle matching. The weight is calculated as
 CTopTag_SFC++ class to access scale factors associated with tau32+subjet btag(+mass) based top tagging. More details provided at https://twiki.cern.ch/twiki/bin/viewauth/CMS/JetTopTagging](https://twiki.cern.ch/twiki/bin/viewauth/CMS/JetTopTagging)
 CTopTagDAK8_SFC++ class to access scale factors associated with DeepAK8 top tagging
 CTrigger_weightC++ class. Specializes in the construction of trigger efficiency weights stored as histograms. Uncertainties are calculated as one half of the trigger inefficiency (ie. (1-eff)/2)
 CWeightCalculatorFromHistogram
 CWtag_SFC++ class to access scale factors associated with tau21+mass based W tagging. More details provided at https://twiki.cern.ch/twiki/bin/view/CMS/JetWtagging
@@ -129,7 +120,7 @@ diff --git a/docs/archive_8h_source.html b/docs/archive_8h_source.html index 0d3a583..c4c7304 100644 --- a/docs/archive_8h_source.html +++ b/docs/archive_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: bin/libarchive/include/archive.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@ - + +/* @license-end */
archive.h
-
1 /*-
2  * Copyright (c) 2003-2010 Tim Kientzle
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17  * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
18  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  * $FreeBSD: src/lib/libarchive/archive.h.in,v 1.50 2008/05/26 17:00:22 kientzle Exp $
26  */
27 
28 #ifndef ARCHIVE_H_INCLUDED
29 #define ARCHIVE_H_INCLUDED
30 
31 /*
32  * The version number is expressed as a single integer that makes it
33  * easy to compare versions at build time: for version a.b.c, the
34  * version number is printf("%d%03d%03d",a,b,c). For example, if you
35  * know your application requires version 2.12.108 or later, you can
36  * assert that ARCHIVE_VERSION_NUMBER >= 2012108.
37  */
38 /* Note: Compiler will complain if this does not match archive_entry.h! */
39 #define ARCHIVE_VERSION_NUMBER 3005002
40 
41 #include <sys/stat.h>
42 #include <stddef.h> /* for wchar_t */
43 #include <stdio.h> /* For FILE * */
44 #include <time.h> /* For time_t */
45 
46 /*
47  * Note: archive.h is for use outside of libarchive; the configuration
48  * headers (config.h, archive_platform.h, etc.) are purely internal.
49  * Do NOT use HAVE_XXX configuration macros to control the behavior of
50  * this header! If you must conditionalize, use predefined compiler and/or
51  * platform macros.
52  */
53 #if defined(__BORLANDC__) && __BORLANDC__ >= 0x560
54 # include <stdint.h>
55 #elif !defined(__WATCOMC__) && !defined(_MSC_VER) && !defined(__INTERIX) && !defined(__BORLANDC__) && !defined(_SCO_DS) && !defined(__osf__) && !defined(__CLANG_INTTYPES_H)
56 # include <inttypes.h>
57 #endif
58 
59 /* Get appropriate definitions of 64-bit integer */
60 #if !defined(__LA_INT64_T_DEFINED)
61 /* Older code relied on the __LA_INT64_T macro; after 4.0 we'll switch to the typedef exclusively. */
62 # if ARCHIVE_VERSION_NUMBER < 4000000
63 #define __LA_INT64_T la_int64_t
64 # endif
65 #define __LA_INT64_T_DEFINED
66 # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
67 typedef __int64 la_int64_t;
68 # else
69 # include <unistd.h> /* ssize_t */
70 # if defined(_SCO_DS) || defined(__osf__)
71 typedef long long la_int64_t;
72 # else
73 typedef int64_t la_int64_t;
74 # endif
75 # endif
76 #endif
77 
78 /* The la_ssize_t should match the type used in 'struct stat' */
79 #if !defined(__LA_SSIZE_T_DEFINED)
80 /* Older code relied on the __LA_SSIZE_T macro; after 4.0 we'll switch to the typedef exclusively. */
81 # if ARCHIVE_VERSION_NUMBER < 4000000
82 #define __LA_SSIZE_T la_ssize_t
83 # endif
84 #define __LA_SSIZE_T_DEFINED
85 # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
86 # if defined(_SSIZE_T_DEFINED) || defined(_SSIZE_T_)
87 typedef ssize_t la_ssize_t;
88 # elif defined(_WIN64)
89 typedef __int64 la_ssize_t;
90 # else
91 typedef long la_ssize_t;
92 # endif
93 # else
94 # include <unistd.h> /* ssize_t */
95 typedef ssize_t la_ssize_t;
96 # endif
97 #endif
98 
99 /* Large file support for Android */
100 #ifdef __ANDROID__
101 #include "android_lf.h"
102 #endif
103 
104 /*
105  * On Windows, define LIBARCHIVE_STATIC if you're building or using a
106  * .lib. The default here assumes you're building a DLL. Only
107  * libarchive source should ever define __LIBARCHIVE_BUILD.
108  */
109 #if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC)
110 # ifdef __LIBARCHIVE_BUILD
111 # ifdef __GNUC__
112 # define __LA_DECL __attribute__((dllexport)) extern
113 # else
114 # define __LA_DECL __declspec(dllexport)
115 # endif
116 # else
117 # ifdef __GNUC__
118 # define __LA_DECL
119 # else
120 # define __LA_DECL __declspec(dllimport)
121 # endif
122 # endif
123 #else
124 /* Static libraries or non-Windows needs no special declaration. */
125 # define __LA_DECL
126 #endif
127 
128 #if defined(__GNUC__) && __GNUC__ >= 3 && !defined(__MINGW32__)
129 #define __LA_PRINTF(fmtarg, firstvararg) \
130  __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
131 #else
132 #define __LA_PRINTF(fmtarg, firstvararg) /* nothing */
133 #endif
134 
135 #if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1
136 # define __LA_DEPRECATED __attribute__((deprecated))
137 #else
138 # define __LA_DEPRECATED
139 #endif
140 
141 #ifdef __cplusplus
142 extern "C" {
143 #endif
144 
145 /*
146  * The version number is provided as both a macro and a function.
147  * The macro identifies the installed header; the function identifies
148  * the library version (which may not be the same if you're using a
149  * dynamically-linked version of the library). Of course, if the
150  * header and library are very different, you should expect some
151  * strangeness. Don't do that.
152  */
153 __LA_DECL int archive_version_number(void);
154 
155 /*
156  * Textual name/version of the library, useful for version displays.
157  */
158 #define ARCHIVE_VERSION_ONLY_STRING "3.5.2dev"
159 #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
160 __LA_DECL const char * archive_version_string(void);
161 
162 /*
163  * Detailed textual name/version of the library and its dependencies.
164  * This has the form:
165  * "libarchive x.y.z zlib/a.b.c liblzma/d.e.f ... etc ..."
166  * the list of libraries described here will vary depending on how
167  * libarchive was compiled.
168  */
169 __LA_DECL const char * archive_version_details(void);
170 
171 /*
172  * Returns NULL if libarchive was compiled without the associated library.
173  * Otherwise, returns the version number that libarchive was compiled
174  * against.
175  */
176 __LA_DECL const char * archive_zlib_version(void);
177 __LA_DECL const char * archive_liblzma_version(void);
178 __LA_DECL const char * archive_bzlib_version(void);
179 __LA_DECL const char * archive_liblz4_version(void);
180 __LA_DECL const char * archive_libzstd_version(void);
181 
182 /* Declare our basic types. */
183 struct archive;
184 struct archive_entry;
185 
186 /*
187  * Error codes: Use archive_errno() and archive_error_string()
188  * to retrieve details. Unless specified otherwise, all functions
189  * that return 'int' use these codes.
190  */
191 #define ARCHIVE_EOF 1 /* Found end of archive. */
192 #define ARCHIVE_OK 0 /* Operation was successful. */
193 #define ARCHIVE_RETRY (-10) /* Retry might succeed. */
194 #define ARCHIVE_WARN (-20) /* Partial success. */
195 /* For example, if write_header "fails", then you can't push data. */
196 #define ARCHIVE_FAILED (-25) /* Current operation cannot complete. */
197 /* But if write_header is "fatal," then this archive is dead and useless. */
198 #define ARCHIVE_FATAL (-30) /* No more operations are possible. */
199 
200 /*
201  * As far as possible, archive_errno returns standard platform errno codes.
202  * Of course, the details vary by platform, so the actual definitions
203  * here are stored in "archive_platform.h". The symbols are listed here
204  * for reference; as a rule, clients should not need to know the exact
205  * platform-dependent error code.
206  */
207 /* Unrecognized or invalid file format. */
208 /* #define ARCHIVE_ERRNO_FILE_FORMAT */
209 /* Illegal usage of the library. */
210 /* #define ARCHIVE_ERRNO_PROGRAMMER_ERROR */
211 /* Unknown or unclassified error. */
212 /* #define ARCHIVE_ERRNO_MISC */
213 
214 /*
215  * Callbacks are invoked to automatically read/skip/write/open/close the
216  * archive. You can provide your own for complex tasks (like breaking
217  * archives across multiple tapes) or use standard ones built into the
218  * library.
219  */
220 
221 /* Returns pointer and size of next block of data from archive. */
222 typedef la_ssize_t archive_read_callback(struct archive *,
223  void *_client_data, const void **_buffer);
224 
225 /* Skips at most request bytes from archive and returns the skipped amount.
226  * This may skip fewer bytes than requested; it may even skip zero bytes.
227  * If you do skip fewer bytes than requested, libarchive will invoke your
228  * read callback and discard data as necessary to make up the full skip.
229  */
230 typedef la_int64_t archive_skip_callback(struct archive *,
231  void *_client_data, la_int64_t request);
232 
233 /* Seeks to specified location in the file and returns the position.
234  * Whence values are SEEK_SET, SEEK_CUR, SEEK_END from stdio.h.
235  * Return ARCHIVE_FATAL if the seek fails for any reason.
236  */
237 typedef la_int64_t archive_seek_callback(struct archive *,
238  void *_client_data, la_int64_t offset, int whence);
239 
240 /* Returns size actually written, zero on EOF, -1 on error. */
241 typedef la_ssize_t archive_write_callback(struct archive *,
242  void *_client_data,
243  const void *_buffer, size_t _length);
244 
245 typedef int archive_open_callback(struct archive *, void *_client_data);
246 
247 typedef int archive_close_callback(struct archive *, void *_client_data);
248 
249 typedef int archive_free_callback(struct archive *, void *_client_data);
250 
251 /* Switches from one client data object to the next/prev client data object.
252  * This is useful for reading from different data blocks such as a set of files
253  * that make up one large file.
254  */
255 typedef int archive_switch_callback(struct archive *, void *_client_data1,
256  void *_client_data2);
257 
258 /*
259  * Returns a passphrase used for encryption or decryption, NULL on nothing
260  * to do and give it up.
261  */
262 typedef const char *archive_passphrase_callback(struct archive *,
263  void *_client_data);
264 
265 /*
266  * Codes to identify various stream filters.
267  */
268 #define ARCHIVE_FILTER_NONE 0
269 #define ARCHIVE_FILTER_GZIP 1
270 #define ARCHIVE_FILTER_BZIP2 2
271 #define ARCHIVE_FILTER_COMPRESS 3
272 #define ARCHIVE_FILTER_PROGRAM 4
273 #define ARCHIVE_FILTER_LZMA 5
274 #define ARCHIVE_FILTER_XZ 6
275 #define ARCHIVE_FILTER_UU 7
276 #define ARCHIVE_FILTER_RPM 8
277 #define ARCHIVE_FILTER_LZIP 9
278 #define ARCHIVE_FILTER_LRZIP 10
279 #define ARCHIVE_FILTER_LZOP 11
280 #define ARCHIVE_FILTER_GRZIP 12
281 #define ARCHIVE_FILTER_LZ4 13
282 #define ARCHIVE_FILTER_ZSTD 14
283 
284 #if ARCHIVE_VERSION_NUMBER < 4000000
285 #define ARCHIVE_COMPRESSION_NONE ARCHIVE_FILTER_NONE
286 #define ARCHIVE_COMPRESSION_GZIP ARCHIVE_FILTER_GZIP
287 #define ARCHIVE_COMPRESSION_BZIP2 ARCHIVE_FILTER_BZIP2
288 #define ARCHIVE_COMPRESSION_COMPRESS ARCHIVE_FILTER_COMPRESS
289 #define ARCHIVE_COMPRESSION_PROGRAM ARCHIVE_FILTER_PROGRAM
290 #define ARCHIVE_COMPRESSION_LZMA ARCHIVE_FILTER_LZMA
291 #define ARCHIVE_COMPRESSION_XZ ARCHIVE_FILTER_XZ
292 #define ARCHIVE_COMPRESSION_UU ARCHIVE_FILTER_UU
293 #define ARCHIVE_COMPRESSION_RPM ARCHIVE_FILTER_RPM
294 #define ARCHIVE_COMPRESSION_LZIP ARCHIVE_FILTER_LZIP
295 #define ARCHIVE_COMPRESSION_LRZIP ARCHIVE_FILTER_LRZIP
296 #endif
297 
298 /*
299  * Codes returned by archive_format.
300  *
301  * Top 16 bits identifies the format family (e.g., "tar"); lower
302  * 16 bits indicate the variant. This is updated by read_next_header.
303  * Note that the lower 16 bits will often vary from entry to entry.
304  * In some cases, this variation occurs as libarchive learns more about
305  * the archive (for example, later entries might utilize extensions that
306  * weren't necessary earlier in the archive; in this case, libarchive
307  * will change the format code to indicate the extended format that
308  * was used). In other cases, it's because different tools have
309  * modified the archive and so different parts of the archive
310  * actually have slightly different formats. (Both tar and cpio store
311  * format codes in each entry, so it is quite possible for each
312  * entry to be in a different format.)
313  */
314 #define ARCHIVE_FORMAT_BASE_MASK 0xff0000
315 #define ARCHIVE_FORMAT_CPIO 0x10000
316 #define ARCHIVE_FORMAT_CPIO_POSIX (ARCHIVE_FORMAT_CPIO | 1)
317 #define ARCHIVE_FORMAT_CPIO_BIN_LE (ARCHIVE_FORMAT_CPIO | 2)
318 #define ARCHIVE_FORMAT_CPIO_BIN_BE (ARCHIVE_FORMAT_CPIO | 3)
319 #define ARCHIVE_FORMAT_CPIO_SVR4_NOCRC (ARCHIVE_FORMAT_CPIO | 4)
320 #define ARCHIVE_FORMAT_CPIO_SVR4_CRC (ARCHIVE_FORMAT_CPIO | 5)
321 #define ARCHIVE_FORMAT_CPIO_AFIO_LARGE (ARCHIVE_FORMAT_CPIO | 6)
322 #define ARCHIVE_FORMAT_SHAR 0x20000
323 #define ARCHIVE_FORMAT_SHAR_BASE (ARCHIVE_FORMAT_SHAR | 1)
324 #define ARCHIVE_FORMAT_SHAR_DUMP (ARCHIVE_FORMAT_SHAR | 2)
325 #define ARCHIVE_FORMAT_TAR 0x30000
326 #define ARCHIVE_FORMAT_TAR_USTAR (ARCHIVE_FORMAT_TAR | 1)
327 #define ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE (ARCHIVE_FORMAT_TAR | 2)
328 #define ARCHIVE_FORMAT_TAR_PAX_RESTRICTED (ARCHIVE_FORMAT_TAR | 3)
329 #define ARCHIVE_FORMAT_TAR_GNUTAR (ARCHIVE_FORMAT_TAR | 4)
330 #define ARCHIVE_FORMAT_ISO9660 0x40000
331 #define ARCHIVE_FORMAT_ISO9660_ROCKRIDGE (ARCHIVE_FORMAT_ISO9660 | 1)
332 #define ARCHIVE_FORMAT_ZIP 0x50000
333 #define ARCHIVE_FORMAT_EMPTY 0x60000
334 #define ARCHIVE_FORMAT_AR 0x70000
335 #define ARCHIVE_FORMAT_AR_GNU (ARCHIVE_FORMAT_AR | 1)
336 #define ARCHIVE_FORMAT_AR_BSD (ARCHIVE_FORMAT_AR | 2)
337 #define ARCHIVE_FORMAT_MTREE 0x80000
338 #define ARCHIVE_FORMAT_RAW 0x90000
339 #define ARCHIVE_FORMAT_XAR 0xA0000
340 #define ARCHIVE_FORMAT_LHA 0xB0000
341 #define ARCHIVE_FORMAT_CAB 0xC0000
342 #define ARCHIVE_FORMAT_RAR 0xD0000
343 #define ARCHIVE_FORMAT_7ZIP 0xE0000
344 #define ARCHIVE_FORMAT_WARC 0xF0000
345 #define ARCHIVE_FORMAT_RAR_V5 0x100000
346 
347 /*
348  * Codes returned by archive_read_format_capabilities().
349  *
350  * This list can be extended with values between 0 and 0xffff.
351  * The original purpose of this list was to let different archive
352  * format readers expose their general capabilities in terms of
353  * encryption.
354  */
355 #define ARCHIVE_READ_FORMAT_CAPS_NONE (0) /* no special capabilities */
356 #define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0) /* reader can detect encrypted data */
357 #define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1) /* reader can detect encryptable metadata (pathname, mtime, etc.) */
358 
359 /*
360  * Codes returned by archive_read_has_encrypted_entries().
361  *
362  * In case the archive does not support encryption detection at all
363  * ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED is returned. If the reader
364  * for some other reason (e.g. not enough bytes read) cannot say if
365  * there are encrypted entries, ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW
366  * is returned.
367  */
368 #define ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED -2
369 #define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
370 
371 /*-
372  * Basic outline for reading an archive:
373  * 1) Ask archive_read_new for an archive reader object.
374  * 2) Update any global properties as appropriate.
375  * In particular, you'll certainly want to call appropriate
376  * archive_read_support_XXX functions.
377  * 3) Call archive_read_open_XXX to open the archive
378  * 4) Repeatedly call archive_read_next_header to get information about
379  * successive archive entries. Call archive_read_data to extract
380  * data for entries of interest.
381  * 5) Call archive_read_free to end processing.
382  */
383 __LA_DECL struct archive *archive_read_new(void);
384 
385 /*
386  * The archive_read_support_XXX calls enable auto-detect for this
387  * archive handle. They also link in the necessary support code.
388  * For example, if you don't want bzlib linked in, don't invoke
389  * support_compression_bzip2(). The "all" functions provide the
390  * obvious shorthand.
391  */
392 
393 #if ARCHIVE_VERSION_NUMBER < 4000000
394 __LA_DECL int archive_read_support_compression_all(struct archive *)
395  __LA_DEPRECATED;
396 __LA_DECL int archive_read_support_compression_bzip2(struct archive *)
397  __LA_DEPRECATED;
398 __LA_DECL int archive_read_support_compression_compress(struct archive *)
399  __LA_DEPRECATED;
400 __LA_DECL int archive_read_support_compression_gzip(struct archive *)
401  __LA_DEPRECATED;
402 __LA_DECL int archive_read_support_compression_lzip(struct archive *)
403  __LA_DEPRECATED;
404 __LA_DECL int archive_read_support_compression_lzma(struct archive *)
405  __LA_DEPRECATED;
406 __LA_DECL int archive_read_support_compression_none(struct archive *)
407  __LA_DEPRECATED;
408 __LA_DECL int archive_read_support_compression_program(struct archive *,
409  const char *command) __LA_DEPRECATED;
410 __LA_DECL int archive_read_support_compression_program_signature
411  (struct archive *, const char *,
412  const void * /* match */, size_t) __LA_DEPRECATED;
413 
414 __LA_DECL int archive_read_support_compression_rpm(struct archive *)
415  __LA_DEPRECATED;
416 __LA_DECL int archive_read_support_compression_uu(struct archive *)
417  __LA_DEPRECATED;
418 __LA_DECL int archive_read_support_compression_xz(struct archive *)
419  __LA_DEPRECATED;
420 #endif
421 
422 __LA_DECL int archive_read_support_filter_all(struct archive *);
423 __LA_DECL int archive_read_support_filter_by_code(struct archive *, int);
424 __LA_DECL int archive_read_support_filter_bzip2(struct archive *);
425 __LA_DECL int archive_read_support_filter_compress(struct archive *);
426 __LA_DECL int archive_read_support_filter_gzip(struct archive *);
427 __LA_DECL int archive_read_support_filter_grzip(struct archive *);
428 __LA_DECL int archive_read_support_filter_lrzip(struct archive *);
429 __LA_DECL int archive_read_support_filter_lz4(struct archive *);
430 __LA_DECL int archive_read_support_filter_lzip(struct archive *);
431 __LA_DECL int archive_read_support_filter_lzma(struct archive *);
432 __LA_DECL int archive_read_support_filter_lzop(struct archive *);
433 __LA_DECL int archive_read_support_filter_none(struct archive *);
434 __LA_DECL int archive_read_support_filter_program(struct archive *,
435  const char *command);
436 __LA_DECL int archive_read_support_filter_program_signature
437  (struct archive *, const char * /* cmd */,
438  const void * /* match */, size_t);
439 __LA_DECL int archive_read_support_filter_rpm(struct archive *);
440 __LA_DECL int archive_read_support_filter_uu(struct archive *);
441 __LA_DECL int archive_read_support_filter_xz(struct archive *);
442 __LA_DECL int archive_read_support_filter_zstd(struct archive *);
443 
444 __LA_DECL int archive_read_support_format_7zip(struct archive *);
445 __LA_DECL int archive_read_support_format_all(struct archive *);
446 __LA_DECL int archive_read_support_format_ar(struct archive *);
447 __LA_DECL int archive_read_support_format_by_code(struct archive *, int);
448 __LA_DECL int archive_read_support_format_cab(struct archive *);
449 __LA_DECL int archive_read_support_format_cpio(struct archive *);
450 __LA_DECL int archive_read_support_format_empty(struct archive *);
451 __LA_DECL int archive_read_support_format_gnutar(struct archive *);
452 __LA_DECL int archive_read_support_format_iso9660(struct archive *);
453 __LA_DECL int archive_read_support_format_lha(struct archive *);
454 __LA_DECL int archive_read_support_format_mtree(struct archive *);
455 __LA_DECL int archive_read_support_format_rar(struct archive *);
456 __LA_DECL int archive_read_support_format_rar5(struct archive *);
457 __LA_DECL int archive_read_support_format_raw(struct archive *);
458 __LA_DECL int archive_read_support_format_tar(struct archive *);
459 __LA_DECL int archive_read_support_format_warc(struct archive *);
460 __LA_DECL int archive_read_support_format_xar(struct archive *);
461 /* archive_read_support_format_zip() enables both streamable and seekable
462  * zip readers. */
463 __LA_DECL int archive_read_support_format_zip(struct archive *);
464 /* Reads Zip archives as stream from beginning to end. Doesn't
465  * correctly handle SFX ZIP files or ZIP archives that have been modified
466  * in-place. */
467 __LA_DECL int archive_read_support_format_zip_streamable(struct archive *);
468 /* Reads starting from central directory; requires seekable input. */
469 __LA_DECL int archive_read_support_format_zip_seekable(struct archive *);
470 
471 /* Functions to manually set the format and filters to be used. This is
472  * useful to bypass the bidding process when the format and filters to use
473  * is known in advance.
474  */
475 __LA_DECL int archive_read_set_format(struct archive *, int);
476 __LA_DECL int archive_read_append_filter(struct archive *, int);
477 __LA_DECL int archive_read_append_filter_program(struct archive *,
478  const char *);
479 __LA_DECL int archive_read_append_filter_program_signature
480  (struct archive *, const char *, const void * /* match */, size_t);
481 
482 /* Set various callbacks. */
483 __LA_DECL int archive_read_set_open_callback(struct archive *,
484  archive_open_callback *);
485 __LA_DECL int archive_read_set_read_callback(struct archive *,
486  archive_read_callback *);
487 __LA_DECL int archive_read_set_seek_callback(struct archive *,
488  archive_seek_callback *);
489 __LA_DECL int archive_read_set_skip_callback(struct archive *,
490  archive_skip_callback *);
491 __LA_DECL int archive_read_set_close_callback(struct archive *,
492  archive_close_callback *);
493 /* Callback used to switch between one data object to the next */
494 __LA_DECL int archive_read_set_switch_callback(struct archive *,
495  archive_switch_callback *);
496 
497 /* This sets the first data object. */
498 __LA_DECL int archive_read_set_callback_data(struct archive *, void *);
499 /* This sets data object at specified index */
500 __LA_DECL int archive_read_set_callback_data2(struct archive *, void *,
501  unsigned int);
502 /* This adds a data object at the specified index. */
503 __LA_DECL int archive_read_add_callback_data(struct archive *, void *,
504  unsigned int);
505 /* This appends a data object to the end of list */
506 __LA_DECL int archive_read_append_callback_data(struct archive *, void *);
507 /* This prepends a data object to the beginning of list */
508 __LA_DECL int archive_read_prepend_callback_data(struct archive *, void *);
509 
510 /* Opening freezes the callbacks. */
511 __LA_DECL int archive_read_open1(struct archive *);
512 
513 /* Convenience wrappers around the above. */
514 __LA_DECL int archive_read_open(struct archive *, void *_client_data,
515  archive_open_callback *, archive_read_callback *,
516  archive_close_callback *);
517 __LA_DECL int archive_read_open2(struct archive *, void *_client_data,
518  archive_open_callback *, archive_read_callback *,
519  archive_skip_callback *, archive_close_callback *);
520 
521 /*
522  * A variety of shortcuts that invoke archive_read_open() with
523  * canned callbacks suitable for common situations. The ones that
524  * accept a block size handle tape blocking correctly.
525  */
526 /* Use this if you know the filename. Note: NULL indicates stdin. */
527 __LA_DECL int archive_read_open_filename(struct archive *,
528  const char *_filename, size_t _block_size);
529 /* Use this for reading multivolume files by filenames.
530  * NOTE: Must be NULL terminated. Sorting is NOT done. */
531 __LA_DECL int archive_read_open_filenames(struct archive *,
532  const char **_filenames, size_t _block_size);
533 __LA_DECL int archive_read_open_filename_w(struct archive *,
534  const wchar_t *_filename, size_t _block_size);
535 /* archive_read_open_file() is a deprecated synonym for ..._open_filename(). */
536 __LA_DECL int archive_read_open_file(struct archive *,
537  const char *_filename, size_t _block_size) __LA_DEPRECATED;
538 /* Read an archive that's stored in memory. */
539 __LA_DECL int archive_read_open_memory(struct archive *,
540  const void * buff, size_t size);
541 /* A more involved version that is only used for internal testing. */
542 __LA_DECL int archive_read_open_memory2(struct archive *a, const void *buff,
543  size_t size, size_t read_size);
544 /* Read an archive that's already open, using the file descriptor. */
545 __LA_DECL int archive_read_open_fd(struct archive *, int _fd,
546  size_t _block_size);
547 /* Read an archive that's already open, using a FILE *. */
548 /* Note: DO NOT use this with tape drives. */
549 __LA_DECL int archive_read_open_FILE(struct archive *, FILE *_file);
550 
551 /* Parses and returns next entry header. */
552 __LA_DECL int archive_read_next_header(struct archive *,
553  struct archive_entry **);
554 
555 /* Parses and returns next entry header using the archive_entry passed in */
556 __LA_DECL int archive_read_next_header2(struct archive *,
557  struct archive_entry *);
558 
559 /*
560  * Retrieve the byte offset in UNCOMPRESSED data where last-read
561  * header started.
562  */
563 __LA_DECL la_int64_t archive_read_header_position(struct archive *);
564 
565 /*
566  * Returns 1 if the archive contains at least one encrypted entry.
567  * If the archive format not support encryption at all
568  * ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED is returned.
569  * If for any other reason (e.g. not enough data read so far)
570  * we cannot say whether there are encrypted entries, then
571  * ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW is returned.
572  * In general, this function will return values below zero when the
573  * reader is uncertain or totally incapable of encryption support.
574  * When this function returns 0 you can be sure that the reader
575  * supports encryption detection but no encrypted entries have
576  * been found yet.
577  *
578  * NOTE: If the metadata/header of an archive is also encrypted, you
579  * cannot rely on the number of encrypted entries. That is why this
580  * function does not return the number of encrypted entries but#
581  * just shows that there are some.
582  */
583 __LA_DECL int archive_read_has_encrypted_entries(struct archive *);
584 
585 /*
586  * Returns a bitmask of capabilities that are supported by the archive format reader.
587  * If the reader has no special capabilities, ARCHIVE_READ_FORMAT_CAPS_NONE is returned.
588  */
589 __LA_DECL int archive_read_format_capabilities(struct archive *);
590 
591 /* Read data from the body of an entry. Similar to read(2). */
592 __LA_DECL la_ssize_t archive_read_data(struct archive *,
593  void *, size_t);
594 
595 /* Seek within the body of an entry. Similar to lseek(2). */
596 __LA_DECL la_int64_t archive_seek_data(struct archive *, la_int64_t, int);
597 
598 /*
599  * A zero-copy version of archive_read_data that also exposes the file offset
600  * of each returned block. Note that the client has no way to specify
601  * the desired size of the block. The API does guarantee that offsets will
602  * be strictly increasing and that returned blocks will not overlap.
603  */
604 __LA_DECL int archive_read_data_block(struct archive *a,
605  const void **buff, size_t *size, la_int64_t *offset);
606 
607 /*-
608  * Some convenience functions that are built on archive_read_data:
609  * 'skip': skips entire entry
610  * 'into_buffer': writes data into memory buffer that you provide
611  * 'into_fd': writes data to specified filedes
612  */
613 __LA_DECL int archive_read_data_skip(struct archive *);
614 __LA_DECL int archive_read_data_into_fd(struct archive *, int fd);
615 
616 /*
617  * Set read options.
618  */
619 /* Apply option to the format only. */
620 __LA_DECL int archive_read_set_format_option(struct archive *_a,
621  const char *m, const char *o,
622  const char *v);
623 /* Apply option to the filter only. */
624 __LA_DECL int archive_read_set_filter_option(struct archive *_a,
625  const char *m, const char *o,
626  const char *v);
627 /* Apply option to both the format and the filter. */
628 __LA_DECL int archive_read_set_option(struct archive *_a,
629  const char *m, const char *o,
630  const char *v);
631 /* Apply option string to both the format and the filter. */
632 __LA_DECL int archive_read_set_options(struct archive *_a,
633  const char *opts);
634 
635 /*
636  * Add a decryption passphrase.
637  */
638 __LA_DECL int archive_read_add_passphrase(struct archive *, const char *);
639 __LA_DECL int archive_read_set_passphrase_callback(struct archive *,
640  void *client_data, archive_passphrase_callback *);
641 
642 
643 /*-
644  * Convenience function to recreate the current entry (whose header
645  * has just been read) on disk.
646  *
647  * This does quite a bit more than just copy data to disk. It also:
648  * - Creates intermediate directories as required.
649  * - Manages directory permissions: non-writable directories will
650  * be initially created with write permission enabled; when the
651  * archive is closed, dir permissions are edited to the values specified
652  * in the archive.
653  * - Checks hardlinks: hardlinks will not be extracted unless the
654  * linked-to file was also extracted within the same session. (TODO)
655  */
656 
657 /* The "flags" argument selects optional behavior, 'OR' the flags you want. */
658 
659 /* Default: Do not try to set owner/group. */
660 #define ARCHIVE_EXTRACT_OWNER (0x0001)
661 /* Default: Do obey umask, do not restore SUID/SGID/SVTX bits. */
662 #define ARCHIVE_EXTRACT_PERM (0x0002)
663 /* Default: Do not restore mtime/atime. */
664 #define ARCHIVE_EXTRACT_TIME (0x0004)
665 /* Default: Replace existing files. */
666 #define ARCHIVE_EXTRACT_NO_OVERWRITE (0x0008)
667 /* Default: Try create first, unlink only if create fails with EEXIST. */
668 #define ARCHIVE_EXTRACT_UNLINK (0x0010)
669 /* Default: Do not restore ACLs. */
670 #define ARCHIVE_EXTRACT_ACL (0x0020)
671 /* Default: Do not restore fflags. */
672 #define ARCHIVE_EXTRACT_FFLAGS (0x0040)
673 /* Default: Do not restore xattrs. */
674 #define ARCHIVE_EXTRACT_XATTR (0x0080)
675 /* Default: Do not try to guard against extracts redirected by symlinks. */
676 /* Note: With ARCHIVE_EXTRACT_UNLINK, will remove any intermediate symlink. */
677 #define ARCHIVE_EXTRACT_SECURE_SYMLINKS (0x0100)
678 /* Default: Do not reject entries with '..' as path elements. */
679 #define ARCHIVE_EXTRACT_SECURE_NODOTDOT (0x0200)
680 /* Default: Create parent directories as needed. */
681 #define ARCHIVE_EXTRACT_NO_AUTODIR (0x0400)
682 /* Default: Overwrite files, even if one on disk is newer. */
683 #define ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER (0x0800)
684 /* Detect blocks of 0 and write holes instead. */
685 #define ARCHIVE_EXTRACT_SPARSE (0x1000)
686 /* Default: Do not restore Mac extended metadata. */
687 /* This has no effect except on Mac OS. */
688 #define ARCHIVE_EXTRACT_MAC_METADATA (0x2000)
689 /* Default: Use HFS+ compression if it was compressed. */
690 /* This has no effect except on Mac OS v10.6 or later. */
691 #define ARCHIVE_EXTRACT_NO_HFS_COMPRESSION (0x4000)
692 /* Default: Do not use HFS+ compression if it was not compressed. */
693 /* This has no effect except on Mac OS v10.6 or later. */
694 #define ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED (0x8000)
695 /* Default: Do not reject entries with absolute paths */
696 #define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x10000)
697 /* Default: Do not clear no-change flags when unlinking object */
698 #define ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS (0x20000)
699 /* Default: Do not extract atomically (using rename) */
700 #define ARCHIVE_EXTRACT_SAFE_WRITES (0x40000)
701 
702 __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *,
703  int flags);
704 __LA_DECL int archive_read_extract2(struct archive *, struct archive_entry *,
705  struct archive * /* dest */);
706 __LA_DECL void archive_read_extract_set_progress_callback(struct archive *,
707  void (*_progress_func)(void *), void *_user_data);
708 
709 /* Record the dev/ino of a file that will not be written. This is
710  * generally set to the dev/ino of the archive being read. */
711 __LA_DECL void archive_read_extract_set_skip_file(struct archive *,
712  la_int64_t, la_int64_t);
713 
714 /* Close the file and release most resources. */
715 __LA_DECL int archive_read_close(struct archive *);
716 /* Release all resources and destroy the object. */
717 /* Note that archive_read_free will call archive_read_close for you. */
718 __LA_DECL int archive_read_free(struct archive *);
719 #if ARCHIVE_VERSION_NUMBER < 4000000
720 /* Synonym for archive_read_free() for backwards compatibility. */
721 __LA_DECL int archive_read_finish(struct archive *) __LA_DEPRECATED;
722 #endif
723 
724 /*-
725  * To create an archive:
726  * 1) Ask archive_write_new for an archive writer object.
727  * 2) Set any global properties. In particular, you should set
728  * the compression and format to use.
729  * 3) Call archive_write_open to open the file (most people
730  * will use archive_write_open_file or archive_write_open_fd,
731  * which provide convenient canned I/O callbacks for you).
732  * 4) For each entry:
733  * - construct an appropriate struct archive_entry structure
734  * - archive_write_header to write the header
735  * - archive_write_data to write the entry data
736  * 5) archive_write_close to close the output
737  * 6) archive_write_free to cleanup the writer and release resources
738  */
739 __LA_DECL struct archive *archive_write_new(void);
740 __LA_DECL int archive_write_set_bytes_per_block(struct archive *,
741  int bytes_per_block);
742 __LA_DECL int archive_write_get_bytes_per_block(struct archive *);
743 /* XXX This is badly misnamed; suggestions appreciated. XXX */
744 __LA_DECL int archive_write_set_bytes_in_last_block(struct archive *,
745  int bytes_in_last_block);
746 __LA_DECL int archive_write_get_bytes_in_last_block(struct archive *);
747 
748 /* The dev/ino of a file that won't be archived. This is used
749  * to avoid recursively adding an archive to itself. */
750 __LA_DECL int archive_write_set_skip_file(struct archive *,
751  la_int64_t, la_int64_t);
752 
753 #if ARCHIVE_VERSION_NUMBER < 4000000
754 __LA_DECL int archive_write_set_compression_bzip2(struct archive *)
755  __LA_DEPRECATED;
756 __LA_DECL int archive_write_set_compression_compress(struct archive *)
757  __LA_DEPRECATED;
758 __LA_DECL int archive_write_set_compression_gzip(struct archive *)
759  __LA_DEPRECATED;
760 __LA_DECL int archive_write_set_compression_lzip(struct archive *)
761  __LA_DEPRECATED;
762 __LA_DECL int archive_write_set_compression_lzma(struct archive *)
763  __LA_DEPRECATED;
764 __LA_DECL int archive_write_set_compression_none(struct archive *)
765  __LA_DEPRECATED;
766 __LA_DECL int archive_write_set_compression_program(struct archive *,
767  const char *cmd) __LA_DEPRECATED;
768 __LA_DECL int archive_write_set_compression_xz(struct archive *)
769  __LA_DEPRECATED;
770 #endif
771 
772 /* A convenience function to set the filter based on the code. */
773 __LA_DECL int archive_write_add_filter(struct archive *, int filter_code);
774 __LA_DECL int archive_write_add_filter_by_name(struct archive *,
775  const char *name);
776 __LA_DECL int archive_write_add_filter_b64encode(struct archive *);
777 __LA_DECL int archive_write_add_filter_bzip2(struct archive *);
778 __LA_DECL int archive_write_add_filter_compress(struct archive *);
779 __LA_DECL int archive_write_add_filter_grzip(struct archive *);
780 __LA_DECL int archive_write_add_filter_gzip(struct archive *);
781 __LA_DECL int archive_write_add_filter_lrzip(struct archive *);
782 __LA_DECL int archive_write_add_filter_lz4(struct archive *);
783 __LA_DECL int archive_write_add_filter_lzip(struct archive *);
784 __LA_DECL int archive_write_add_filter_lzma(struct archive *);
785 __LA_DECL int archive_write_add_filter_lzop(struct archive *);
786 __LA_DECL int archive_write_add_filter_none(struct archive *);
787 __LA_DECL int archive_write_add_filter_program(struct archive *,
788  const char *cmd);
789 __LA_DECL int archive_write_add_filter_uuencode(struct archive *);
790 __LA_DECL int archive_write_add_filter_xz(struct archive *);
791 __LA_DECL int archive_write_add_filter_zstd(struct archive *);
792 
793 
794 /* A convenience function to set the format based on the code or name. */
795 __LA_DECL int archive_write_set_format(struct archive *, int format_code);
796 __LA_DECL int archive_write_set_format_by_name(struct archive *,
797  const char *name);
798 /* To minimize link pollution, use one or more of the following. */
799 __LA_DECL int archive_write_set_format_7zip(struct archive *);
800 __LA_DECL int archive_write_set_format_ar_bsd(struct archive *);
801 __LA_DECL int archive_write_set_format_ar_svr4(struct archive *);
802 __LA_DECL int archive_write_set_format_cpio(struct archive *);
803 __LA_DECL int archive_write_set_format_cpio_newc(struct archive *);
804 __LA_DECL int archive_write_set_format_gnutar(struct archive *);
805 __LA_DECL int archive_write_set_format_iso9660(struct archive *);
806 __LA_DECL int archive_write_set_format_mtree(struct archive *);
807 __LA_DECL int archive_write_set_format_mtree_classic(struct archive *);
808 /* TODO: int archive_write_set_format_old_tar(struct archive *); */
809 __LA_DECL int archive_write_set_format_pax(struct archive *);
810 __LA_DECL int archive_write_set_format_pax_restricted(struct archive *);
811 __LA_DECL int archive_write_set_format_raw(struct archive *);
812 __LA_DECL int archive_write_set_format_shar(struct archive *);
813 __LA_DECL int archive_write_set_format_shar_dump(struct archive *);
814 __LA_DECL int archive_write_set_format_ustar(struct archive *);
815 __LA_DECL int archive_write_set_format_v7tar(struct archive *);
816 __LA_DECL int archive_write_set_format_warc(struct archive *);
817 __LA_DECL int archive_write_set_format_xar(struct archive *);
818 __LA_DECL int archive_write_set_format_zip(struct archive *);
819 __LA_DECL int archive_write_set_format_filter_by_ext(struct archive *a, const char *filename);
820 __LA_DECL int archive_write_set_format_filter_by_ext_def(struct archive *a, const char *filename, const char * def_ext);
821 __LA_DECL int archive_write_zip_set_compression_deflate(struct archive *);
822 __LA_DECL int archive_write_zip_set_compression_store(struct archive *);
823 /* Deprecated; use archive_write_open2 instead */
824 __LA_DECL int archive_write_open(struct archive *, void *,
825  archive_open_callback *, archive_write_callback *,
826  archive_close_callback *);
827 __LA_DECL int archive_write_open2(struct archive *, void *,
828  archive_open_callback *, archive_write_callback *,
829  archive_close_callback *, archive_free_callback *);
830 __LA_DECL int archive_write_open_fd(struct archive *, int _fd);
831 __LA_DECL int archive_write_open_filename(struct archive *, const char *_file);
832 __LA_DECL int archive_write_open_filename_w(struct archive *,
833  const wchar_t *_file);
834 /* A deprecated synonym for archive_write_open_filename() */
835 __LA_DECL int archive_write_open_file(struct archive *, const char *_file)
836  __LA_DEPRECATED;
837 __LA_DECL int archive_write_open_FILE(struct archive *, FILE *);
838 /* _buffSize is the size of the buffer, _used refers to a variable that
839  * will be updated after each write into the buffer. */
840 __LA_DECL int archive_write_open_memory(struct archive *,
841  void *_buffer, size_t _buffSize, size_t *_used);
842 
843 /*
844  * Note that the library will truncate writes beyond the size provided
845  * to archive_write_header or pad if the provided data is short.
846  */
847 __LA_DECL int archive_write_header(struct archive *,
848  struct archive_entry *);
849 __LA_DECL la_ssize_t archive_write_data(struct archive *,
850  const void *, size_t);
851 
852 /* This interface is currently only available for archive_write_disk handles. */
853 __LA_DECL la_ssize_t archive_write_data_block(struct archive *,
854  const void *, size_t, la_int64_t);
855 
856 __LA_DECL int archive_write_finish_entry(struct archive *);
857 __LA_DECL int archive_write_close(struct archive *);
858 /* Marks the archive as FATAL so that a subsequent free() operation
859  * won't try to close() cleanly. Provides a fast abort capability
860  * when the client discovers that things have gone wrong. */
861 __LA_DECL int archive_write_fail(struct archive *);
862 /* This can fail if the archive wasn't already closed, in which case
863  * archive_write_free() will implicitly call archive_write_close(). */
864 __LA_DECL int archive_write_free(struct archive *);
865 #if ARCHIVE_VERSION_NUMBER < 4000000
866 /* Synonym for archive_write_free() for backwards compatibility. */
867 __LA_DECL int archive_write_finish(struct archive *) __LA_DEPRECATED;
868 #endif
869 
870 /*
871  * Set write options.
872  */
873 /* Apply option to the format only. */
874 __LA_DECL int archive_write_set_format_option(struct archive *_a,
875  const char *m, const char *o,
876  const char *v);
877 /* Apply option to the filter only. */
878 __LA_DECL int archive_write_set_filter_option(struct archive *_a,
879  const char *m, const char *o,
880  const char *v);
881 /* Apply option to both the format and the filter. */
882 __LA_DECL int archive_write_set_option(struct archive *_a,
883  const char *m, const char *o,
884  const char *v);
885 /* Apply option string to both the format and the filter. */
886 __LA_DECL int archive_write_set_options(struct archive *_a,
887  const char *opts);
888 
889 /*
890  * Set a encryption passphrase.
891  */
892 __LA_DECL int archive_write_set_passphrase(struct archive *_a, const char *p);
893 __LA_DECL int archive_write_set_passphrase_callback(struct archive *,
894  void *client_data, archive_passphrase_callback *);
895 
896 /*-
897  * ARCHIVE_WRITE_DISK API
898  *
899  * To create objects on disk:
900  * 1) Ask archive_write_disk_new for a new archive_write_disk object.
901  * 2) Set any global properties. In particular, you probably
902  * want to set the options.
903  * 3) For each entry:
904  * - construct an appropriate struct archive_entry structure
905  * - archive_write_header to create the file/dir/etc on disk
906  * - archive_write_data to write the entry data
907  * 4) archive_write_free to cleanup the writer and release resources
908  *
909  * In particular, you can use this in conjunction with archive_read()
910  * to pull entries out of an archive and create them on disk.
911  */
912 __LA_DECL struct archive *archive_write_disk_new(void);
913 /* This file will not be overwritten. */
914 __LA_DECL int archive_write_disk_set_skip_file(struct archive *,
915  la_int64_t, la_int64_t);
916 /* Set flags to control how the next item gets created.
917  * This accepts a bitmask of ARCHIVE_EXTRACT_XXX flags defined above. */
918 __LA_DECL int archive_write_disk_set_options(struct archive *,
919  int flags);
920 /*
921  * The lookup functions are given uname/uid (or gname/gid) pairs and
922  * return a uid (gid) suitable for this system. These are used for
923  * restoring ownership and for setting ACLs. The default functions
924  * are naive, they just return the uid/gid. These are small, so reasonable
925  * for applications that don't need to preserve ownership; they
926  * are probably also appropriate for applications that are doing
927  * same-system backup and restore.
928  */
929 /*
930  * The "standard" lookup functions use common system calls to lookup
931  * the uname/gname, falling back to the uid/gid if the names can't be
932  * found. They cache lookups and are reasonably fast, but can be very
933  * large, so they are not used unless you ask for them. In
934  * particular, these match the specifications of POSIX "pax" and old
935  * POSIX "tar".
936  */
937 __LA_DECL int archive_write_disk_set_standard_lookup(struct archive *);
938 /*
939  * If neither the default (naive) nor the standard (big) functions suit
940  * your needs, you can write your own and register them. Be sure to
941  * include a cleanup function if you have allocated private data.
942  */
943 __LA_DECL int archive_write_disk_set_group_lookup(struct archive *,
944  void * /* private_data */,
945  la_int64_t (*)(void *, const char *, la_int64_t),
946  void (* /* cleanup */)(void *));
947 __LA_DECL int archive_write_disk_set_user_lookup(struct archive *,
948  void * /* private_data */,
949  la_int64_t (*)(void *, const char *, la_int64_t),
950  void (* /* cleanup */)(void *));
951 __LA_DECL la_int64_t archive_write_disk_gid(struct archive *, const char *, la_int64_t);
952 __LA_DECL la_int64_t archive_write_disk_uid(struct archive *, const char *, la_int64_t);
953 
954 /*
955  * ARCHIVE_READ_DISK API
956  *
957  * This is still evolving and somewhat experimental.
958  */
959 __LA_DECL struct archive *archive_read_disk_new(void);
960 /* The names for symlink modes here correspond to an old BSD
961  * command-line argument convention: -L, -P, -H */
962 /* Follow all symlinks. */
963 __LA_DECL int archive_read_disk_set_symlink_logical(struct archive *);
964 /* Follow no symlinks. */
965 __LA_DECL int archive_read_disk_set_symlink_physical(struct archive *);
966 /* Follow symlink initially, then not. */
967 __LA_DECL int archive_read_disk_set_symlink_hybrid(struct archive *);
968 /* TODO: Handle Linux stat32/stat64 ugliness. <sigh> */
969 __LA_DECL int archive_read_disk_entry_from_file(struct archive *,
970  struct archive_entry *, int /* fd */, const struct stat *);
971 /* Look up gname for gid or uname for uid. */
972 /* Default implementations are very, very stupid. */
973 __LA_DECL const char *archive_read_disk_gname(struct archive *, la_int64_t);
974 __LA_DECL const char *archive_read_disk_uname(struct archive *, la_int64_t);
975 /* "Standard" implementation uses getpwuid_r, getgrgid_r and caches the
976  * results for performance. */
977 __LA_DECL int archive_read_disk_set_standard_lookup(struct archive *);
978 /* You can install your own lookups if you like. */
979 __LA_DECL int archive_read_disk_set_gname_lookup(struct archive *,
980  void * /* private_data */,
981  const char *(* /* lookup_fn */)(void *, la_int64_t),
982  void (* /* cleanup_fn */)(void *));
983 __LA_DECL int archive_read_disk_set_uname_lookup(struct archive *,
984  void * /* private_data */,
985  const char *(* /* lookup_fn */)(void *, la_int64_t),
986  void (* /* cleanup_fn */)(void *));
987 /* Start traversal. */
988 __LA_DECL int archive_read_disk_open(struct archive *, const char *);
989 __LA_DECL int archive_read_disk_open_w(struct archive *, const wchar_t *);
990 /*
991  * Request that current entry be visited. If you invoke it on every
992  * directory, you'll get a physical traversal. This is ignored if the
993  * current entry isn't a directory or a link to a directory. So, if
994  * you invoke this on every returned path, you'll get a full logical
995  * traversal.
996  */
997 __LA_DECL int archive_read_disk_descend(struct archive *);
998 __LA_DECL int archive_read_disk_can_descend(struct archive *);
999 __LA_DECL int archive_read_disk_current_filesystem(struct archive *);
1000 __LA_DECL int archive_read_disk_current_filesystem_is_synthetic(struct archive *);
1001 __LA_DECL int archive_read_disk_current_filesystem_is_remote(struct archive *);
1002 /* Request that the access time of the entry visited by traversal be restored. */
1003 __LA_DECL int archive_read_disk_set_atime_restored(struct archive *);
1004 /*
1005  * Set behavior. The "flags" argument selects optional behavior.
1006  */
1007 /* Request that the access time of the entry visited by traversal be restored.
1008  * This is the same as archive_read_disk_set_atime_restored. */
1009 #define ARCHIVE_READDISK_RESTORE_ATIME (0x0001)
1010 /* Default: Do not skip an entry which has nodump flags. */
1011 #define ARCHIVE_READDISK_HONOR_NODUMP (0x0002)
1012 /* Default: Skip a mac resource fork file whose prefix is "._" because of
1013  * using copyfile. */
1014 #define ARCHIVE_READDISK_MAC_COPYFILE (0x0004)
1015 /* Default: Traverse mount points. */
1016 #define ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS (0x0008)
1017 /* Default: Xattrs are read from disk. */
1018 #define ARCHIVE_READDISK_NO_XATTR (0x0010)
1019 /* Default: ACLs are read from disk. */
1020 #define ARCHIVE_READDISK_NO_ACL (0x0020)
1021 /* Default: File flags are read from disk. */
1022 #define ARCHIVE_READDISK_NO_FFLAGS (0x0040)
1023 
1024 __LA_DECL int archive_read_disk_set_behavior(struct archive *,
1025  int flags);
1026 
1027 /*
1028  * Set archive_match object that will be used in archive_read_disk to
1029  * know whether an entry should be skipped. The callback function
1030  * _excluded_func will be invoked when an entry is skipped by the result
1031  * of archive_match.
1032  */
1033 __LA_DECL int archive_read_disk_set_matching(struct archive *,
1034  struct archive *_matching, void (*_excluded_func)
1035  (struct archive *, void *, struct archive_entry *),
1036  void *_client_data);
1037 __LA_DECL int archive_read_disk_set_metadata_filter_callback(struct archive *,
1038  int (*_metadata_filter_func)(struct archive *, void *,
1039  struct archive_entry *), void *_client_data);
1040 
1041 /* Simplified cleanup interface;
1042  * This calls archive_read_free() or archive_write_free() as needed. */
1043 __LA_DECL int archive_free(struct archive *);
1044 
1045 /*
1046  * Accessor functions to read/set various information in
1047  * the struct archive object:
1048  */
1049 
1050 /* Number of filters in the current filter pipeline. */
1051 /* Filter #0 is the one closest to the format, -1 is a synonym for the
1052  * last filter, which is always the pseudo-filter that wraps the
1053  * client callbacks. */
1054 __LA_DECL int archive_filter_count(struct archive *);
1055 __LA_DECL la_int64_t archive_filter_bytes(struct archive *, int);
1056 __LA_DECL int archive_filter_code(struct archive *, int);
1057 __LA_DECL const char * archive_filter_name(struct archive *, int);
1058 
1059 #if ARCHIVE_VERSION_NUMBER < 4000000
1060 /* These don't properly handle multiple filters, so are deprecated and
1061  * will eventually be removed. */
1062 /* As of libarchive 3.0, this is an alias for archive_filter_bytes(a, -1); */
1063 __LA_DECL la_int64_t archive_position_compressed(struct archive *)
1064  __LA_DEPRECATED;
1065 /* As of libarchive 3.0, this is an alias for archive_filter_bytes(a, 0); */
1066 __LA_DECL la_int64_t archive_position_uncompressed(struct archive *)
1067  __LA_DEPRECATED;
1068 /* As of libarchive 3.0, this is an alias for archive_filter_name(a, 0); */
1069 __LA_DECL const char *archive_compression_name(struct archive *)
1070  __LA_DEPRECATED;
1071 /* As of libarchive 3.0, this is an alias for archive_filter_code(a, 0); */
1072 __LA_DECL int archive_compression(struct archive *)
1073  __LA_DEPRECATED;
1074 #endif
1075 
1076 __LA_DECL int archive_errno(struct archive *);
1077 __LA_DECL const char *archive_error_string(struct archive *);
1078 __LA_DECL const char *archive_format_name(struct archive *);
1079 __LA_DECL int archive_format(struct archive *);
1080 __LA_DECL void archive_clear_error(struct archive *);
1081 __LA_DECL void archive_set_error(struct archive *, int _err,
1082  const char *fmt, ...) __LA_PRINTF(3, 4);
1083 __LA_DECL void archive_copy_error(struct archive *dest,
1084  struct archive *src);
1085 __LA_DECL int archive_file_count(struct archive *);
1086 
1087 /*
1088  * ARCHIVE_MATCH API
1089  */
1090 __LA_DECL struct archive *archive_match_new(void);
1091 __LA_DECL int archive_match_free(struct archive *);
1092 
1093 /*
1094  * Test if archive_entry is excluded.
1095  * This is a convenience function. This is the same as calling all
1096  * archive_match_path_excluded, archive_match_time_excluded
1097  * and archive_match_owner_excluded.
1098  */
1099 __LA_DECL int archive_match_excluded(struct archive *,
1100  struct archive_entry *);
1101 
1102 /*
1103  * Test if pathname is excluded. The conditions are set by following functions.
1104  */
1105 __LA_DECL int archive_match_path_excluded(struct archive *,
1106  struct archive_entry *);
1107 /* Control recursive inclusion of directory content when directory is included. Default on. */
1108 __LA_DECL int archive_match_set_inclusion_recursion(struct archive *, int);
1109 /* Add exclusion pathname pattern. */
1110 __LA_DECL int archive_match_exclude_pattern(struct archive *, const char *);
1111 __LA_DECL int archive_match_exclude_pattern_w(struct archive *,
1112  const wchar_t *);
1113 /* Add exclusion pathname pattern from file. */
1114 __LA_DECL int archive_match_exclude_pattern_from_file(struct archive *,
1115  const char *, int _nullSeparator);
1116 __LA_DECL int archive_match_exclude_pattern_from_file_w(struct archive *,
1117  const wchar_t *, int _nullSeparator);
1118 /* Add inclusion pathname pattern. */
1119 __LA_DECL int archive_match_include_pattern(struct archive *, const char *);
1120 __LA_DECL int archive_match_include_pattern_w(struct archive *,
1121  const wchar_t *);
1122 /* Add inclusion pathname pattern from file. */
1123 __LA_DECL int archive_match_include_pattern_from_file(struct archive *,
1124  const char *, int _nullSeparator);
1125 __LA_DECL int archive_match_include_pattern_from_file_w(struct archive *,
1126  const wchar_t *, int _nullSeparator);
1127 /*
1128  * How to get statistic information for inclusion patterns.
1129  */
1130 /* Return the amount number of unmatched inclusion patterns. */
1131 __LA_DECL int archive_match_path_unmatched_inclusions(struct archive *);
1132 /* Return the pattern of unmatched inclusion with ARCHIVE_OK.
1133  * Return ARCHIVE_EOF if there is no inclusion pattern. */
1134 __LA_DECL int archive_match_path_unmatched_inclusions_next(
1135  struct archive *, const char **);
1136 __LA_DECL int archive_match_path_unmatched_inclusions_next_w(
1137  struct archive *, const wchar_t **);
1138 
1139 /*
1140  * Test if a file is excluded by its time stamp.
1141  * The conditions are set by following functions.
1142  */
1143 __LA_DECL int archive_match_time_excluded(struct archive *,
1144  struct archive_entry *);
1145 
1146 /*
1147  * Flags to tell a matching type of time stamps. These are used for
1148  * following functions.
1149  */
1150 /* Time flag: mtime to be tested. */
1151 #define ARCHIVE_MATCH_MTIME (0x0100)
1152 /* Time flag: ctime to be tested. */
1153 #define ARCHIVE_MATCH_CTIME (0x0200)
1154 /* Comparison flag: Match the time if it is newer than. */
1155 #define ARCHIVE_MATCH_NEWER (0x0001)
1156 /* Comparison flag: Match the time if it is older than. */
1157 #define ARCHIVE_MATCH_OLDER (0x0002)
1158 /* Comparison flag: Match the time if it is equal to. */
1159 #define ARCHIVE_MATCH_EQUAL (0x0010)
1160 /* Set inclusion time. */
1161 __LA_DECL int archive_match_include_time(struct archive *, int _flag,
1162  time_t _sec, long _nsec);
1163 /* Set inclusion time by a date string. */
1164 __LA_DECL int archive_match_include_date(struct archive *, int _flag,
1165  const char *_datestr);
1166 __LA_DECL int archive_match_include_date_w(struct archive *, int _flag,
1167  const wchar_t *_datestr);
1168 /* Set inclusion time by a particular file. */
1169 __LA_DECL int archive_match_include_file_time(struct archive *,
1170  int _flag, const char *_pathname);
1171 __LA_DECL int archive_match_include_file_time_w(struct archive *,
1172  int _flag, const wchar_t *_pathname);
1173 /* Add exclusion entry. */
1174 __LA_DECL int archive_match_exclude_entry(struct archive *,
1175  int _flag, struct archive_entry *);
1176 
1177 /*
1178  * Test if a file is excluded by its uid ,gid, uname or gname.
1179  * The conditions are set by following functions.
1180  */
1181 __LA_DECL int archive_match_owner_excluded(struct archive *,
1182  struct archive_entry *);
1183 /* Add inclusion uid, gid, uname and gname. */
1184 __LA_DECL int archive_match_include_uid(struct archive *, la_int64_t);
1185 __LA_DECL int archive_match_include_gid(struct archive *, la_int64_t);
1186 __LA_DECL int archive_match_include_uname(struct archive *, const char *);
1187 __LA_DECL int archive_match_include_uname_w(struct archive *,
1188  const wchar_t *);
1189 __LA_DECL int archive_match_include_gname(struct archive *, const char *);
1190 __LA_DECL int archive_match_include_gname_w(struct archive *,
1191  const wchar_t *);
1192 
1193 /* Utility functions */
1194 /* Convenience function to sort a NULL terminated list of strings */
1195 __LA_DECL int archive_utility_string_sort(char **);
1196 
1197 #ifdef __cplusplus
1198 }
1199 #endif
1200 
1201 /* These are meaningless outside of this header. */
1202 #undef __LA_DECL
1203 
1204 #endif /* !ARCHIVE_H_INCLUDED */
+
1 /*-
+
2  * Copyright (c) 2003-2010 Tim Kientzle
+
3  * All rights reserved.
+
4  *
+
5  * Redistribution and use in source and binary forms, with or without
+
6  * modification, are permitted provided that the following conditions
+
7  * are met:
+
8  * 1. Redistributions of source code must retain the above copyright
+
9  * notice, this list of conditions and the following disclaimer.
+
10  * 2. Redistributions in binary form must reproduce the above copyright
+
11  * notice, this list of conditions and the following disclaimer in the
+
12  * documentation and/or other materials provided with the distribution.
+
13  *
+
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+
15  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+
16  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+
17  * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+
18  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+
19  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+
20  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+
21  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+
23  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
24  *
+
25  * $FreeBSD: src/lib/libarchive/archive.h.in,v 1.50 2008/05/26 17:00:22 kientzle Exp $
+
26  */
+
27 
+
28 #ifndef ARCHIVE_H_INCLUDED
+
29 #define ARCHIVE_H_INCLUDED
+
30 
+
31 /*
+
32  * The version number is expressed as a single integer that makes it
+
33  * easy to compare versions at build time: for version a.b.c, the
+
34  * version number is printf("%d%03d%03d",a,b,c). For example, if you
+
35  * know your application requires version 2.12.108 or later, you can
+
36  * assert that ARCHIVE_VERSION_NUMBER >= 2012108.
+
37  */
+
38 /* Note: Compiler will complain if this does not match archive_entry.h! */
+
39 #define ARCHIVE_VERSION_NUMBER 3005002
+
40 
+
41 #include <sys/stat.h>
+
42 #include <stddef.h> /* for wchar_t */
+
43 #include <stdio.h> /* For FILE * */
+
44 #include <time.h> /* For time_t */
+
45 
+
46 /*
+
47  * Note: archive.h is for use outside of libarchive; the configuration
+
48  * headers (config.h, archive_platform.h, etc.) are purely internal.
+
49  * Do NOT use HAVE_XXX configuration macros to control the behavior of
+
50  * this header! If you must conditionalize, use predefined compiler and/or
+
51  * platform macros.
+
52  */
+
53 #if defined(__BORLANDC__) && __BORLANDC__ >= 0x560
+
54 # include <stdint.h>
+
55 #elif !defined(__WATCOMC__) && !defined(_MSC_VER) && !defined(__INTERIX) && !defined(__BORLANDC__) && !defined(_SCO_DS) && !defined(__osf__) && !defined(__CLANG_INTTYPES_H)
+
56 # include <inttypes.h>
+
57 #endif
+
58 
+
59 /* Get appropriate definitions of 64-bit integer */
+
60 #if !defined(__LA_INT64_T_DEFINED)
+
61 /* Older code relied on the __LA_INT64_T macro; after 4.0 we'll switch to the typedef exclusively. */
+
62 # if ARCHIVE_VERSION_NUMBER < 4000000
+
63 #define __LA_INT64_T la_int64_t
+
64 # endif
+
65 #define __LA_INT64_T_DEFINED
+
66 # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
+
67 typedef __int64 la_int64_t;
+
68 # else
+
69 # include <unistd.h> /* ssize_t */
+
70 # if defined(_SCO_DS) || defined(__osf__)
+
71 typedef long long la_int64_t;
+
72 # else
+
73 typedef int64_t la_int64_t;
+
74 # endif
+
75 # endif
+
76 #endif
+
77 
+
78 /* The la_ssize_t should match the type used in 'struct stat' */
+
79 #if !defined(__LA_SSIZE_T_DEFINED)
+
80 /* Older code relied on the __LA_SSIZE_T macro; after 4.0 we'll switch to the typedef exclusively. */
+
81 # if ARCHIVE_VERSION_NUMBER < 4000000
+
82 #define __LA_SSIZE_T la_ssize_t
+
83 # endif
+
84 #define __LA_SSIZE_T_DEFINED
+
85 # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
+
86 # if defined(_SSIZE_T_DEFINED) || defined(_SSIZE_T_)
+
87 typedef ssize_t la_ssize_t;
+
88 # elif defined(_WIN64)
+
89 typedef __int64 la_ssize_t;
+
90 # else
+
91 typedef long la_ssize_t;
+
92 # endif
+
93 # else
+
94 # include <unistd.h> /* ssize_t */
+
95 typedef ssize_t la_ssize_t;
+
96 # endif
+
97 #endif
+
98 
+
99 /* Large file support for Android */
+
100 #ifdef __ANDROID__
+
101 #include "android_lf.h"
+
102 #endif
+
103 
+
104 /*
+
105  * On Windows, define LIBARCHIVE_STATIC if you're building or using a
+
106  * .lib. The default here assumes you're building a DLL. Only
+
107  * libarchive source should ever define __LIBARCHIVE_BUILD.
+
108  */
+
109 #if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC)
+
110 # ifdef __LIBARCHIVE_BUILD
+
111 # ifdef __GNUC__
+
112 # define __LA_DECL __attribute__((dllexport)) extern
+
113 # else
+
114 # define __LA_DECL __declspec(dllexport)
+
115 # endif
+
116 # else
+
117 # ifdef __GNUC__
+
118 # define __LA_DECL
+
119 # else
+
120 # define __LA_DECL __declspec(dllimport)
+
121 # endif
+
122 # endif
+
123 #else
+
124 /* Static libraries or non-Windows needs no special declaration. */
+
125 # define __LA_DECL
+
126 #endif
+
127 
+
128 #if defined(__GNUC__) && __GNUC__ >= 3 && !defined(__MINGW32__)
+
129 #define __LA_PRINTF(fmtarg, firstvararg) \
+
130  __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
+
131 #else
+
132 #define __LA_PRINTF(fmtarg, firstvararg) /* nothing */
+
133 #endif
+
134 
+
135 #if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1
+
136 # define __LA_DEPRECATED __attribute__((deprecated))
+
137 #else
+
138 # define __LA_DEPRECATED
+
139 #endif
+
140 
+
141 #ifdef __cplusplus
+
142 extern "C" {
+
143 #endif
+
144 
+
145 /*
+
146  * The version number is provided as both a macro and a function.
+
147  * The macro identifies the installed header; the function identifies
+
148  * the library version (which may not be the same if you're using a
+
149  * dynamically-linked version of the library). Of course, if the
+
150  * header and library are very different, you should expect some
+
151  * strangeness. Don't do that.
+
152  */
+
153 __LA_DECL int archive_version_number(void);
+
154 
+
155 /*
+
156  * Textual name/version of the library, useful for version displays.
+
157  */
+
158 #define ARCHIVE_VERSION_ONLY_STRING "3.5.2dev"
+
159 #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
+
160 __LA_DECL const char * archive_version_string(void);
+
161 
+
162 /*
+
163  * Detailed textual name/version of the library and its dependencies.
+
164  * This has the form:
+
165  * "libarchive x.y.z zlib/a.b.c liblzma/d.e.f ... etc ..."
+
166  * the list of libraries described here will vary depending on how
+
167  * libarchive was compiled.
+
168  */
+
169 __LA_DECL const char * archive_version_details(void);
+
170 
+
171 /*
+
172  * Returns NULL if libarchive was compiled without the associated library.
+
173  * Otherwise, returns the version number that libarchive was compiled
+
174  * against.
+
175  */
+
176 __LA_DECL const char * archive_zlib_version(void);
+
177 __LA_DECL const char * archive_liblzma_version(void);
+
178 __LA_DECL const char * archive_bzlib_version(void);
+
179 __LA_DECL const char * archive_liblz4_version(void);
+
180 __LA_DECL const char * archive_libzstd_version(void);
+
181 
+
182 /* Declare our basic types. */
+
183 struct archive;
+
184 struct archive_entry;
+
185 
+
186 /*
+
187  * Error codes: Use archive_errno() and archive_error_string()
+
188  * to retrieve details. Unless specified otherwise, all functions
+
189  * that return 'int' use these codes.
+
190  */
+
191 #define ARCHIVE_EOF 1 /* Found end of archive. */
+
192 #define ARCHIVE_OK 0 /* Operation was successful. */
+
193 #define ARCHIVE_RETRY (-10) /* Retry might succeed. */
+
194 #define ARCHIVE_WARN (-20) /* Partial success. */
+
195 /* For example, if write_header "fails", then you can't push data. */
+
196 #define ARCHIVE_FAILED (-25) /* Current operation cannot complete. */
+
197 /* But if write_header is "fatal," then this archive is dead and useless. */
+
198 #define ARCHIVE_FATAL (-30) /* No more operations are possible. */
+
199 
+
200 /*
+
201  * As far as possible, archive_errno returns standard platform errno codes.
+
202  * Of course, the details vary by platform, so the actual definitions
+
203  * here are stored in "archive_platform.h". The symbols are listed here
+
204  * for reference; as a rule, clients should not need to know the exact
+
205  * platform-dependent error code.
+
206  */
+
207 /* Unrecognized or invalid file format. */
+
208 /* #define ARCHIVE_ERRNO_FILE_FORMAT */
+
209 /* Illegal usage of the library. */
+
210 /* #define ARCHIVE_ERRNO_PROGRAMMER_ERROR */
+
211 /* Unknown or unclassified error. */
+
212 /* #define ARCHIVE_ERRNO_MISC */
+
213 
+
214 /*
+
215  * Callbacks are invoked to automatically read/skip/write/open/close the
+
216  * archive. You can provide your own for complex tasks (like breaking
+
217  * archives across multiple tapes) or use standard ones built into the
+
218  * library.
+
219  */
+
220 
+
221 /* Returns pointer and size of next block of data from archive. */
+
222 typedef la_ssize_t archive_read_callback(struct archive *,
+
223  void *_client_data, const void **_buffer);
+
224 
+
225 /* Skips at most request bytes from archive and returns the skipped amount.
+
226  * This may skip fewer bytes than requested; it may even skip zero bytes.
+
227  * If you do skip fewer bytes than requested, libarchive will invoke your
+
228  * read callback and discard data as necessary to make up the full skip.
+
229  */
+
230 typedef la_int64_t archive_skip_callback(struct archive *,
+
231  void *_client_data, la_int64_t request);
+
232 
+
233 /* Seeks to specified location in the file and returns the position.
+
234  * Whence values are SEEK_SET, SEEK_CUR, SEEK_END from stdio.h.
+
235  * Return ARCHIVE_FATAL if the seek fails for any reason.
+
236  */
+
237 typedef la_int64_t archive_seek_callback(struct archive *,
+
238  void *_client_data, la_int64_t offset, int whence);
+
239 
+
240 /* Returns size actually written, zero on EOF, -1 on error. */
+
241 typedef la_ssize_t archive_write_callback(struct archive *,
+
242  void *_client_data,
+
243  const void *_buffer, size_t _length);
+
244 
+
245 typedef int archive_open_callback(struct archive *, void *_client_data);
+
246 
+
247 typedef int archive_close_callback(struct archive *, void *_client_data);
+
248 
+
249 typedef int archive_free_callback(struct archive *, void *_client_data);
+
250 
+
251 /* Switches from one client data object to the next/prev client data object.
+
252  * This is useful for reading from different data blocks such as a set of files
+
253  * that make up one large file.
+
254  */
+
255 typedef int archive_switch_callback(struct archive *, void *_client_data1,
+
256  void *_client_data2);
+
257 
+
258 /*
+
259  * Returns a passphrase used for encryption or decryption, NULL on nothing
+
260  * to do and give it up.
+
261  */
+
262 typedef const char *archive_passphrase_callback(struct archive *,
+
263  void *_client_data);
+
264 
+
265 /*
+
266  * Codes to identify various stream filters.
+
267  */
+
268 #define ARCHIVE_FILTER_NONE 0
+
269 #define ARCHIVE_FILTER_GZIP 1
+
270 #define ARCHIVE_FILTER_BZIP2 2
+
271 #define ARCHIVE_FILTER_COMPRESS 3
+
272 #define ARCHIVE_FILTER_PROGRAM 4
+
273 #define ARCHIVE_FILTER_LZMA 5
+
274 #define ARCHIVE_FILTER_XZ 6
+
275 #define ARCHIVE_FILTER_UU 7
+
276 #define ARCHIVE_FILTER_RPM 8
+
277 #define ARCHIVE_FILTER_LZIP 9
+
278 #define ARCHIVE_FILTER_LRZIP 10
+
279 #define ARCHIVE_FILTER_LZOP 11
+
280 #define ARCHIVE_FILTER_GRZIP 12
+
281 #define ARCHIVE_FILTER_LZ4 13
+
282 #define ARCHIVE_FILTER_ZSTD 14
+
283 
+
284 #if ARCHIVE_VERSION_NUMBER < 4000000
+
285 #define ARCHIVE_COMPRESSION_NONE ARCHIVE_FILTER_NONE
+
286 #define ARCHIVE_COMPRESSION_GZIP ARCHIVE_FILTER_GZIP
+
287 #define ARCHIVE_COMPRESSION_BZIP2 ARCHIVE_FILTER_BZIP2
+
288 #define ARCHIVE_COMPRESSION_COMPRESS ARCHIVE_FILTER_COMPRESS
+
289 #define ARCHIVE_COMPRESSION_PROGRAM ARCHIVE_FILTER_PROGRAM
+
290 #define ARCHIVE_COMPRESSION_LZMA ARCHIVE_FILTER_LZMA
+
291 #define ARCHIVE_COMPRESSION_XZ ARCHIVE_FILTER_XZ
+
292 #define ARCHIVE_COMPRESSION_UU ARCHIVE_FILTER_UU
+
293 #define ARCHIVE_COMPRESSION_RPM ARCHIVE_FILTER_RPM
+
294 #define ARCHIVE_COMPRESSION_LZIP ARCHIVE_FILTER_LZIP
+
295 #define ARCHIVE_COMPRESSION_LRZIP ARCHIVE_FILTER_LRZIP
+
296 #endif
+
297 
+
298 /*
+
299  * Codes returned by archive_format.
+
300  *
+
301  * Top 16 bits identifies the format family (e.g., "tar"); lower
+
302  * 16 bits indicate the variant. This is updated by read_next_header.
+
303  * Note that the lower 16 bits will often vary from entry to entry.
+
304  * In some cases, this variation occurs as libarchive learns more about
+
305  * the archive (for example, later entries might utilize extensions that
+
306  * weren't necessary earlier in the archive; in this case, libarchive
+
307  * will change the format code to indicate the extended format that
+
308  * was used). In other cases, it's because different tools have
+
309  * modified the archive and so different parts of the archive
+
310  * actually have slightly different formats. (Both tar and cpio store
+
311  * format codes in each entry, so it is quite possible for each
+
312  * entry to be in a different format.)
+
313  */
+
314 #define ARCHIVE_FORMAT_BASE_MASK 0xff0000
+
315 #define ARCHIVE_FORMAT_CPIO 0x10000
+
316 #define ARCHIVE_FORMAT_CPIO_POSIX (ARCHIVE_FORMAT_CPIO | 1)
+
317 #define ARCHIVE_FORMAT_CPIO_BIN_LE (ARCHIVE_FORMAT_CPIO | 2)
+
318 #define ARCHIVE_FORMAT_CPIO_BIN_BE (ARCHIVE_FORMAT_CPIO | 3)
+
319 #define ARCHIVE_FORMAT_CPIO_SVR4_NOCRC (ARCHIVE_FORMAT_CPIO | 4)
+
320 #define ARCHIVE_FORMAT_CPIO_SVR4_CRC (ARCHIVE_FORMAT_CPIO | 5)
+
321 #define ARCHIVE_FORMAT_CPIO_AFIO_LARGE (ARCHIVE_FORMAT_CPIO | 6)
+
322 #define ARCHIVE_FORMAT_CPIO_PWB (ARCHIVE_FORMAT_CPIO | 7)
+
323 #define ARCHIVE_FORMAT_SHAR 0x20000
+
324 #define ARCHIVE_FORMAT_SHAR_BASE (ARCHIVE_FORMAT_SHAR | 1)
+
325 #define ARCHIVE_FORMAT_SHAR_DUMP (ARCHIVE_FORMAT_SHAR | 2)
+
326 #define ARCHIVE_FORMAT_TAR 0x30000
+
327 #define ARCHIVE_FORMAT_TAR_USTAR (ARCHIVE_FORMAT_TAR | 1)
+
328 #define ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE (ARCHIVE_FORMAT_TAR | 2)
+
329 #define ARCHIVE_FORMAT_TAR_PAX_RESTRICTED (ARCHIVE_FORMAT_TAR | 3)
+
330 #define ARCHIVE_FORMAT_TAR_GNUTAR (ARCHIVE_FORMAT_TAR | 4)
+
331 #define ARCHIVE_FORMAT_ISO9660 0x40000
+
332 #define ARCHIVE_FORMAT_ISO9660_ROCKRIDGE (ARCHIVE_FORMAT_ISO9660 | 1)
+
333 #define ARCHIVE_FORMAT_ZIP 0x50000
+
334 #define ARCHIVE_FORMAT_EMPTY 0x60000
+
335 #define ARCHIVE_FORMAT_AR 0x70000
+
336 #define ARCHIVE_FORMAT_AR_GNU (ARCHIVE_FORMAT_AR | 1)
+
337 #define ARCHIVE_FORMAT_AR_BSD (ARCHIVE_FORMAT_AR | 2)
+
338 #define ARCHIVE_FORMAT_MTREE 0x80000
+
339 #define ARCHIVE_FORMAT_RAW 0x90000
+
340 #define ARCHIVE_FORMAT_XAR 0xA0000
+
341 #define ARCHIVE_FORMAT_LHA 0xB0000
+
342 #define ARCHIVE_FORMAT_CAB 0xC0000
+
343 #define ARCHIVE_FORMAT_RAR 0xD0000
+
344 #define ARCHIVE_FORMAT_7ZIP 0xE0000
+
345 #define ARCHIVE_FORMAT_WARC 0xF0000
+
346 #define ARCHIVE_FORMAT_RAR_V5 0x100000
+
347 
+
348 /*
+
349  * Codes returned by archive_read_format_capabilities().
+
350  *
+
351  * This list can be extended with values between 0 and 0xffff.
+
352  * The original purpose of this list was to let different archive
+
353  * format readers expose their general capabilities in terms of
+
354  * encryption.
+
355  */
+
356 #define ARCHIVE_READ_FORMAT_CAPS_NONE (0) /* no special capabilities */
+
357 #define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0) /* reader can detect encrypted data */
+
358 #define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1) /* reader can detect encryptable metadata (pathname, mtime, etc.) */
+
359 
+
360 /*
+
361  * Codes returned by archive_read_has_encrypted_entries().
+
362  *
+
363  * In case the archive does not support encryption detection at all
+
364  * ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED is returned. If the reader
+
365  * for some other reason (e.g. not enough bytes read) cannot say if
+
366  * there are encrypted entries, ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW
+
367  * is returned.
+
368  */
+
369 #define ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED -2
+
370 #define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
+
371 
+
372 /*-
+
373  * Basic outline for reading an archive:
+
374  * 1) Ask archive_read_new for an archive reader object.
+
375  * 2) Update any global properties as appropriate.
+
376  * In particular, you'll certainly want to call appropriate
+
377  * archive_read_support_XXX functions.
+
378  * 3) Call archive_read_open_XXX to open the archive
+
379  * 4) Repeatedly call archive_read_next_header to get information about
+
380  * successive archive entries. Call archive_read_data to extract
+
381  * data for entries of interest.
+
382  * 5) Call archive_read_free to end processing.
+
383  */
+
384 __LA_DECL struct archive *archive_read_new(void);
+
385 
+
386 /*
+
387  * The archive_read_support_XXX calls enable auto-detect for this
+
388  * archive handle. They also link in the necessary support code.
+
389  * For example, if you don't want bzlib linked in, don't invoke
+
390  * support_compression_bzip2(). The "all" functions provide the
+
391  * obvious shorthand.
+
392  */
+
393 
+
394 #if ARCHIVE_VERSION_NUMBER < 4000000
+
395 __LA_DECL int archive_read_support_compression_all(struct archive *)
+
396  __LA_DEPRECATED;
+
397 __LA_DECL int archive_read_support_compression_bzip2(struct archive *)
+
398  __LA_DEPRECATED;
+
399 __LA_DECL int archive_read_support_compression_compress(struct archive *)
+
400  __LA_DEPRECATED;
+
401 __LA_DECL int archive_read_support_compression_gzip(struct archive *)
+
402  __LA_DEPRECATED;
+
403 __LA_DECL int archive_read_support_compression_lzip(struct archive *)
+
404  __LA_DEPRECATED;
+
405 __LA_DECL int archive_read_support_compression_lzma(struct archive *)
+
406  __LA_DEPRECATED;
+
407 __LA_DECL int archive_read_support_compression_none(struct archive *)
+
408  __LA_DEPRECATED;
+
409 __LA_DECL int archive_read_support_compression_program(struct archive *,
+
410  const char *command) __LA_DEPRECATED;
+
411 __LA_DECL int archive_read_support_compression_program_signature
+
412  (struct archive *, const char *,
+
413  const void * /* match */, size_t) __LA_DEPRECATED;
+
414 
+
415 __LA_DECL int archive_read_support_compression_rpm(struct archive *)
+
416  __LA_DEPRECATED;
+
417 __LA_DECL int archive_read_support_compression_uu(struct archive *)
+
418  __LA_DEPRECATED;
+
419 __LA_DECL int archive_read_support_compression_xz(struct archive *)
+
420  __LA_DEPRECATED;
+
421 #endif
+
422 
+
423 __LA_DECL int archive_read_support_filter_all(struct archive *);
+
424 __LA_DECL int archive_read_support_filter_by_code(struct archive *, int);
+
425 __LA_DECL int archive_read_support_filter_bzip2(struct archive *);
+
426 __LA_DECL int archive_read_support_filter_compress(struct archive *);
+
427 __LA_DECL int archive_read_support_filter_gzip(struct archive *);
+
428 __LA_DECL int archive_read_support_filter_grzip(struct archive *);
+
429 __LA_DECL int archive_read_support_filter_lrzip(struct archive *);
+
430 __LA_DECL int archive_read_support_filter_lz4(struct archive *);
+
431 __LA_DECL int archive_read_support_filter_lzip(struct archive *);
+
432 __LA_DECL int archive_read_support_filter_lzma(struct archive *);
+
433 __LA_DECL int archive_read_support_filter_lzop(struct archive *);
+
434 __LA_DECL int archive_read_support_filter_none(struct archive *);
+
435 __LA_DECL int archive_read_support_filter_program(struct archive *,
+
436  const char *command);
+
437 __LA_DECL int archive_read_support_filter_program_signature
+
438  (struct archive *, const char * /* cmd */,
+
439  const void * /* match */, size_t);
+
440 __LA_DECL int archive_read_support_filter_rpm(struct archive *);
+
441 __LA_DECL int archive_read_support_filter_uu(struct archive *);
+
442 __LA_DECL int archive_read_support_filter_xz(struct archive *);
+
443 __LA_DECL int archive_read_support_filter_zstd(struct archive *);
+
444 
+
445 __LA_DECL int archive_read_support_format_7zip(struct archive *);
+
446 __LA_DECL int archive_read_support_format_all(struct archive *);
+
447 __LA_DECL int archive_read_support_format_ar(struct archive *);
+
448 __LA_DECL int archive_read_support_format_by_code(struct archive *, int);
+
449 __LA_DECL int archive_read_support_format_cab(struct archive *);
+
450 __LA_DECL int archive_read_support_format_cpio(struct archive *);
+
451 __LA_DECL int archive_read_support_format_empty(struct archive *);
+
452 __LA_DECL int archive_read_support_format_gnutar(struct archive *);
+
453 __LA_DECL int archive_read_support_format_iso9660(struct archive *);
+
454 __LA_DECL int archive_read_support_format_lha(struct archive *);
+
455 __LA_DECL int archive_read_support_format_mtree(struct archive *);
+
456 __LA_DECL int archive_read_support_format_rar(struct archive *);
+
457 __LA_DECL int archive_read_support_format_rar5(struct archive *);
+
458 __LA_DECL int archive_read_support_format_raw(struct archive *);
+
459 __LA_DECL int archive_read_support_format_tar(struct archive *);
+
460 __LA_DECL int archive_read_support_format_warc(struct archive *);
+
461 __LA_DECL int archive_read_support_format_xar(struct archive *);
+
462 /* archive_read_support_format_zip() enables both streamable and seekable
+
463  * zip readers. */
+
464 __LA_DECL int archive_read_support_format_zip(struct archive *);
+
465 /* Reads Zip archives as stream from beginning to end. Doesn't
+
466  * correctly handle SFX ZIP files or ZIP archives that have been modified
+
467  * in-place. */
+
468 __LA_DECL int archive_read_support_format_zip_streamable(struct archive *);
+
469 /* Reads starting from central directory; requires seekable input. */
+
470 __LA_DECL int archive_read_support_format_zip_seekable(struct archive *);
+
471 
+
472 /* Functions to manually set the format and filters to be used. This is
+
473  * useful to bypass the bidding process when the format and filters to use
+
474  * is known in advance.
+
475  */
+
476 __LA_DECL int archive_read_set_format(struct archive *, int);
+
477 __LA_DECL int archive_read_append_filter(struct archive *, int);
+
478 __LA_DECL int archive_read_append_filter_program(struct archive *,
+
479  const char *);
+
480 __LA_DECL int archive_read_append_filter_program_signature
+
481  (struct archive *, const char *, const void * /* match */, size_t);
+
482 
+
483 /* Set various callbacks. */
+
484 __LA_DECL int archive_read_set_open_callback(struct archive *,
+
485  archive_open_callback *);
+
486 __LA_DECL int archive_read_set_read_callback(struct archive *,
+
487  archive_read_callback *);
+
488 __LA_DECL int archive_read_set_seek_callback(struct archive *,
+
489  archive_seek_callback *);
+
490 __LA_DECL int archive_read_set_skip_callback(struct archive *,
+
491  archive_skip_callback *);
+
492 __LA_DECL int archive_read_set_close_callback(struct archive *,
+
493  archive_close_callback *);
+
494 /* Callback used to switch between one data object to the next */
+
495 __LA_DECL int archive_read_set_switch_callback(struct archive *,
+
496  archive_switch_callback *);
+
497 
+
498 /* This sets the first data object. */
+
499 __LA_DECL int archive_read_set_callback_data(struct archive *, void *);
+
500 /* This sets data object at specified index */
+
501 __LA_DECL int archive_read_set_callback_data2(struct archive *, void *,
+
502  unsigned int);
+
503 /* This adds a data object at the specified index. */
+
504 __LA_DECL int archive_read_add_callback_data(struct archive *, void *,
+
505  unsigned int);
+
506 /* This appends a data object to the end of list */
+
507 __LA_DECL int archive_read_append_callback_data(struct archive *, void *);
+
508 /* This prepends a data object to the beginning of list */
+
509 __LA_DECL int archive_read_prepend_callback_data(struct archive *, void *);
+
510 
+
511 /* Opening freezes the callbacks. */
+
512 __LA_DECL int archive_read_open1(struct archive *);
+
513 
+
514 /* Convenience wrappers around the above. */
+
515 __LA_DECL int archive_read_open(struct archive *, void *_client_data,
+
516  archive_open_callback *, archive_read_callback *,
+
517  archive_close_callback *);
+
518 __LA_DECL int archive_read_open2(struct archive *, void *_client_data,
+
519  archive_open_callback *, archive_read_callback *,
+
520  archive_skip_callback *, archive_close_callback *);
+
521 
+
522 /*
+
523  * A variety of shortcuts that invoke archive_read_open() with
+
524  * canned callbacks suitable for common situations. The ones that
+
525  * accept a block size handle tape blocking correctly.
+
526  */
+
527 /* Use this if you know the filename. Note: NULL indicates stdin. */
+
528 __LA_DECL int archive_read_open_filename(struct archive *,
+
529  const char *_filename, size_t _block_size);
+
530 /* Use this for reading multivolume files by filenames.
+
531  * NOTE: Must be NULL terminated. Sorting is NOT done. */
+
532 __LA_DECL int archive_read_open_filenames(struct archive *,
+
533  const char **_filenames, size_t _block_size);
+
534 __LA_DECL int archive_read_open_filename_w(struct archive *,
+
535  const wchar_t *_filename, size_t _block_size);
+
536 /* archive_read_open_file() is a deprecated synonym for ..._open_filename(). */
+
537 __LA_DECL int archive_read_open_file(struct archive *,
+
538  const char *_filename, size_t _block_size) __LA_DEPRECATED;
+
539 /* Read an archive that's stored in memory. */
+
540 __LA_DECL int archive_read_open_memory(struct archive *,
+
541  const void * buff, size_t size);
+
542 /* A more involved version that is only used for internal testing. */
+
543 __LA_DECL int archive_read_open_memory2(struct archive *a, const void *buff,
+
544  size_t size, size_t read_size);
+
545 /* Read an archive that's already open, using the file descriptor. */
+
546 __LA_DECL int archive_read_open_fd(struct archive *, int _fd,
+
547  size_t _block_size);
+
548 /* Read an archive that's already open, using a FILE *. */
+
549 /* Note: DO NOT use this with tape drives. */
+
550 __LA_DECL int archive_read_open_FILE(struct archive *, FILE *_file);
+
551 
+
552 /* Parses and returns next entry header. */
+
553 __LA_DECL int archive_read_next_header(struct archive *,
+
554  struct archive_entry **);
+
555 
+
556 /* Parses and returns next entry header using the archive_entry passed in */
+
557 __LA_DECL int archive_read_next_header2(struct archive *,
+
558  struct archive_entry *);
+
559 
+
560 /*
+
561  * Retrieve the byte offset in UNCOMPRESSED data where last-read
+
562  * header started.
+
563  */
+
564 __LA_DECL la_int64_t archive_read_header_position(struct archive *);
+
565 
+
566 /*
+
567  * Returns 1 if the archive contains at least one encrypted entry.
+
568  * If the archive format not support encryption at all
+
569  * ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED is returned.
+
570  * If for any other reason (e.g. not enough data read so far)
+
571  * we cannot say whether there are encrypted entries, then
+
572  * ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW is returned.
+
573  * In general, this function will return values below zero when the
+
574  * reader is uncertain or totally incapable of encryption support.
+
575  * When this function returns 0 you can be sure that the reader
+
576  * supports encryption detection but no encrypted entries have
+
577  * been found yet.
+
578  *
+
579  * NOTE: If the metadata/header of an archive is also encrypted, you
+
580  * cannot rely on the number of encrypted entries. That is why this
+
581  * function does not return the number of encrypted entries but#
+
582  * just shows that there are some.
+
583  */
+
584 __LA_DECL int archive_read_has_encrypted_entries(struct archive *);
+
585 
+
586 /*
+
587  * Returns a bitmask of capabilities that are supported by the archive format reader.
+
588  * If the reader has no special capabilities, ARCHIVE_READ_FORMAT_CAPS_NONE is returned.
+
589  */
+
590 __LA_DECL int archive_read_format_capabilities(struct archive *);
+
591 
+
592 /* Read data from the body of an entry. Similar to read(2). */
+
593 __LA_DECL la_ssize_t archive_read_data(struct archive *,
+
594  void *, size_t);
+
595 
+
596 /* Seek within the body of an entry. Similar to lseek(2). */
+
597 __LA_DECL la_int64_t archive_seek_data(struct archive *, la_int64_t, int);
+
598 
+
599 /*
+
600  * A zero-copy version of archive_read_data that also exposes the file offset
+
601  * of each returned block. Note that the client has no way to specify
+
602  * the desired size of the block. The API does guarantee that offsets will
+
603  * be strictly increasing and that returned blocks will not overlap.
+
604  */
+
605 __LA_DECL int archive_read_data_block(struct archive *a,
+
606  const void **buff, size_t *size, la_int64_t *offset);
+
607 
+
608 /*-
+
609  * Some convenience functions that are built on archive_read_data:
+
610  * 'skip': skips entire entry
+
611  * 'into_buffer': writes data into memory buffer that you provide
+
612  * 'into_fd': writes data to specified filedes
+
613  */
+
614 __LA_DECL int archive_read_data_skip(struct archive *);
+
615 __LA_DECL int archive_read_data_into_fd(struct archive *, int fd);
+
616 
+
617 /*
+
618  * Set read options.
+
619  */
+
620 /* Apply option to the format only. */
+
621 __LA_DECL int archive_read_set_format_option(struct archive *_a,
+
622  const char *m, const char *o,
+
623  const char *v);
+
624 /* Apply option to the filter only. */
+
625 __LA_DECL int archive_read_set_filter_option(struct archive *_a,
+
626  const char *m, const char *o,
+
627  const char *v);
+
628 /* Apply option to both the format and the filter. */
+
629 __LA_DECL int archive_read_set_option(struct archive *_a,
+
630  const char *m, const char *o,
+
631  const char *v);
+
632 /* Apply option string to both the format and the filter. */
+
633 __LA_DECL int archive_read_set_options(struct archive *_a,
+
634  const char *opts);
+
635 
+
636 /*
+
637  * Add a decryption passphrase.
+
638  */
+
639 __LA_DECL int archive_read_add_passphrase(struct archive *, const char *);
+
640 __LA_DECL int archive_read_set_passphrase_callback(struct archive *,
+
641  void *client_data, archive_passphrase_callback *);
+
642 
+
643 
+
644 /*-
+
645  * Convenience function to recreate the current entry (whose header
+
646  * has just been read) on disk.
+
647  *
+
648  * This does quite a bit more than just copy data to disk. It also:
+
649  * - Creates intermediate directories as required.
+
650  * - Manages directory permissions: non-writable directories will
+
651  * be initially created with write permission enabled; when the
+
652  * archive is closed, dir permissions are edited to the values specified
+
653  * in the archive.
+
654  * - Checks hardlinks: hardlinks will not be extracted unless the
+
655  * linked-to file was also extracted within the same session. (TODO)
+
656  */
+
657 
+
658 /* The "flags" argument selects optional behavior, 'OR' the flags you want. */
+
659 
+
660 /* Default: Do not try to set owner/group. */
+
661 #define ARCHIVE_EXTRACT_OWNER (0x0001)
+
662 /* Default: Do obey umask, do not restore SUID/SGID/SVTX bits. */
+
663 #define ARCHIVE_EXTRACT_PERM (0x0002)
+
664 /* Default: Do not restore mtime/atime. */
+
665 #define ARCHIVE_EXTRACT_TIME (0x0004)
+
666 /* Default: Replace existing files. */
+
667 #define ARCHIVE_EXTRACT_NO_OVERWRITE (0x0008)
+
668 /* Default: Try create first, unlink only if create fails with EEXIST. */
+
669 #define ARCHIVE_EXTRACT_UNLINK (0x0010)
+
670 /* Default: Do not restore ACLs. */
+
671 #define ARCHIVE_EXTRACT_ACL (0x0020)
+
672 /* Default: Do not restore fflags. */
+
673 #define ARCHIVE_EXTRACT_FFLAGS (0x0040)
+
674 /* Default: Do not restore xattrs. */
+
675 #define ARCHIVE_EXTRACT_XATTR (0x0080)
+
676 /* Default: Do not try to guard against extracts redirected by symlinks. */
+
677 /* Note: With ARCHIVE_EXTRACT_UNLINK, will remove any intermediate symlink. */
+
678 #define ARCHIVE_EXTRACT_SECURE_SYMLINKS (0x0100)
+
679 /* Default: Do not reject entries with '..' as path elements. */
+
680 #define ARCHIVE_EXTRACT_SECURE_NODOTDOT (0x0200)
+
681 /* Default: Create parent directories as needed. */
+
682 #define ARCHIVE_EXTRACT_NO_AUTODIR (0x0400)
+
683 /* Default: Overwrite files, even if one on disk is newer. */
+
684 #define ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER (0x0800)
+
685 /* Detect blocks of 0 and write holes instead. */
+
686 #define ARCHIVE_EXTRACT_SPARSE (0x1000)
+
687 /* Default: Do not restore Mac extended metadata. */
+
688 /* This has no effect except on Mac OS. */
+
689 #define ARCHIVE_EXTRACT_MAC_METADATA (0x2000)
+
690 /* Default: Use HFS+ compression if it was compressed. */
+
691 /* This has no effect except on Mac OS v10.6 or later. */
+
692 #define ARCHIVE_EXTRACT_NO_HFS_COMPRESSION (0x4000)
+
693 /* Default: Do not use HFS+ compression if it was not compressed. */
+
694 /* This has no effect except on Mac OS v10.6 or later. */
+
695 #define ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED (0x8000)
+
696 /* Default: Do not reject entries with absolute paths */
+
697 #define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x10000)
+
698 /* Default: Do not clear no-change flags when unlinking object */
+
699 #define ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS (0x20000)
+
700 /* Default: Do not extract atomically (using rename) */
+
701 #define ARCHIVE_EXTRACT_SAFE_WRITES (0x40000)
+
702 
+
703 __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *,
+
704  int flags);
+
705 __LA_DECL int archive_read_extract2(struct archive *, struct archive_entry *,
+
706  struct archive * /* dest */);
+
707 __LA_DECL void archive_read_extract_set_progress_callback(struct archive *,
+
708  void (*_progress_func)(void *), void *_user_data);
+
709 
+
710 /* Record the dev/ino of a file that will not be written. This is
+
711  * generally set to the dev/ino of the archive being read. */
+
712 __LA_DECL void archive_read_extract_set_skip_file(struct archive *,
+
713  la_int64_t, la_int64_t);
+
714 
+
715 /* Close the file and release most resources. */
+
716 __LA_DECL int archive_read_close(struct archive *);
+
717 /* Release all resources and destroy the object. */
+
718 /* Note that archive_read_free will call archive_read_close for you. */
+
719 __LA_DECL int archive_read_free(struct archive *);
+
720 #if ARCHIVE_VERSION_NUMBER < 4000000
+
721 /* Synonym for archive_read_free() for backwards compatibility. */
+
722 __LA_DECL int archive_read_finish(struct archive *) __LA_DEPRECATED;
+
723 #endif
+
724 
+
725 /*-
+
726  * To create an archive:
+
727  * 1) Ask archive_write_new for an archive writer object.
+
728  * 2) Set any global properties. In particular, you should set
+
729  * the compression and format to use.
+
730  * 3) Call archive_write_open to open the file (most people
+
731  * will use archive_write_open_file or archive_write_open_fd,
+
732  * which provide convenient canned I/O callbacks for you).
+
733  * 4) For each entry:
+
734  * - construct an appropriate struct archive_entry structure
+
735  * - archive_write_header to write the header
+
736  * - archive_write_data to write the entry data
+
737  * 5) archive_write_close to close the output
+
738  * 6) archive_write_free to cleanup the writer and release resources
+
739  */
+
740 __LA_DECL struct archive *archive_write_new(void);
+
741 __LA_DECL int archive_write_set_bytes_per_block(struct archive *,
+
742  int bytes_per_block);
+
743 __LA_DECL int archive_write_get_bytes_per_block(struct archive *);
+
744 /* XXX This is badly misnamed; suggestions appreciated. XXX */
+
745 __LA_DECL int archive_write_set_bytes_in_last_block(struct archive *,
+
746  int bytes_in_last_block);
+
747 __LA_DECL int archive_write_get_bytes_in_last_block(struct archive *);
+
748 
+
749 /* The dev/ino of a file that won't be archived. This is used
+
750  * to avoid recursively adding an archive to itself. */
+
751 __LA_DECL int archive_write_set_skip_file(struct archive *,
+
752  la_int64_t, la_int64_t);
+
753 
+
754 #if ARCHIVE_VERSION_NUMBER < 4000000
+
755 __LA_DECL int archive_write_set_compression_bzip2(struct archive *)
+
756  __LA_DEPRECATED;
+
757 __LA_DECL int archive_write_set_compression_compress(struct archive *)
+
758  __LA_DEPRECATED;
+
759 __LA_DECL int archive_write_set_compression_gzip(struct archive *)
+
760  __LA_DEPRECATED;
+
761 __LA_DECL int archive_write_set_compression_lzip(struct archive *)
+
762  __LA_DEPRECATED;
+
763 __LA_DECL int archive_write_set_compression_lzma(struct archive *)
+
764  __LA_DEPRECATED;
+
765 __LA_DECL int archive_write_set_compression_none(struct archive *)
+
766  __LA_DEPRECATED;
+
767 __LA_DECL int archive_write_set_compression_program(struct archive *,
+
768  const char *cmd) __LA_DEPRECATED;
+
769 __LA_DECL int archive_write_set_compression_xz(struct archive *)
+
770  __LA_DEPRECATED;
+
771 #endif
+
772 
+
773 /* A convenience function to set the filter based on the code. */
+
774 __LA_DECL int archive_write_add_filter(struct archive *, int filter_code);
+
775 __LA_DECL int archive_write_add_filter_by_name(struct archive *,
+
776  const char *name);
+
777 __LA_DECL int archive_write_add_filter_b64encode(struct archive *);
+
778 __LA_DECL int archive_write_add_filter_bzip2(struct archive *);
+
779 __LA_DECL int archive_write_add_filter_compress(struct archive *);
+
780 __LA_DECL int archive_write_add_filter_grzip(struct archive *);
+
781 __LA_DECL int archive_write_add_filter_gzip(struct archive *);
+
782 __LA_DECL int archive_write_add_filter_lrzip(struct archive *);
+
783 __LA_DECL int archive_write_add_filter_lz4(struct archive *);
+
784 __LA_DECL int archive_write_add_filter_lzip(struct archive *);
+
785 __LA_DECL int archive_write_add_filter_lzma(struct archive *);
+
786 __LA_DECL int archive_write_add_filter_lzop(struct archive *);
+
787 __LA_DECL int archive_write_add_filter_none(struct archive *);
+
788 __LA_DECL int archive_write_add_filter_program(struct archive *,
+
789  const char *cmd);
+
790 __LA_DECL int archive_write_add_filter_uuencode(struct archive *);
+
791 __LA_DECL int archive_write_add_filter_xz(struct archive *);
+
792 __LA_DECL int archive_write_add_filter_zstd(struct archive *);
+
793 
+
794 
+
795 /* A convenience function to set the format based on the code or name. */
+
796 __LA_DECL int archive_write_set_format(struct archive *, int format_code);
+
797 __LA_DECL int archive_write_set_format_by_name(struct archive *,
+
798  const char *name);
+
799 /* To minimize link pollution, use one or more of the following. */
+
800 __LA_DECL int archive_write_set_format_7zip(struct archive *);
+
801 __LA_DECL int archive_write_set_format_ar_bsd(struct archive *);
+
802 __LA_DECL int archive_write_set_format_ar_svr4(struct archive *);
+
803 __LA_DECL int archive_write_set_format_cpio(struct archive *);
+
804 __LA_DECL int archive_write_set_format_cpio_bin(struct archive *);
+
805 __LA_DECL int archive_write_set_format_cpio_newc(struct archive *);
+
806 __LA_DECL int archive_write_set_format_cpio_odc(struct archive *);
+
807 __LA_DECL int archive_write_set_format_cpio_pwb(struct archive *);
+
808 __LA_DECL int archive_write_set_format_gnutar(struct archive *);
+
809 __LA_DECL int archive_write_set_format_iso9660(struct archive *);
+
810 __LA_DECL int archive_write_set_format_mtree(struct archive *);
+
811 __LA_DECL int archive_write_set_format_mtree_classic(struct archive *);
+
812 /* TODO: int archive_write_set_format_old_tar(struct archive *); */
+
813 __LA_DECL int archive_write_set_format_pax(struct archive *);
+
814 __LA_DECL int archive_write_set_format_pax_restricted(struct archive *);
+
815 __LA_DECL int archive_write_set_format_raw(struct archive *);
+
816 __LA_DECL int archive_write_set_format_shar(struct archive *);
+
817 __LA_DECL int archive_write_set_format_shar_dump(struct archive *);
+
818 __LA_DECL int archive_write_set_format_ustar(struct archive *);
+
819 __LA_DECL int archive_write_set_format_v7tar(struct archive *);
+
820 __LA_DECL int archive_write_set_format_warc(struct archive *);
+
821 __LA_DECL int archive_write_set_format_xar(struct archive *);
+
822 __LA_DECL int archive_write_set_format_zip(struct archive *);
+
823 __LA_DECL int archive_write_set_format_filter_by_ext(struct archive *a, const char *filename);
+
824 __LA_DECL int archive_write_set_format_filter_by_ext_def(struct archive *a, const char *filename, const char * def_ext);
+
825 __LA_DECL int archive_write_zip_set_compression_deflate(struct archive *);
+
826 __LA_DECL int archive_write_zip_set_compression_store(struct archive *);
+
827 /* Deprecated; use archive_write_open2 instead */
+
828 __LA_DECL int archive_write_open(struct archive *, void *,
+
829  archive_open_callback *, archive_write_callback *,
+
830  archive_close_callback *);
+
831 __LA_DECL int archive_write_open2(struct archive *, void *,
+
832  archive_open_callback *, archive_write_callback *,
+
833  archive_close_callback *, archive_free_callback *);
+
834 __LA_DECL int archive_write_open_fd(struct archive *, int _fd);
+
835 __LA_DECL int archive_write_open_filename(struct archive *, const char *_file);
+
836 __LA_DECL int archive_write_open_filename_w(struct archive *,
+
837  const wchar_t *_file);
+
838 /* A deprecated synonym for archive_write_open_filename() */
+
839 __LA_DECL int archive_write_open_file(struct archive *, const char *_file)
+
840  __LA_DEPRECATED;
+
841 __LA_DECL int archive_write_open_FILE(struct archive *, FILE *);
+
842 /* _buffSize is the size of the buffer, _used refers to a variable that
+
843  * will be updated after each write into the buffer. */
+
844 __LA_DECL int archive_write_open_memory(struct archive *,
+
845  void *_buffer, size_t _buffSize, size_t *_used);
+
846 
+
847 /*
+
848  * Note that the library will truncate writes beyond the size provided
+
849  * to archive_write_header or pad if the provided data is short.
+
850  */
+
851 __LA_DECL int archive_write_header(struct archive *,
+
852  struct archive_entry *);
+
853 __LA_DECL la_ssize_t archive_write_data(struct archive *,
+
854  const void *, size_t);
+
855 
+
856 /* This interface is currently only available for archive_write_disk handles. */
+
857 __LA_DECL la_ssize_t archive_write_data_block(struct archive *,
+
858  const void *, size_t, la_int64_t);
+
859 
+
860 __LA_DECL int archive_write_finish_entry(struct archive *);
+
861 __LA_DECL int archive_write_close(struct archive *);
+
862 /* Marks the archive as FATAL so that a subsequent free() operation
+
863  * won't try to close() cleanly. Provides a fast abort capability
+
864  * when the client discovers that things have gone wrong. */
+
865 __LA_DECL int archive_write_fail(struct archive *);
+
866 /* This can fail if the archive wasn't already closed, in which case
+
867  * archive_write_free() will implicitly call archive_write_close(). */
+
868 __LA_DECL int archive_write_free(struct archive *);
+
869 #if ARCHIVE_VERSION_NUMBER < 4000000
+
870 /* Synonym for archive_write_free() for backwards compatibility. */
+
871 __LA_DECL int archive_write_finish(struct archive *) __LA_DEPRECATED;
+
872 #endif
+
873 
+
874 /*
+
875  * Set write options.
+
876  */
+
877 /* Apply option to the format only. */
+
878 __LA_DECL int archive_write_set_format_option(struct archive *_a,
+
879  const char *m, const char *o,
+
880  const char *v);
+
881 /* Apply option to the filter only. */
+
882 __LA_DECL int archive_write_set_filter_option(struct archive *_a,
+
883  const char *m, const char *o,
+
884  const char *v);
+
885 /* Apply option to both the format and the filter. */
+
886 __LA_DECL int archive_write_set_option(struct archive *_a,
+
887  const char *m, const char *o,
+
888  const char *v);
+
889 /* Apply option string to both the format and the filter. */
+
890 __LA_DECL int archive_write_set_options(struct archive *_a,
+
891  const char *opts);
+
892 
+
893 /*
+
894  * Set a encryption passphrase.
+
895  */
+
896 __LA_DECL int archive_write_set_passphrase(struct archive *_a, const char *p);
+
897 __LA_DECL int archive_write_set_passphrase_callback(struct archive *,
+
898  void *client_data, archive_passphrase_callback *);
+
899 
+
900 /*-
+
901  * ARCHIVE_WRITE_DISK API
+
902  *
+
903  * To create objects on disk:
+
904  * 1) Ask archive_write_disk_new for a new archive_write_disk object.
+
905  * 2) Set any global properties. In particular, you probably
+
906  * want to set the options.
+
907  * 3) For each entry:
+
908  * - construct an appropriate struct archive_entry structure
+
909  * - archive_write_header to create the file/dir/etc on disk
+
910  * - archive_write_data to write the entry data
+
911  * 4) archive_write_free to cleanup the writer and release resources
+
912  *
+
913  * In particular, you can use this in conjunction with archive_read()
+
914  * to pull entries out of an archive and create them on disk.
+
915  */
+
916 __LA_DECL struct archive *archive_write_disk_new(void);
+
917 /* This file will not be overwritten. */
+
918 __LA_DECL int archive_write_disk_set_skip_file(struct archive *,
+
919  la_int64_t, la_int64_t);
+
920 /* Set flags to control how the next item gets created.
+
921  * This accepts a bitmask of ARCHIVE_EXTRACT_XXX flags defined above. */
+
922 __LA_DECL int archive_write_disk_set_options(struct archive *,
+
923  int flags);
+
924 /*
+
925  * The lookup functions are given uname/uid (or gname/gid) pairs and
+
926  * return a uid (gid) suitable for this system. These are used for
+
927  * restoring ownership and for setting ACLs. The default functions
+
928  * are naive, they just return the uid/gid. These are small, so reasonable
+
929  * for applications that don't need to preserve ownership; they
+
930  * are probably also appropriate for applications that are doing
+
931  * same-system backup and restore.
+
932  */
+
933 /*
+
934  * The "standard" lookup functions use common system calls to lookup
+
935  * the uname/gname, falling back to the uid/gid if the names can't be
+
936  * found. They cache lookups and are reasonably fast, but can be very
+
937  * large, so they are not used unless you ask for them. In
+
938  * particular, these match the specifications of POSIX "pax" and old
+
939  * POSIX "tar".
+
940  */
+
941 __LA_DECL int archive_write_disk_set_standard_lookup(struct archive *);
+
942 /*
+
943  * If neither the default (naive) nor the standard (big) functions suit
+
944  * your needs, you can write your own and register them. Be sure to
+
945  * include a cleanup function if you have allocated private data.
+
946  */
+
947 __LA_DECL int archive_write_disk_set_group_lookup(struct archive *,
+
948  void * /* private_data */,
+
949  la_int64_t (*)(void *, const char *, la_int64_t),
+
950  void (* /* cleanup */)(void *));
+
951 __LA_DECL int archive_write_disk_set_user_lookup(struct archive *,
+
952  void * /* private_data */,
+
953  la_int64_t (*)(void *, const char *, la_int64_t),
+
954  void (* /* cleanup */)(void *));
+
955 __LA_DECL la_int64_t archive_write_disk_gid(struct archive *, const char *, la_int64_t);
+
956 __LA_DECL la_int64_t archive_write_disk_uid(struct archive *, const char *, la_int64_t);
+
957 
+
958 /*
+
959  * ARCHIVE_READ_DISK API
+
960  *
+
961  * This is still evolving and somewhat experimental.
+
962  */
+
963 __LA_DECL struct archive *archive_read_disk_new(void);
+
964 /* The names for symlink modes here correspond to an old BSD
+
965  * command-line argument convention: -L, -P, -H */
+
966 /* Follow all symlinks. */
+
967 __LA_DECL int archive_read_disk_set_symlink_logical(struct archive *);
+
968 /* Follow no symlinks. */
+
969 __LA_DECL int archive_read_disk_set_symlink_physical(struct archive *);
+
970 /* Follow symlink initially, then not. */
+
971 __LA_DECL int archive_read_disk_set_symlink_hybrid(struct archive *);
+
972 /* TODO: Handle Linux stat32/stat64 ugliness. <sigh> */
+
973 __LA_DECL int archive_read_disk_entry_from_file(struct archive *,
+
974  struct archive_entry *, int /* fd */, const struct stat *);
+
975 /* Look up gname for gid or uname for uid. */
+
976 /* Default implementations are very, very stupid. */
+
977 __LA_DECL const char *archive_read_disk_gname(struct archive *, la_int64_t);
+
978 __LA_DECL const char *archive_read_disk_uname(struct archive *, la_int64_t);
+
979 /* "Standard" implementation uses getpwuid_r, getgrgid_r and caches the
+
980  * results for performance. */
+
981 __LA_DECL int archive_read_disk_set_standard_lookup(struct archive *);
+
982 /* You can install your own lookups if you like. */
+
983 __LA_DECL int archive_read_disk_set_gname_lookup(struct archive *,
+
984  void * /* private_data */,
+
985  const char *(* /* lookup_fn */)(void *, la_int64_t),
+
986  void (* /* cleanup_fn */)(void *));
+
987 __LA_DECL int archive_read_disk_set_uname_lookup(struct archive *,
+
988  void * /* private_data */,
+
989  const char *(* /* lookup_fn */)(void *, la_int64_t),
+
990  void (* /* cleanup_fn */)(void *));
+
991 /* Start traversal. */
+
992 __LA_DECL int archive_read_disk_open(struct archive *, const char *);
+
993 __LA_DECL int archive_read_disk_open_w(struct archive *, const wchar_t *);
+
994 /*
+
995  * Request that current entry be visited. If you invoke it on every
+
996  * directory, you'll get a physical traversal. This is ignored if the
+
997  * current entry isn't a directory or a link to a directory. So, if
+
998  * you invoke this on every returned path, you'll get a full logical
+
999  * traversal.
+
1000  */
+
1001 __LA_DECL int archive_read_disk_descend(struct archive *);
+
1002 __LA_DECL int archive_read_disk_can_descend(struct archive *);
+
1003 __LA_DECL int archive_read_disk_current_filesystem(struct archive *);
+
1004 __LA_DECL int archive_read_disk_current_filesystem_is_synthetic(struct archive *);
+
1005 __LA_DECL int archive_read_disk_current_filesystem_is_remote(struct archive *);
+
1006 /* Request that the access time of the entry visited by traversal be restored. */
+
1007 __LA_DECL int archive_read_disk_set_atime_restored(struct archive *);
+
1008 /*
+
1009  * Set behavior. The "flags" argument selects optional behavior.
+
1010  */
+
1011 /* Request that the access time of the entry visited by traversal be restored.
+
1012  * This is the same as archive_read_disk_set_atime_restored. */
+
1013 #define ARCHIVE_READDISK_RESTORE_ATIME (0x0001)
+
1014 /* Default: Do not skip an entry which has nodump flags. */
+
1015 #define ARCHIVE_READDISK_HONOR_NODUMP (0x0002)
+
1016 /* Default: Skip a mac resource fork file whose prefix is "._" because of
+
1017  * using copyfile. */
+
1018 #define ARCHIVE_READDISK_MAC_COPYFILE (0x0004)
+
1019 /* Default: Traverse mount points. */
+
1020 #define ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS (0x0008)
+
1021 /* Default: Xattrs are read from disk. */
+
1022 #define ARCHIVE_READDISK_NO_XATTR (0x0010)
+
1023 /* Default: ACLs are read from disk. */
+
1024 #define ARCHIVE_READDISK_NO_ACL (0x0020)
+
1025 /* Default: File flags are read from disk. */
+
1026 #define ARCHIVE_READDISK_NO_FFLAGS (0x0040)
+
1027 
+
1028 __LA_DECL int archive_read_disk_set_behavior(struct archive *,
+
1029  int flags);
+
1030 
+
1031 /*
+
1032  * Set archive_match object that will be used in archive_read_disk to
+
1033  * know whether an entry should be skipped. The callback function
+
1034  * _excluded_func will be invoked when an entry is skipped by the result
+
1035  * of archive_match.
+
1036  */
+
1037 __LA_DECL int archive_read_disk_set_matching(struct archive *,
+
1038  struct archive *_matching, void (*_excluded_func)
+
1039  (struct archive *, void *, struct archive_entry *),
+
1040  void *_client_data);
+
1041 __LA_DECL int archive_read_disk_set_metadata_filter_callback(struct archive *,
+
1042  int (*_metadata_filter_func)(struct archive *, void *,
+
1043  struct archive_entry *), void *_client_data);
+
1044 
+
1045 /* Simplified cleanup interface;
+
1046  * This calls archive_read_free() or archive_write_free() as needed. */
+
1047 __LA_DECL int archive_free(struct archive *);
+
1048 
+
1049 /*
+
1050  * Accessor functions to read/set various information in
+
1051  * the struct archive object:
+
1052  */
+
1053 
+
1054 /* Number of filters in the current filter pipeline. */
+
1055 /* Filter #0 is the one closest to the format, -1 is a synonym for the
+
1056  * last filter, which is always the pseudo-filter that wraps the
+
1057  * client callbacks. */
+
1058 __LA_DECL int archive_filter_count(struct archive *);
+
1059 __LA_DECL la_int64_t archive_filter_bytes(struct archive *, int);
+
1060 __LA_DECL int archive_filter_code(struct archive *, int);
+
1061 __LA_DECL const char * archive_filter_name(struct archive *, int);
+
1062 
+
1063 #if ARCHIVE_VERSION_NUMBER < 4000000
+
1064 /* These don't properly handle multiple filters, so are deprecated and
+
1065  * will eventually be removed. */
+
1066 /* As of libarchive 3.0, this is an alias for archive_filter_bytes(a, -1); */
+
1067 __LA_DECL la_int64_t archive_position_compressed(struct archive *)
+
1068  __LA_DEPRECATED;
+
1069 /* As of libarchive 3.0, this is an alias for archive_filter_bytes(a, 0); */
+
1070 __LA_DECL la_int64_t archive_position_uncompressed(struct archive *)
+
1071  __LA_DEPRECATED;
+
1072 /* As of libarchive 3.0, this is an alias for archive_filter_name(a, 0); */
+
1073 __LA_DECL const char *archive_compression_name(struct archive *)
+
1074  __LA_DEPRECATED;
+
1075 /* As of libarchive 3.0, this is an alias for archive_filter_code(a, 0); */
+
1076 __LA_DECL int archive_compression(struct archive *)
+
1077  __LA_DEPRECATED;
+
1078 #endif
+
1079 
+
1080 __LA_DECL int archive_errno(struct archive *);
+
1081 __LA_DECL const char *archive_error_string(struct archive *);
+
1082 __LA_DECL const char *archive_format_name(struct archive *);
+
1083 __LA_DECL int archive_format(struct archive *);
+
1084 __LA_DECL void archive_clear_error(struct archive *);
+
1085 __LA_DECL void archive_set_error(struct archive *, int _err,
+
1086  const char *fmt, ...) __LA_PRINTF(3, 4);
+
1087 __LA_DECL void archive_copy_error(struct archive *dest,
+
1088  struct archive *src);
+
1089 __LA_DECL int archive_file_count(struct archive *);
+
1090 
+
1091 /*
+
1092  * ARCHIVE_MATCH API
+
1093  */
+
1094 __LA_DECL struct archive *archive_match_new(void);
+
1095 __LA_DECL int archive_match_free(struct archive *);
+
1096 
+
1097 /*
+
1098  * Test if archive_entry is excluded.
+
1099  * This is a convenience function. This is the same as calling all
+
1100  * archive_match_path_excluded, archive_match_time_excluded
+
1101  * and archive_match_owner_excluded.
+
1102  */
+
1103 __LA_DECL int archive_match_excluded(struct archive *,
+
1104  struct archive_entry *);
+
1105 
+
1106 /*
+
1107  * Test if pathname is excluded. The conditions are set by following functions.
+
1108  */
+
1109 __LA_DECL int archive_match_path_excluded(struct archive *,
+
1110  struct archive_entry *);
+
1111 /* Control recursive inclusion of directory content when directory is included. Default on. */
+
1112 __LA_DECL int archive_match_set_inclusion_recursion(struct archive *, int);
+
1113 /* Add exclusion pathname pattern. */
+
1114 __LA_DECL int archive_match_exclude_pattern(struct archive *, const char *);
+
1115 __LA_DECL int archive_match_exclude_pattern_w(struct archive *,
+
1116  const wchar_t *);
+
1117 /* Add exclusion pathname pattern from file. */
+
1118 __LA_DECL int archive_match_exclude_pattern_from_file(struct archive *,
+
1119  const char *, int _nullSeparator);
+
1120 __LA_DECL int archive_match_exclude_pattern_from_file_w(struct archive *,
+
1121  const wchar_t *, int _nullSeparator);
+
1122 /* Add inclusion pathname pattern. */
+
1123 __LA_DECL int archive_match_include_pattern(struct archive *, const char *);
+
1124 __LA_DECL int archive_match_include_pattern_w(struct archive *,
+
1125  const wchar_t *);
+
1126 /* Add inclusion pathname pattern from file. */
+
1127 __LA_DECL int archive_match_include_pattern_from_file(struct archive *,
+
1128  const char *, int _nullSeparator);
+
1129 __LA_DECL int archive_match_include_pattern_from_file_w(struct archive *,
+
1130  const wchar_t *, int _nullSeparator);
+
1131 /*
+
1132  * How to get statistic information for inclusion patterns.
+
1133  */
+
1134 /* Return the amount number of unmatched inclusion patterns. */
+
1135 __LA_DECL int archive_match_path_unmatched_inclusions(struct archive *);
+
1136 /* Return the pattern of unmatched inclusion with ARCHIVE_OK.
+
1137  * Return ARCHIVE_EOF if there is no inclusion pattern. */
+
1138 __LA_DECL int archive_match_path_unmatched_inclusions_next(
+
1139  struct archive *, const char **);
+
1140 __LA_DECL int archive_match_path_unmatched_inclusions_next_w(
+
1141  struct archive *, const wchar_t **);
+
1142 
+
1143 /*
+
1144  * Test if a file is excluded by its time stamp.
+
1145  * The conditions are set by following functions.
+
1146  */
+
1147 __LA_DECL int archive_match_time_excluded(struct archive *,
+
1148  struct archive_entry *);
+
1149 
+
1150 /*
+
1151  * Flags to tell a matching type of time stamps. These are used for
+
1152  * following functions.
+
1153  */
+
1154 /* Time flag: mtime to be tested. */
+
1155 #define ARCHIVE_MATCH_MTIME (0x0100)
+
1156 /* Time flag: ctime to be tested. */
+
1157 #define ARCHIVE_MATCH_CTIME (0x0200)
+
1158 /* Comparison flag: Match the time if it is newer than. */
+
1159 #define ARCHIVE_MATCH_NEWER (0x0001)
+
1160 /* Comparison flag: Match the time if it is older than. */
+
1161 #define ARCHIVE_MATCH_OLDER (0x0002)
+
1162 /* Comparison flag: Match the time if it is equal to. */
+
1163 #define ARCHIVE_MATCH_EQUAL (0x0010)
+
1164 /* Set inclusion time. */
+
1165 __LA_DECL int archive_match_include_time(struct archive *, int _flag,
+
1166  time_t _sec, long _nsec);
+
1167 /* Set inclusion time by a date string. */
+
1168 __LA_DECL int archive_match_include_date(struct archive *, int _flag,
+
1169  const char *_datestr);
+
1170 __LA_DECL int archive_match_include_date_w(struct archive *, int _flag,
+
1171  const wchar_t *_datestr);
+
1172 /* Set inclusion time by a particular file. */
+
1173 __LA_DECL int archive_match_include_file_time(struct archive *,
+
1174  int _flag, const char *_pathname);
+
1175 __LA_DECL int archive_match_include_file_time_w(struct archive *,
+
1176  int _flag, const wchar_t *_pathname);
+
1177 /* Add exclusion entry. */
+
1178 __LA_DECL int archive_match_exclude_entry(struct archive *,
+
1179  int _flag, struct archive_entry *);
+
1180 
+
1181 /*
+
1182  * Test if a file is excluded by its uid ,gid, uname or gname.
+
1183  * The conditions are set by following functions.
+
1184  */
+
1185 __LA_DECL int archive_match_owner_excluded(struct archive *,
+
1186  struct archive_entry *);
+
1187 /* Add inclusion uid, gid, uname and gname. */
+
1188 __LA_DECL int archive_match_include_uid(struct archive *, la_int64_t);
+
1189 __LA_DECL int archive_match_include_gid(struct archive *, la_int64_t);
+
1190 __LA_DECL int archive_match_include_uname(struct archive *, const char *);
+
1191 __LA_DECL int archive_match_include_uname_w(struct archive *,
+
1192  const wchar_t *);
+
1193 __LA_DECL int archive_match_include_gname(struct archive *, const char *);
+
1194 __LA_DECL int archive_match_include_gname_w(struct archive *,
+
1195  const wchar_t *);
+
1196 
+
1197 /* Utility functions */
+
1198 /* Convenience function to sort a NULL terminated list of strings */
+
1199 __LA_DECL int archive_utility_string_sort(char **);
+
1200 
+
1201 #ifdef __cplusplus
+
1202 }
+
1203 #endif
+
1204 
+
1205 /* These are meaningless outside of this header. */
+
1206 #undef __LA_DECL
+
1207 
+
1208 #endif /* !ARCHIVE_H_INCLUDED */
+
diff --git a/docs/archive__entry_8h_source.html b/docs/archive__entry_8h_source.html index f80e15c..9bdb1a3 100644 --- a/docs/archive__entry_8h_source.html +++ b/docs/archive__entry_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: bin/libarchive/include/archive_entry.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@ - + +/* @license-end */
archive_entry.h
-
1 /*-
2  * Copyright (c) 2003-2008 Tim Kientzle
3  * Copyright (c) 2016 Martin Matuska
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18  * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  *
26  * $FreeBSD: head/lib/libarchive/archive_entry.h 201096 2009-12-28 02:41:27Z kientzle $
27  */
28 
29 #ifndef ARCHIVE_ENTRY_H_INCLUDED
30 #define ARCHIVE_ENTRY_H_INCLUDED
31 
32 /* Note: Compiler will complain if this does not match archive.h! */
33 #define ARCHIVE_VERSION_NUMBER 3005002
34 
35 /*
36  * Note: archive_entry.h is for use outside of libarchive; the
37  * configuration headers (config.h, archive_platform.h, etc.) are
38  * purely internal. Do NOT use HAVE_XXX configuration macros to
39  * control the behavior of this header! If you must conditionalize,
40  * use predefined compiler and/or platform macros.
41  */
42 
43 #include <sys/types.h>
44 #include <stddef.h> /* for wchar_t */
45 #include <stdint.h>
46 #include <time.h>
47 
48 #if defined(_WIN32) && !defined(__CYGWIN__)
49 #include <windows.h>
50 #endif
51 
52 /* Get a suitable 64-bit integer type. */
53 #if !defined(__LA_INT64_T_DEFINED)
54 # if ARCHIVE_VERSION_NUMBER < 4000000
55 #define __LA_INT64_T la_int64_t
56 # endif
57 #define __LA_INT64_T_DEFINED
58 # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
59 typedef __int64 la_int64_t;
60 # else
61 #include <unistd.h>
62 # if defined(_SCO_DS) || defined(__osf__)
63 typedef long long la_int64_t;
64 # else
65 typedef int64_t la_int64_t;
66 # endif
67 # endif
68 #endif
69 
70 /* The la_ssize_t should match the type used in 'struct stat' */
71 #if !defined(__LA_SSIZE_T_DEFINED)
72 /* Older code relied on the __LA_SSIZE_T macro; after 4.0 we'll switch to the typedef exclusively. */
73 # if ARCHIVE_VERSION_NUMBER < 4000000
74 #define __LA_SSIZE_T la_ssize_t
75 # endif
76 #define __LA_SSIZE_T_DEFINED
77 # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
78 # if defined(_SSIZE_T_DEFINED) || defined(_SSIZE_T_)
79 typedef ssize_t la_ssize_t;
80 # elif defined(_WIN64)
81 typedef __int64 la_ssize_t;
82 # else
83 typedef long la_ssize_t;
84 # endif
85 # else
86 # include <unistd.h> /* ssize_t */
87 typedef ssize_t la_ssize_t;
88 # endif
89 #endif
90 
91 /* Get a suitable definition for mode_t */
92 #if ARCHIVE_VERSION_NUMBER >= 3999000
93 /* Switch to plain 'int' for libarchive 4.0. It's less broken than 'mode_t' */
94 # define __LA_MODE_T int
95 #elif defined(_WIN32) && !defined(__CYGWIN__) && !defined(__BORLANDC__) && !defined(__WATCOMC__)
96 # define __LA_MODE_T unsigned short
97 #else
98 # define __LA_MODE_T mode_t
99 #endif
100 
101 /* Large file support for Android */
102 #ifdef __ANDROID__
103 #include "android_lf.h"
104 #endif
105 
106 /*
107  * On Windows, define LIBARCHIVE_STATIC if you're building or using a
108  * .lib. The default here assumes you're building a DLL. Only
109  * libarchive source should ever define __LIBARCHIVE_BUILD.
110  */
111 #if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC)
112 # ifdef __LIBARCHIVE_BUILD
113 # ifdef __GNUC__
114 # define __LA_DECL __attribute__((dllexport)) extern
115 # else
116 # define __LA_DECL __declspec(dllexport)
117 # endif
118 # else
119 # ifdef __GNUC__
120 # define __LA_DECL
121 # else
122 # define __LA_DECL __declspec(dllimport)
123 # endif
124 # endif
125 #else
126 /* Static libraries on all platforms and shared libraries on non-Windows. */
127 # define __LA_DECL
128 #endif
129 
130 #if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1
131 # define __LA_DEPRECATED __attribute__((deprecated))
132 #else
133 # define __LA_DEPRECATED
134 #endif
135 
136 #ifdef __cplusplus
137 extern "C" {
138 #endif
139 
140 /*
141  * Description of an archive entry.
142  *
143  * You can think of this as "struct stat" with some text fields added in.
144  *
145  * TODO: Add "comment", "charset", and possibly other entries that are
146  * supported by "pax interchange" format. However, GNU, ustar, cpio,
147  * and other variants don't support these features, so they're not an
148  * excruciatingly high priority right now.
149  *
150  * TODO: "pax interchange" format allows essentially arbitrary
151  * key/value attributes to be attached to any entry. Supporting
152  * such extensions may make this library useful for special
153  * applications (e.g., a package manager could attach special
154  * package-management attributes to each entry).
155  */
156 struct archive;
157 struct archive_entry;
158 
159 /*
160  * File-type constants. These are returned from archive_entry_filetype()
161  * and passed to archive_entry_set_filetype().
162  *
163  * These values match S_XXX defines on every platform I've checked,
164  * including Windows, AIX, Linux, Solaris, and BSD. They're
165  * (re)defined here because platforms generally don't define the ones
166  * they don't support. For example, Windows doesn't define S_IFLNK or
167  * S_IFBLK. Instead of having a mass of conditional logic and system
168  * checks to define any S_XXX values that aren't supported locally,
169  * I've just defined a new set of such constants so that
170  * libarchive-based applications can manipulate and identify archive
171  * entries properly even if the hosting platform can't store them on
172  * disk.
173  *
174  * These values are also used directly within some portable formats,
175  * such as cpio. If you find a platform that varies from these, the
176  * correct solution is to leave these alone and translate from these
177  * portable values to platform-native values when entries are read from
178  * or written to disk.
179  */
180 /*
181  * In libarchive 4.0, we can drop the casts here.
182  * They're needed to work around Borland C's broken mode_t.
183  */
184 #define AE_IFMT ((__LA_MODE_T)0170000)
185 #define AE_IFREG ((__LA_MODE_T)0100000)
186 #define AE_IFLNK ((__LA_MODE_T)0120000)
187 #define AE_IFSOCK ((__LA_MODE_T)0140000)
188 #define AE_IFCHR ((__LA_MODE_T)0020000)
189 #define AE_IFBLK ((__LA_MODE_T)0060000)
190 #define AE_IFDIR ((__LA_MODE_T)0040000)
191 #define AE_IFIFO ((__LA_MODE_T)0010000)
192 
193 /*
194  * Symlink types
195  */
196 #define AE_SYMLINK_TYPE_UNDEFINED 0
197 #define AE_SYMLINK_TYPE_FILE 1
198 #define AE_SYMLINK_TYPE_DIRECTORY 2
199 
200 /*
201  * Basic object manipulation
202  */
203 
204 __LA_DECL struct archive_entry *archive_entry_clear(struct archive_entry *);
205 /* The 'clone' function does a deep copy; all of the strings are copied too. */
206 __LA_DECL struct archive_entry *archive_entry_clone(struct archive_entry *);
207 __LA_DECL void archive_entry_free(struct archive_entry *);
208 __LA_DECL struct archive_entry *archive_entry_new(void);
209 
210 /*
211  * This form of archive_entry_new2() will pull character-set
212  * conversion information from the specified archive handle. The
213  * older archive_entry_new(void) form is equivalent to calling
214  * archive_entry_new2(NULL) and will result in the use of an internal
215  * default character-set conversion.
216  */
217 __LA_DECL struct archive_entry *archive_entry_new2(struct archive *);
218 
219 /*
220  * Retrieve fields from an archive_entry.
221  *
222  * There are a number of implicit conversions among these fields. For
223  * example, if a regular string field is set and you read the _w wide
224  * character field, the entry will implicitly convert narrow-to-wide
225  * using the current locale. Similarly, dev values are automatically
226  * updated when you write devmajor or devminor and vice versa.
227  *
228  * In addition, fields can be "set" or "unset." Unset string fields
229  * return NULL, non-string fields have _is_set() functions to test
230  * whether they've been set. You can "unset" a string field by
231  * assigning NULL; non-string fields have _unset() functions to
232  * unset them.
233  *
234  * Note: There is one ambiguity in the above; string fields will
235  * also return NULL when implicit character set conversions fail.
236  * This is usually what you want.
237  */
238 __LA_DECL time_t archive_entry_atime(struct archive_entry *);
239 __LA_DECL long archive_entry_atime_nsec(struct archive_entry *);
240 __LA_DECL int archive_entry_atime_is_set(struct archive_entry *);
241 __LA_DECL time_t archive_entry_birthtime(struct archive_entry *);
242 __LA_DECL long archive_entry_birthtime_nsec(struct archive_entry *);
243 __LA_DECL int archive_entry_birthtime_is_set(struct archive_entry *);
244 __LA_DECL time_t archive_entry_ctime(struct archive_entry *);
245 __LA_DECL long archive_entry_ctime_nsec(struct archive_entry *);
246 __LA_DECL int archive_entry_ctime_is_set(struct archive_entry *);
247 __LA_DECL dev_t archive_entry_dev(struct archive_entry *);
248 __LA_DECL int archive_entry_dev_is_set(struct archive_entry *);
249 __LA_DECL dev_t archive_entry_devmajor(struct archive_entry *);
250 __LA_DECL dev_t archive_entry_devminor(struct archive_entry *);
251 __LA_DECL __LA_MODE_T archive_entry_filetype(struct archive_entry *);
252 __LA_DECL void archive_entry_fflags(struct archive_entry *,
253  unsigned long * /* set */,
254  unsigned long * /* clear */);
255 __LA_DECL const char *archive_entry_fflags_text(struct archive_entry *);
256 __LA_DECL la_int64_t archive_entry_gid(struct archive_entry *);
257 __LA_DECL const char *archive_entry_gname(struct archive_entry *);
258 __LA_DECL const char *archive_entry_gname_utf8(struct archive_entry *);
259 __LA_DECL const wchar_t *archive_entry_gname_w(struct archive_entry *);
260 __LA_DECL const char *archive_entry_hardlink(struct archive_entry *);
261 __LA_DECL const char *archive_entry_hardlink_utf8(struct archive_entry *);
262 __LA_DECL const wchar_t *archive_entry_hardlink_w(struct archive_entry *);
263 __LA_DECL la_int64_t archive_entry_ino(struct archive_entry *);
264 __LA_DECL la_int64_t archive_entry_ino64(struct archive_entry *);
265 __LA_DECL int archive_entry_ino_is_set(struct archive_entry *);
266 __LA_DECL __LA_MODE_T archive_entry_mode(struct archive_entry *);
267 __LA_DECL time_t archive_entry_mtime(struct archive_entry *);
268 __LA_DECL long archive_entry_mtime_nsec(struct archive_entry *);
269 __LA_DECL int archive_entry_mtime_is_set(struct archive_entry *);
270 __LA_DECL unsigned int archive_entry_nlink(struct archive_entry *);
271 __LA_DECL const char *archive_entry_pathname(struct archive_entry *);
272 __LA_DECL const char *archive_entry_pathname_utf8(struct archive_entry *);
273 __LA_DECL const wchar_t *archive_entry_pathname_w(struct archive_entry *);
274 __LA_DECL __LA_MODE_T archive_entry_perm(struct archive_entry *);
275 __LA_DECL dev_t archive_entry_rdev(struct archive_entry *);
276 __LA_DECL dev_t archive_entry_rdevmajor(struct archive_entry *);
277 __LA_DECL dev_t archive_entry_rdevminor(struct archive_entry *);
278 __LA_DECL const char *archive_entry_sourcepath(struct archive_entry *);
279 __LA_DECL const wchar_t *archive_entry_sourcepath_w(struct archive_entry *);
280 __LA_DECL la_int64_t archive_entry_size(struct archive_entry *);
281 __LA_DECL int archive_entry_size_is_set(struct archive_entry *);
282 __LA_DECL const char *archive_entry_strmode(struct archive_entry *);
283 __LA_DECL const char *archive_entry_symlink(struct archive_entry *);
284 __LA_DECL const char *archive_entry_symlink_utf8(struct archive_entry *);
285 __LA_DECL int archive_entry_symlink_type(struct archive_entry *);
286 __LA_DECL const wchar_t *archive_entry_symlink_w(struct archive_entry *);
287 __LA_DECL la_int64_t archive_entry_uid(struct archive_entry *);
288 __LA_DECL const char *archive_entry_uname(struct archive_entry *);
289 __LA_DECL const char *archive_entry_uname_utf8(struct archive_entry *);
290 __LA_DECL const wchar_t *archive_entry_uname_w(struct archive_entry *);
291 __LA_DECL int archive_entry_is_data_encrypted(struct archive_entry *);
292 __LA_DECL int archive_entry_is_metadata_encrypted(struct archive_entry *);
293 __LA_DECL int archive_entry_is_encrypted(struct archive_entry *);
294 
295 /*
296  * Set fields in an archive_entry.
297  *
298  * Note: Before libarchive 2.4, there were 'set' and 'copy' versions
299  * of the string setters. 'copy' copied the actual string, 'set' just
300  * stored the pointer. In libarchive 2.4 and later, strings are
301  * always copied.
302  */
303 
304 __LA_DECL void archive_entry_set_atime(struct archive_entry *, time_t, long);
305 __LA_DECL void archive_entry_unset_atime(struct archive_entry *);
306 #if defined(_WIN32) && !defined(__CYGWIN__)
307 __LA_DECL void archive_entry_copy_bhfi(struct archive_entry *, BY_HANDLE_FILE_INFORMATION *);
308 #endif
309 __LA_DECL void archive_entry_set_birthtime(struct archive_entry *, time_t, long);
310 __LA_DECL void archive_entry_unset_birthtime(struct archive_entry *);
311 __LA_DECL void archive_entry_set_ctime(struct archive_entry *, time_t, long);
312 __LA_DECL void archive_entry_unset_ctime(struct archive_entry *);
313 __LA_DECL void archive_entry_set_dev(struct archive_entry *, dev_t);
314 __LA_DECL void archive_entry_set_devmajor(struct archive_entry *, dev_t);
315 __LA_DECL void archive_entry_set_devminor(struct archive_entry *, dev_t);
316 __LA_DECL void archive_entry_set_filetype(struct archive_entry *, unsigned int);
317 __LA_DECL void archive_entry_set_fflags(struct archive_entry *,
318  unsigned long /* set */, unsigned long /* clear */);
319 /* Returns pointer to start of first invalid token, or NULL if none. */
320 /* Note that all recognized tokens are processed, regardless. */
321 __LA_DECL const char *archive_entry_copy_fflags_text(struct archive_entry *,
322  const char *);
323 __LA_DECL const wchar_t *archive_entry_copy_fflags_text_w(struct archive_entry *,
324  const wchar_t *);
325 __LA_DECL void archive_entry_set_gid(struct archive_entry *, la_int64_t);
326 __LA_DECL void archive_entry_set_gname(struct archive_entry *, const char *);
327 __LA_DECL void archive_entry_set_gname_utf8(struct archive_entry *, const char *);
328 __LA_DECL void archive_entry_copy_gname(struct archive_entry *, const char *);
329 __LA_DECL void archive_entry_copy_gname_w(struct archive_entry *, const wchar_t *);
330 __LA_DECL int archive_entry_update_gname_utf8(struct archive_entry *, const char *);
331 __LA_DECL void archive_entry_set_hardlink(struct archive_entry *, const char *);
332 __LA_DECL void archive_entry_set_hardlink_utf8(struct archive_entry *, const char *);
333 __LA_DECL void archive_entry_copy_hardlink(struct archive_entry *, const char *);
334 __LA_DECL void archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *);
335 __LA_DECL int archive_entry_update_hardlink_utf8(struct archive_entry *, const char *);
336 __LA_DECL void archive_entry_set_ino(struct archive_entry *, la_int64_t);
337 __LA_DECL void archive_entry_set_ino64(struct archive_entry *, la_int64_t);
338 __LA_DECL void archive_entry_set_link(struct archive_entry *, const char *);
339 __LA_DECL void archive_entry_set_link_utf8(struct archive_entry *, const char *);
340 __LA_DECL void archive_entry_copy_link(struct archive_entry *, const char *);
341 __LA_DECL void archive_entry_copy_link_w(struct archive_entry *, const wchar_t *);
342 __LA_DECL int archive_entry_update_link_utf8(struct archive_entry *, const char *);
343 __LA_DECL void archive_entry_set_mode(struct archive_entry *, __LA_MODE_T);
344 __LA_DECL void archive_entry_set_mtime(struct archive_entry *, time_t, long);
345 __LA_DECL void archive_entry_unset_mtime(struct archive_entry *);
346 __LA_DECL void archive_entry_set_nlink(struct archive_entry *, unsigned int);
347 __LA_DECL void archive_entry_set_pathname(struct archive_entry *, const char *);
348 __LA_DECL void archive_entry_set_pathname_utf8(struct archive_entry *, const char *);
349 __LA_DECL void archive_entry_copy_pathname(struct archive_entry *, const char *);
350 __LA_DECL void archive_entry_copy_pathname_w(struct archive_entry *, const wchar_t *);
351 __LA_DECL int archive_entry_update_pathname_utf8(struct archive_entry *, const char *);
352 __LA_DECL void archive_entry_set_perm(struct archive_entry *, __LA_MODE_T);
353 __LA_DECL void archive_entry_set_rdev(struct archive_entry *, dev_t);
354 __LA_DECL void archive_entry_set_rdevmajor(struct archive_entry *, dev_t);
355 __LA_DECL void archive_entry_set_rdevminor(struct archive_entry *, dev_t);
356 __LA_DECL void archive_entry_set_size(struct archive_entry *, la_int64_t);
357 __LA_DECL void archive_entry_unset_size(struct archive_entry *);
358 __LA_DECL void archive_entry_copy_sourcepath(struct archive_entry *, const char *);
359 __LA_DECL void archive_entry_copy_sourcepath_w(struct archive_entry *, const wchar_t *);
360 __LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *);
361 __LA_DECL void archive_entry_set_symlink_type(struct archive_entry *, int);
362 __LA_DECL void archive_entry_set_symlink_utf8(struct archive_entry *, const char *);
363 __LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *);
364 __LA_DECL void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *);
365 __LA_DECL int archive_entry_update_symlink_utf8(struct archive_entry *, const char *);
366 __LA_DECL void archive_entry_set_uid(struct archive_entry *, la_int64_t);
367 __LA_DECL void archive_entry_set_uname(struct archive_entry *, const char *);
368 __LA_DECL void archive_entry_set_uname_utf8(struct archive_entry *, const char *);
369 __LA_DECL void archive_entry_copy_uname(struct archive_entry *, const char *);
370 __LA_DECL void archive_entry_copy_uname_w(struct archive_entry *, const wchar_t *);
371 __LA_DECL int archive_entry_update_uname_utf8(struct archive_entry *, const char *);
372 __LA_DECL void archive_entry_set_is_data_encrypted(struct archive_entry *, char is_encrypted);
373 __LA_DECL void archive_entry_set_is_metadata_encrypted(struct archive_entry *, char is_encrypted);
374 /*
375  * Routines to bulk copy fields to/from a platform-native "struct
376  * stat." Libarchive used to just store a struct stat inside of each
377  * archive_entry object, but this created issues when trying to
378  * manipulate archives on systems different than the ones they were
379  * created on.
380  *
381  * TODO: On Linux and other LFS systems, provide both stat32 and
382  * stat64 versions of these functions and all of the macro glue so
383  * that archive_entry_stat is magically defined to
384  * archive_entry_stat32 or archive_entry_stat64 as appropriate.
385  */
386 __LA_DECL const struct stat *archive_entry_stat(struct archive_entry *);
387 __LA_DECL void archive_entry_copy_stat(struct archive_entry *, const struct stat *);
388 
389 /*
390  * Storage for Mac OS-specific AppleDouble metadata information.
391  * Apple-format tar files store a separate binary blob containing
392  * encoded metadata with ACL, extended attributes, etc.
393  * This provides a place to store that blob.
394  */
395 
396 __LA_DECL const void * archive_entry_mac_metadata(struct archive_entry *, size_t *);
397 __LA_DECL void archive_entry_copy_mac_metadata(struct archive_entry *, const void *, size_t);
398 
399 /*
400  * Digest routine. This is used to query the raw hex digest for the
401  * given entry. The type of digest is provided as an argument.
402  */
403 #define ARCHIVE_ENTRY_DIGEST_MD5 0x00000001
404 #define ARCHIVE_ENTRY_DIGEST_RMD160 0x00000002
405 #define ARCHIVE_ENTRY_DIGEST_SHA1 0x00000003
406 #define ARCHIVE_ENTRY_DIGEST_SHA256 0x00000004
407 #define ARCHIVE_ENTRY_DIGEST_SHA384 0x00000005
408 #define ARCHIVE_ENTRY_DIGEST_SHA512 0x00000006
409 
410 __LA_DECL const unsigned char * archive_entry_digest(struct archive_entry *, int /* type */);
411 
412 /*
413  * ACL routines. This used to simply store and return text-format ACL
414  * strings, but that proved insufficient for a number of reasons:
415  * = clients need control over uname/uid and gname/gid mappings
416  * = there are many different ACL text formats
417  * = would like to be able to read/convert archives containing ACLs
418  * on platforms that lack ACL libraries
419  *
420  * This last point, in particular, forces me to implement a reasonably
421  * complete set of ACL support routines.
422  */
423 
424 /*
425  * Permission bits.
426  */
427 #define ARCHIVE_ENTRY_ACL_EXECUTE 0x00000001
428 #define ARCHIVE_ENTRY_ACL_WRITE 0x00000002
429 #define ARCHIVE_ENTRY_ACL_READ 0x00000004
430 #define ARCHIVE_ENTRY_ACL_READ_DATA 0x00000008
431 #define ARCHIVE_ENTRY_ACL_LIST_DIRECTORY 0x00000008
432 #define ARCHIVE_ENTRY_ACL_WRITE_DATA 0x00000010
433 #define ARCHIVE_ENTRY_ACL_ADD_FILE 0x00000010
434 #define ARCHIVE_ENTRY_ACL_APPEND_DATA 0x00000020
435 #define ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY 0x00000020
436 #define ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS 0x00000040
437 #define ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS 0x00000080
438 #define ARCHIVE_ENTRY_ACL_DELETE_CHILD 0x00000100
439 #define ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES 0x00000200
440 #define ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES 0x00000400
441 #define ARCHIVE_ENTRY_ACL_DELETE 0x00000800
442 #define ARCHIVE_ENTRY_ACL_READ_ACL 0x00001000
443 #define ARCHIVE_ENTRY_ACL_WRITE_ACL 0x00002000
444 #define ARCHIVE_ENTRY_ACL_WRITE_OWNER 0x00004000
445 #define ARCHIVE_ENTRY_ACL_SYNCHRONIZE 0x00008000
446 
447 #define ARCHIVE_ENTRY_ACL_PERMS_POSIX1E \
448  (ARCHIVE_ENTRY_ACL_EXECUTE \
449  | ARCHIVE_ENTRY_ACL_WRITE \
450  | ARCHIVE_ENTRY_ACL_READ)
451 
452 #define ARCHIVE_ENTRY_ACL_PERMS_NFS4 \
453  (ARCHIVE_ENTRY_ACL_EXECUTE \
454  | ARCHIVE_ENTRY_ACL_READ_DATA \
455  | ARCHIVE_ENTRY_ACL_LIST_DIRECTORY \
456  | ARCHIVE_ENTRY_ACL_WRITE_DATA \
457  | ARCHIVE_ENTRY_ACL_ADD_FILE \
458  | ARCHIVE_ENTRY_ACL_APPEND_DATA \
459  | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY \
460  | ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS \
461  | ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS \
462  | ARCHIVE_ENTRY_ACL_DELETE_CHILD \
463  | ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES \
464  | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES \
465  | ARCHIVE_ENTRY_ACL_DELETE \
466  | ARCHIVE_ENTRY_ACL_READ_ACL \
467  | ARCHIVE_ENTRY_ACL_WRITE_ACL \
468  | ARCHIVE_ENTRY_ACL_WRITE_OWNER \
469  | ARCHIVE_ENTRY_ACL_SYNCHRONIZE)
470 
471 /*
472  * Inheritance values (NFS4 ACLs only); included in permset.
473  */
474 #define ARCHIVE_ENTRY_ACL_ENTRY_INHERITED 0x01000000
475 #define ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT 0x02000000
476 #define ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT 0x04000000
477 #define ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT 0x08000000
478 #define ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY 0x10000000
479 #define ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS 0x20000000
480 #define ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS 0x40000000
481 
482 #define ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4 \
483  (ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT \
484  | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT \
485  | ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT \
486  | ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY \
487  | ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS \
488  | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS \
489  | ARCHIVE_ENTRY_ACL_ENTRY_INHERITED)
490 
491 /* We need to be able to specify combinations of these. */
492 #define ARCHIVE_ENTRY_ACL_TYPE_ACCESS 0x00000100 /* POSIX.1e only */
493 #define ARCHIVE_ENTRY_ACL_TYPE_DEFAULT 0x00000200 /* POSIX.1e only */
494 #define ARCHIVE_ENTRY_ACL_TYPE_ALLOW 0x00000400 /* NFS4 only */
495 #define ARCHIVE_ENTRY_ACL_TYPE_DENY 0x00000800 /* NFS4 only */
496 #define ARCHIVE_ENTRY_ACL_TYPE_AUDIT 0x00001000 /* NFS4 only */
497 #define ARCHIVE_ENTRY_ACL_TYPE_ALARM 0x00002000 /* NFS4 only */
498 #define ARCHIVE_ENTRY_ACL_TYPE_POSIX1E (ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
499  | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
500 #define ARCHIVE_ENTRY_ACL_TYPE_NFS4 (ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
501  | ARCHIVE_ENTRY_ACL_TYPE_DENY \
502  | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
503  | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
504 
505 /* Tag values mimic POSIX.1e */
506 #define ARCHIVE_ENTRY_ACL_USER 10001 /* Specified user. */
507 #define ARCHIVE_ENTRY_ACL_USER_OBJ 10002 /* User who owns the file. */
508 #define ARCHIVE_ENTRY_ACL_GROUP 10003 /* Specified group. */
509 #define ARCHIVE_ENTRY_ACL_GROUP_OBJ 10004 /* Group who owns the file. */
510 #define ARCHIVE_ENTRY_ACL_MASK 10005 /* Modify group access (POSIX.1e only) */
511 #define ARCHIVE_ENTRY_ACL_OTHER 10006 /* Public (POSIX.1e only) */
512 #define ARCHIVE_ENTRY_ACL_EVERYONE 10107 /* Everyone (NFS4 only) */
513 
514 /*
515  * Set the ACL by clearing it and adding entries one at a time.
516  * Unlike the POSIX.1e ACL routines, you must specify the type
517  * (access/default) for each entry. Internally, the ACL data is just
518  * a soup of entries. API calls here allow you to retrieve just the
519  * entries of interest. This design (which goes against the spirit of
520  * POSIX.1e) is useful for handling archive formats that combine
521  * default and access information in a single ACL list.
522  */
523 __LA_DECL void archive_entry_acl_clear(struct archive_entry *);
524 __LA_DECL int archive_entry_acl_add_entry(struct archive_entry *,
525  int /* type */, int /* permset */, int /* tag */,
526  int /* qual */, const char * /* name */);
527 __LA_DECL int archive_entry_acl_add_entry_w(struct archive_entry *,
528  int /* type */, int /* permset */, int /* tag */,
529  int /* qual */, const wchar_t * /* name */);
530 
531 /*
532  * To retrieve the ACL, first "reset", then repeatedly ask for the
533  * "next" entry. The want_type parameter allows you to request only
534  * certain types of entries.
535  */
536 __LA_DECL int archive_entry_acl_reset(struct archive_entry *, int /* want_type */);
537 __LA_DECL int archive_entry_acl_next(struct archive_entry *, int /* want_type */,
538  int * /* type */, int * /* permset */, int * /* tag */,
539  int * /* qual */, const char ** /* name */);
540 
541 /*
542  * Construct a text-format ACL. The flags argument is a bitmask that
543  * can include any of the following:
544  *
545  * Flags only for archive entries with POSIX.1e ACL:
546  * ARCHIVE_ENTRY_ACL_TYPE_ACCESS - Include POSIX.1e "access" entries.
547  * ARCHIVE_ENTRY_ACL_TYPE_DEFAULT - Include POSIX.1e "default" entries.
548  * ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT - Include "default:" before each
549  * default ACL entry.
550  * ARCHIVE_ENTRY_ACL_STYLE_SOLARIS - Output only one colon after "other" and
551  * "mask" entries.
552  *
553  * Flags only for archive entries with NFSv4 ACL:
554  * ARCHIVE_ENTRY_ACL_STYLE_COMPACT - Do not output the minus character for
555  * unset permissions and flags in NFSv4 ACL permission and flag fields
556  *
557  * Flags for for archive entries with POSIX.1e ACL or NFSv4 ACL:
558  * ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID - Include extra numeric ID field in
559  * each ACL entry.
560  * ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA - Separate entries with comma
561  * instead of newline.
562  */
563 #define ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID 0x00000001
564 #define ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT 0x00000002
565 #define ARCHIVE_ENTRY_ACL_STYLE_SOLARIS 0x00000004
566 #define ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA 0x00000008
567 #define ARCHIVE_ENTRY_ACL_STYLE_COMPACT 0x00000010
568 
569 __LA_DECL wchar_t *archive_entry_acl_to_text_w(struct archive_entry *,
570  la_ssize_t * /* len */, int /* flags */);
571 __LA_DECL char *archive_entry_acl_to_text(struct archive_entry *,
572  la_ssize_t * /* len */, int /* flags */);
573 __LA_DECL int archive_entry_acl_from_text_w(struct archive_entry *,
574  const wchar_t * /* wtext */, int /* type */);
575 __LA_DECL int archive_entry_acl_from_text(struct archive_entry *,
576  const char * /* text */, int /* type */);
577 
578 /* Deprecated constants */
579 #define OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID 1024
580 #define OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT 2048
581 
582 /* Deprecated functions */
583 __LA_DECL const wchar_t *archive_entry_acl_text_w(struct archive_entry *,
584  int /* flags */) __LA_DEPRECATED;
585 __LA_DECL const char *archive_entry_acl_text(struct archive_entry *,
586  int /* flags */) __LA_DEPRECATED;
587 
588 /* Return bitmask of ACL types in an archive entry */
589 __LA_DECL int archive_entry_acl_types(struct archive_entry *);
590 
591 /* Return a count of entries matching 'want_type' */
592 __LA_DECL int archive_entry_acl_count(struct archive_entry *, int /* want_type */);
593 
594 /* Return an opaque ACL object. */
595 /* There's not yet anything clients can actually do with this... */
596 struct archive_acl;
597 __LA_DECL struct archive_acl *archive_entry_acl(struct archive_entry *);
598 
599 /*
600  * extended attributes
601  */
602 
603 __LA_DECL void archive_entry_xattr_clear(struct archive_entry *);
604 __LA_DECL void archive_entry_xattr_add_entry(struct archive_entry *,
605  const char * /* name */, const void * /* value */,
606  size_t /* size */);
607 
608 /*
609  * To retrieve the xattr list, first "reset", then repeatedly ask for the
610  * "next" entry.
611  */
612 
613 __LA_DECL int archive_entry_xattr_count(struct archive_entry *);
614 __LA_DECL int archive_entry_xattr_reset(struct archive_entry *);
615 __LA_DECL int archive_entry_xattr_next(struct archive_entry *,
616  const char ** /* name */, const void ** /* value */, size_t *);
617 
618 /*
619  * sparse
620  */
621 
622 __LA_DECL void archive_entry_sparse_clear(struct archive_entry *);
623 __LA_DECL void archive_entry_sparse_add_entry(struct archive_entry *,
624  la_int64_t /* offset */, la_int64_t /* length */);
625 
626 /*
627  * To retrieve the xattr list, first "reset", then repeatedly ask for the
628  * "next" entry.
629  */
630 
631 __LA_DECL int archive_entry_sparse_count(struct archive_entry *);
632 __LA_DECL int archive_entry_sparse_reset(struct archive_entry *);
633 __LA_DECL int archive_entry_sparse_next(struct archive_entry *,
634  la_int64_t * /* offset */, la_int64_t * /* length */);
635 
636 /*
637  * Utility to match up hardlinks.
638  *
639  * The 'struct archive_entry_linkresolver' is a cache of archive entries
640  * for files with multiple links. Here's how to use it:
641  * 1. Create a lookup object with archive_entry_linkresolver_new()
642  * 2. Tell it the archive format you're using.
643  * 3. Hand each archive_entry to archive_entry_linkify().
644  * That function will return 0, 1, or 2 entries that should
645  * be written.
646  * 4. Call archive_entry_linkify(resolver, NULL) until
647  * no more entries are returned.
648  * 5. Call archive_entry_linkresolver_free(resolver) to free resources.
649  *
650  * The entries returned have their hardlink and size fields updated
651  * appropriately. If an entry is passed in that does not refer to
652  * a file with multiple links, it is returned unchanged. The intention
653  * is that you should be able to simply filter all entries through
654  * this machine.
655  *
656  * To make things more efficient, be sure that each entry has a valid
657  * nlinks value. The hardlink cache uses this to track when all links
658  * have been found. If the nlinks value is zero, it will keep every
659  * name in the cache indefinitely, which can use a lot of memory.
660  *
661  * Note that archive_entry_size() is reset to zero if the file
662  * body should not be written to the archive. Pay attention!
663  */
664 struct archive_entry_linkresolver;
665 
666 /*
667  * There are three different strategies for marking hardlinks.
668  * The descriptions below name them after the best-known
669  * formats that rely on each strategy:
670  *
671  * "Old cpio" is the simplest, it always returns any entry unmodified.
672  * As far as I know, only cpio formats use this. Old cpio archives
673  * store every link with the full body; the onus is on the dearchiver
674  * to detect and properly link the files as they are restored.
675  * "tar" is also pretty simple; it caches a copy the first time it sees
676  * any link. Subsequent appearances are modified to be hardlink
677  * references to the first one without any body. Used by all tar
678  * formats, although the newest tar formats permit the "old cpio" strategy
679  * as well. This strategy is very simple for the dearchiver,
680  * and reasonably straightforward for the archiver.
681  * "new cpio" is trickier. It stores the body only with the last
682  * occurrence. The complication is that we might not
683  * see every link to a particular file in a single session, so
684  * there's no easy way to know when we've seen the last occurrence.
685  * The solution here is to queue one link until we see the next.
686  * At the end of the session, you can enumerate any remaining
687  * entries by calling archive_entry_linkify(NULL) and store those
688  * bodies. If you have a file with three links l1, l2, and l3,
689  * you'll get the following behavior if you see all three links:
690  * linkify(l1) => NULL (the resolver stores l1 internally)
691  * linkify(l2) => l1 (resolver stores l2, you write l1)
692  * linkify(l3) => l2, l3 (all links seen, you can write both).
693  * If you only see l1 and l2, you'll get this behavior:
694  * linkify(l1) => NULL
695  * linkify(l2) => l1
696  * linkify(NULL) => l2 (at end, you retrieve remaining links)
697  * As the name suggests, this strategy is used by newer cpio variants.
698  * It's noticeably more complex for the archiver, slightly more complex
699  * for the dearchiver than the tar strategy, but makes it straightforward
700  * to restore a file using any link by simply continuing to scan until
701  * you see a link that is stored with a body. In contrast, the tar
702  * strategy requires you to rescan the archive from the beginning to
703  * correctly extract an arbitrary link.
704  */
705 
706 __LA_DECL struct archive_entry_linkresolver *archive_entry_linkresolver_new(void);
707 __LA_DECL void archive_entry_linkresolver_set_strategy(
708  struct archive_entry_linkresolver *, int /* format_code */);
709 __LA_DECL void archive_entry_linkresolver_free(struct archive_entry_linkresolver *);
710 __LA_DECL void archive_entry_linkify(struct archive_entry_linkresolver *,
711  struct archive_entry **, struct archive_entry **);
712 __LA_DECL struct archive_entry *archive_entry_partial_links(
713  struct archive_entry_linkresolver *res, unsigned int *links);
714 #ifdef __cplusplus
715 }
716 #endif
717 
718 /* This is meaningless outside of this header. */
719 #undef __LA_DECL
720 
721 #endif /* !ARCHIVE_ENTRY_H_INCLUDED */
+
1 /*-
+
2  * Copyright (c) 2003-2008 Tim Kientzle
+
3  * Copyright (c) 2016 Martin Matuska
+
4  * All rights reserved.
+
5  *
+
6  * Redistribution and use in source and binary forms, with or without
+
7  * modification, are permitted provided that the following conditions
+
8  * are met:
+
9  * 1. Redistributions of source code must retain the above copyright
+
10  * notice, this list of conditions and the following disclaimer.
+
11  * 2. Redistributions in binary form must reproduce the above copyright
+
12  * notice, this list of conditions and the following disclaimer in the
+
13  * documentation and/or other materials provided with the distribution.
+
14  *
+
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+
17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+
18  * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+
19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+
20  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+
21  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+
22  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+
24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
25  *
+
26  * $FreeBSD: head/lib/libarchive/archive_entry.h 201096 2009-12-28 02:41:27Z kientzle $
+
27  */
+
28 
+
29 #ifndef ARCHIVE_ENTRY_H_INCLUDED
+
30 #define ARCHIVE_ENTRY_H_INCLUDED
+
31 
+
32 /* Note: Compiler will complain if this does not match archive.h! */
+
33 #define ARCHIVE_VERSION_NUMBER 3005002
+
34 
+
35 /*
+
36  * Note: archive_entry.h is for use outside of libarchive; the
+
37  * configuration headers (config.h, archive_platform.h, etc.) are
+
38  * purely internal. Do NOT use HAVE_XXX configuration macros to
+
39  * control the behavior of this header! If you must conditionalize,
+
40  * use predefined compiler and/or platform macros.
+
41  */
+
42 
+
43 #include <sys/types.h>
+
44 #include <stddef.h> /* for wchar_t */
+
45 #include <stdint.h>
+
46 #include <time.h>
+
47 
+
48 #if defined(_WIN32) && !defined(__CYGWIN__)
+
49 #include <windows.h>
+
50 #endif
+
51 
+
52 /* Get a suitable 64-bit integer type. */
+
53 #if !defined(__LA_INT64_T_DEFINED)
+
54 # if ARCHIVE_VERSION_NUMBER < 4000000
+
55 #define __LA_INT64_T la_int64_t
+
56 # endif
+
57 #define __LA_INT64_T_DEFINED
+
58 # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
+
59 typedef __int64 la_int64_t;
+
60 # else
+
61 #include <unistd.h>
+
62 # if defined(_SCO_DS) || defined(__osf__)
+
63 typedef long long la_int64_t;
+
64 # else
+
65 typedef int64_t la_int64_t;
+
66 # endif
+
67 # endif
+
68 #endif
+
69 
+
70 /* The la_ssize_t should match the type used in 'struct stat' */
+
71 #if !defined(__LA_SSIZE_T_DEFINED)
+
72 /* Older code relied on the __LA_SSIZE_T macro; after 4.0 we'll switch to the typedef exclusively. */
+
73 # if ARCHIVE_VERSION_NUMBER < 4000000
+
74 #define __LA_SSIZE_T la_ssize_t
+
75 # endif
+
76 #define __LA_SSIZE_T_DEFINED
+
77 # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
+
78 # if defined(_SSIZE_T_DEFINED) || defined(_SSIZE_T_)
+
79 typedef ssize_t la_ssize_t;
+
80 # elif defined(_WIN64)
+
81 typedef __int64 la_ssize_t;
+
82 # else
+
83 typedef long la_ssize_t;
+
84 # endif
+
85 # else
+
86 # include <unistd.h> /* ssize_t */
+
87 typedef ssize_t la_ssize_t;
+
88 # endif
+
89 #endif
+
90 
+
91 /* Get a suitable definition for mode_t */
+
92 #if ARCHIVE_VERSION_NUMBER >= 3999000
+
93 /* Switch to plain 'int' for libarchive 4.0. It's less broken than 'mode_t' */
+
94 # define __LA_MODE_T int
+
95 #elif defined(_WIN32) && !defined(__CYGWIN__) && !defined(__BORLANDC__) && !defined(__WATCOMC__)
+
96 # define __LA_MODE_T unsigned short
+
97 #else
+
98 # define __LA_MODE_T mode_t
+
99 #endif
+
100 
+
101 /* Large file support for Android */
+
102 #ifdef __ANDROID__
+
103 #include "android_lf.h"
+
104 #endif
+
105 
+
106 /*
+
107  * On Windows, define LIBARCHIVE_STATIC if you're building or using a
+
108  * .lib. The default here assumes you're building a DLL. Only
+
109  * libarchive source should ever define __LIBARCHIVE_BUILD.
+
110  */
+
111 #if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC)
+
112 # ifdef __LIBARCHIVE_BUILD
+
113 # ifdef __GNUC__
+
114 # define __LA_DECL __attribute__((dllexport)) extern
+
115 # else
+
116 # define __LA_DECL __declspec(dllexport)
+
117 # endif
+
118 # else
+
119 # ifdef __GNUC__
+
120 # define __LA_DECL
+
121 # else
+
122 # define __LA_DECL __declspec(dllimport)
+
123 # endif
+
124 # endif
+
125 #else
+
126 /* Static libraries on all platforms and shared libraries on non-Windows. */
+
127 # define __LA_DECL
+
128 #endif
+
129 
+
130 #if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1
+
131 # define __LA_DEPRECATED __attribute__((deprecated))
+
132 #else
+
133 # define __LA_DEPRECATED
+
134 #endif
+
135 
+
136 #ifdef __cplusplus
+
137 extern "C" {
+
138 #endif
+
139 
+
140 /*
+
141  * Description of an archive entry.
+
142  *
+
143  * You can think of this as "struct stat" with some text fields added in.
+
144  *
+
145  * TODO: Add "comment", "charset", and possibly other entries that are
+
146  * supported by "pax interchange" format. However, GNU, ustar, cpio,
+
147  * and other variants don't support these features, so they're not an
+
148  * excruciatingly high priority right now.
+
149  *
+
150  * TODO: "pax interchange" format allows essentially arbitrary
+
151  * key/value attributes to be attached to any entry. Supporting
+
152  * such extensions may make this library useful for special
+
153  * applications (e.g., a package manager could attach special
+
154  * package-management attributes to each entry).
+
155  */
+
156 struct archive;
+
157 struct archive_entry;
+
158 
+
159 /*
+
160  * File-type constants. These are returned from archive_entry_filetype()
+
161  * and passed to archive_entry_set_filetype().
+
162  *
+
163  * These values match S_XXX defines on every platform I've checked,
+
164  * including Windows, AIX, Linux, Solaris, and BSD. They're
+
165  * (re)defined here because platforms generally don't define the ones
+
166  * they don't support. For example, Windows doesn't define S_IFLNK or
+
167  * S_IFBLK. Instead of having a mass of conditional logic and system
+
168  * checks to define any S_XXX values that aren't supported locally,
+
169  * I've just defined a new set of such constants so that
+
170  * libarchive-based applications can manipulate and identify archive
+
171  * entries properly even if the hosting platform can't store them on
+
172  * disk.
+
173  *
+
174  * These values are also used directly within some portable formats,
+
175  * such as cpio. If you find a platform that varies from these, the
+
176  * correct solution is to leave these alone and translate from these
+
177  * portable values to platform-native values when entries are read from
+
178  * or written to disk.
+
179  */
+
180 /*
+
181  * In libarchive 4.0, we can drop the casts here.
+
182  * They're needed to work around Borland C's broken mode_t.
+
183  */
+
184 #define AE_IFMT ((__LA_MODE_T)0170000)
+
185 #define AE_IFREG ((__LA_MODE_T)0100000)
+
186 #define AE_IFLNK ((__LA_MODE_T)0120000)
+
187 #define AE_IFSOCK ((__LA_MODE_T)0140000)
+
188 #define AE_IFCHR ((__LA_MODE_T)0020000)
+
189 #define AE_IFBLK ((__LA_MODE_T)0060000)
+
190 #define AE_IFDIR ((__LA_MODE_T)0040000)
+
191 #define AE_IFIFO ((__LA_MODE_T)0010000)
+
192 
+
193 /*
+
194  * Symlink types
+
195  */
+
196 #define AE_SYMLINK_TYPE_UNDEFINED 0
+
197 #define AE_SYMLINK_TYPE_FILE 1
+
198 #define AE_SYMLINK_TYPE_DIRECTORY 2
+
199 
+
200 /*
+
201  * Basic object manipulation
+
202  */
+
203 
+
204 __LA_DECL struct archive_entry *archive_entry_clear(struct archive_entry *);
+
205 /* The 'clone' function does a deep copy; all of the strings are copied too. */
+
206 __LA_DECL struct archive_entry *archive_entry_clone(struct archive_entry *);
+
207 __LA_DECL void archive_entry_free(struct archive_entry *);
+
208 __LA_DECL struct archive_entry *archive_entry_new(void);
+
209 
+
210 /*
+
211  * This form of archive_entry_new2() will pull character-set
+
212  * conversion information from the specified archive handle. The
+
213  * older archive_entry_new(void) form is equivalent to calling
+
214  * archive_entry_new2(NULL) and will result in the use of an internal
+
215  * default character-set conversion.
+
216  */
+
217 __LA_DECL struct archive_entry *archive_entry_new2(struct archive *);
+
218 
+
219 /*
+
220  * Retrieve fields from an archive_entry.
+
221  *
+
222  * There are a number of implicit conversions among these fields. For
+
223  * example, if a regular string field is set and you read the _w wide
+
224  * character field, the entry will implicitly convert narrow-to-wide
+
225  * using the current locale. Similarly, dev values are automatically
+
226  * updated when you write devmajor or devminor and vice versa.
+
227  *
+
228  * In addition, fields can be "set" or "unset." Unset string fields
+
229  * return NULL, non-string fields have _is_set() functions to test
+
230  * whether they've been set. You can "unset" a string field by
+
231  * assigning NULL; non-string fields have _unset() functions to
+
232  * unset them.
+
233  *
+
234  * Note: There is one ambiguity in the above; string fields will
+
235  * also return NULL when implicit character set conversions fail.
+
236  * This is usually what you want.
+
237  */
+
238 __LA_DECL time_t archive_entry_atime(struct archive_entry *);
+
239 __LA_DECL long archive_entry_atime_nsec(struct archive_entry *);
+
240 __LA_DECL int archive_entry_atime_is_set(struct archive_entry *);
+
241 __LA_DECL time_t archive_entry_birthtime(struct archive_entry *);
+
242 __LA_DECL long archive_entry_birthtime_nsec(struct archive_entry *);
+
243 __LA_DECL int archive_entry_birthtime_is_set(struct archive_entry *);
+
244 __LA_DECL time_t archive_entry_ctime(struct archive_entry *);
+
245 __LA_DECL long archive_entry_ctime_nsec(struct archive_entry *);
+
246 __LA_DECL int archive_entry_ctime_is_set(struct archive_entry *);
+
247 __LA_DECL dev_t archive_entry_dev(struct archive_entry *);
+
248 __LA_DECL int archive_entry_dev_is_set(struct archive_entry *);
+
249 __LA_DECL dev_t archive_entry_devmajor(struct archive_entry *);
+
250 __LA_DECL dev_t archive_entry_devminor(struct archive_entry *);
+
251 __LA_DECL __LA_MODE_T archive_entry_filetype(struct archive_entry *);
+
252 __LA_DECL void archive_entry_fflags(struct archive_entry *,
+
253  unsigned long * /* set */,
+
254  unsigned long * /* clear */);
+
255 __LA_DECL const char *archive_entry_fflags_text(struct archive_entry *);
+
256 __LA_DECL la_int64_t archive_entry_gid(struct archive_entry *);
+
257 __LA_DECL const char *archive_entry_gname(struct archive_entry *);
+
258 __LA_DECL const char *archive_entry_gname_utf8(struct archive_entry *);
+
259 __LA_DECL const wchar_t *archive_entry_gname_w(struct archive_entry *);
+
260 __LA_DECL const char *archive_entry_hardlink(struct archive_entry *);
+
261 __LA_DECL const char *archive_entry_hardlink_utf8(struct archive_entry *);
+
262 __LA_DECL const wchar_t *archive_entry_hardlink_w(struct archive_entry *);
+
263 __LA_DECL la_int64_t archive_entry_ino(struct archive_entry *);
+
264 __LA_DECL la_int64_t archive_entry_ino64(struct archive_entry *);
+
265 __LA_DECL int archive_entry_ino_is_set(struct archive_entry *);
+
266 __LA_DECL __LA_MODE_T archive_entry_mode(struct archive_entry *);
+
267 __LA_DECL time_t archive_entry_mtime(struct archive_entry *);
+
268 __LA_DECL long archive_entry_mtime_nsec(struct archive_entry *);
+
269 __LA_DECL int archive_entry_mtime_is_set(struct archive_entry *);
+
270 __LA_DECL unsigned int archive_entry_nlink(struct archive_entry *);
+
271 __LA_DECL const char *archive_entry_pathname(struct archive_entry *);
+
272 __LA_DECL const char *archive_entry_pathname_utf8(struct archive_entry *);
+
273 __LA_DECL const wchar_t *archive_entry_pathname_w(struct archive_entry *);
+
274 __LA_DECL __LA_MODE_T archive_entry_perm(struct archive_entry *);
+
275 __LA_DECL dev_t archive_entry_rdev(struct archive_entry *);
+
276 __LA_DECL dev_t archive_entry_rdevmajor(struct archive_entry *);
+
277 __LA_DECL dev_t archive_entry_rdevminor(struct archive_entry *);
+
278 __LA_DECL const char *archive_entry_sourcepath(struct archive_entry *);
+
279 __LA_DECL const wchar_t *archive_entry_sourcepath_w(struct archive_entry *);
+
280 __LA_DECL la_int64_t archive_entry_size(struct archive_entry *);
+
281 __LA_DECL int archive_entry_size_is_set(struct archive_entry *);
+
282 __LA_DECL const char *archive_entry_strmode(struct archive_entry *);
+
283 __LA_DECL const char *archive_entry_symlink(struct archive_entry *);
+
284 __LA_DECL const char *archive_entry_symlink_utf8(struct archive_entry *);
+
285 __LA_DECL int archive_entry_symlink_type(struct archive_entry *);
+
286 __LA_DECL const wchar_t *archive_entry_symlink_w(struct archive_entry *);
+
287 __LA_DECL la_int64_t archive_entry_uid(struct archive_entry *);
+
288 __LA_DECL const char *archive_entry_uname(struct archive_entry *);
+
289 __LA_DECL const char *archive_entry_uname_utf8(struct archive_entry *);
+
290 __LA_DECL const wchar_t *archive_entry_uname_w(struct archive_entry *);
+
291 __LA_DECL int archive_entry_is_data_encrypted(struct archive_entry *);
+
292 __LA_DECL int archive_entry_is_metadata_encrypted(struct archive_entry *);
+
293 __LA_DECL int archive_entry_is_encrypted(struct archive_entry *);
+
294 
+
295 /*
+
296  * Set fields in an archive_entry.
+
297  *
+
298  * Note: Before libarchive 2.4, there were 'set' and 'copy' versions
+
299  * of the string setters. 'copy' copied the actual string, 'set' just
+
300  * stored the pointer. In libarchive 2.4 and later, strings are
+
301  * always copied.
+
302  */
+
303 
+
304 __LA_DECL void archive_entry_set_atime(struct archive_entry *, time_t, long);
+
305 __LA_DECL void archive_entry_unset_atime(struct archive_entry *);
+
306 #if defined(_WIN32) && !defined(__CYGWIN__)
+
307 __LA_DECL void archive_entry_copy_bhfi(struct archive_entry *, BY_HANDLE_FILE_INFORMATION *);
+
308 #endif
+
309 __LA_DECL void archive_entry_set_birthtime(struct archive_entry *, time_t, long);
+
310 __LA_DECL void archive_entry_unset_birthtime(struct archive_entry *);
+
311 __LA_DECL void archive_entry_set_ctime(struct archive_entry *, time_t, long);
+
312 __LA_DECL void archive_entry_unset_ctime(struct archive_entry *);
+
313 __LA_DECL void archive_entry_set_dev(struct archive_entry *, dev_t);
+
314 __LA_DECL void archive_entry_set_devmajor(struct archive_entry *, dev_t);
+
315 __LA_DECL void archive_entry_set_devminor(struct archive_entry *, dev_t);
+
316 __LA_DECL void archive_entry_set_filetype(struct archive_entry *, unsigned int);
+
317 __LA_DECL void archive_entry_set_fflags(struct archive_entry *,
+
318  unsigned long /* set */, unsigned long /* clear */);
+
319 /* Returns pointer to start of first invalid token, or NULL if none. */
+
320 /* Note that all recognized tokens are processed, regardless. */
+
321 __LA_DECL const char *archive_entry_copy_fflags_text(struct archive_entry *,
+
322  const char *);
+
323 __LA_DECL const wchar_t *archive_entry_copy_fflags_text_w(struct archive_entry *,
+
324  const wchar_t *);
+
325 __LA_DECL void archive_entry_set_gid(struct archive_entry *, la_int64_t);
+
326 __LA_DECL void archive_entry_set_gname(struct archive_entry *, const char *);
+
327 __LA_DECL void archive_entry_set_gname_utf8(struct archive_entry *, const char *);
+
328 __LA_DECL void archive_entry_copy_gname(struct archive_entry *, const char *);
+
329 __LA_DECL void archive_entry_copy_gname_w(struct archive_entry *, const wchar_t *);
+
330 __LA_DECL int archive_entry_update_gname_utf8(struct archive_entry *, const char *);
+
331 __LA_DECL void archive_entry_set_hardlink(struct archive_entry *, const char *);
+
332 __LA_DECL void archive_entry_set_hardlink_utf8(struct archive_entry *, const char *);
+
333 __LA_DECL void archive_entry_copy_hardlink(struct archive_entry *, const char *);
+
334 __LA_DECL void archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *);
+
335 __LA_DECL int archive_entry_update_hardlink_utf8(struct archive_entry *, const char *);
+
336 __LA_DECL void archive_entry_set_ino(struct archive_entry *, la_int64_t);
+
337 __LA_DECL void archive_entry_set_ino64(struct archive_entry *, la_int64_t);
+
338 __LA_DECL void archive_entry_set_link(struct archive_entry *, const char *);
+
339 __LA_DECL void archive_entry_set_link_utf8(struct archive_entry *, const char *);
+
340 __LA_DECL void archive_entry_copy_link(struct archive_entry *, const char *);
+
341 __LA_DECL void archive_entry_copy_link_w(struct archive_entry *, const wchar_t *);
+
342 __LA_DECL int archive_entry_update_link_utf8(struct archive_entry *, const char *);
+
343 __LA_DECL void archive_entry_set_mode(struct archive_entry *, __LA_MODE_T);
+
344 __LA_DECL void archive_entry_set_mtime(struct archive_entry *, time_t, long);
+
345 __LA_DECL void archive_entry_unset_mtime(struct archive_entry *);
+
346 __LA_DECL void archive_entry_set_nlink(struct archive_entry *, unsigned int);
+
347 __LA_DECL void archive_entry_set_pathname(struct archive_entry *, const char *);
+
348 __LA_DECL void archive_entry_set_pathname_utf8(struct archive_entry *, const char *);
+
349 __LA_DECL void archive_entry_copy_pathname(struct archive_entry *, const char *);
+
350 __LA_DECL void archive_entry_copy_pathname_w(struct archive_entry *, const wchar_t *);
+
351 __LA_DECL int archive_entry_update_pathname_utf8(struct archive_entry *, const char *);
+
352 __LA_DECL void archive_entry_set_perm(struct archive_entry *, __LA_MODE_T);
+
353 __LA_DECL void archive_entry_set_rdev(struct archive_entry *, dev_t);
+
354 __LA_DECL void archive_entry_set_rdevmajor(struct archive_entry *, dev_t);
+
355 __LA_DECL void archive_entry_set_rdevminor(struct archive_entry *, dev_t);
+
356 __LA_DECL void archive_entry_set_size(struct archive_entry *, la_int64_t);
+
357 __LA_DECL void archive_entry_unset_size(struct archive_entry *);
+
358 __LA_DECL void archive_entry_copy_sourcepath(struct archive_entry *, const char *);
+
359 __LA_DECL void archive_entry_copy_sourcepath_w(struct archive_entry *, const wchar_t *);
+
360 __LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *);
+
361 __LA_DECL void archive_entry_set_symlink_type(struct archive_entry *, int);
+
362 __LA_DECL void archive_entry_set_symlink_utf8(struct archive_entry *, const char *);
+
363 __LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *);
+
364 __LA_DECL void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *);
+
365 __LA_DECL int archive_entry_update_symlink_utf8(struct archive_entry *, const char *);
+
366 __LA_DECL void archive_entry_set_uid(struct archive_entry *, la_int64_t);
+
367 __LA_DECL void archive_entry_set_uname(struct archive_entry *, const char *);
+
368 __LA_DECL void archive_entry_set_uname_utf8(struct archive_entry *, const char *);
+
369 __LA_DECL void archive_entry_copy_uname(struct archive_entry *, const char *);
+
370 __LA_DECL void archive_entry_copy_uname_w(struct archive_entry *, const wchar_t *);
+
371 __LA_DECL int archive_entry_update_uname_utf8(struct archive_entry *, const char *);
+
372 __LA_DECL void archive_entry_set_is_data_encrypted(struct archive_entry *, char is_encrypted);
+
373 __LA_DECL void archive_entry_set_is_metadata_encrypted(struct archive_entry *, char is_encrypted);
+
374 /*
+
375  * Routines to bulk copy fields to/from a platform-native "struct
+
376  * stat." Libarchive used to just store a struct stat inside of each
+
377  * archive_entry object, but this created issues when trying to
+
378  * manipulate archives on systems different than the ones they were
+
379  * created on.
+
380  *
+
381  * TODO: On Linux and other LFS systems, provide both stat32 and
+
382  * stat64 versions of these functions and all of the macro glue so
+
383  * that archive_entry_stat is magically defined to
+
384  * archive_entry_stat32 or archive_entry_stat64 as appropriate.
+
385  */
+
386 __LA_DECL const struct stat *archive_entry_stat(struct archive_entry *);
+
387 __LA_DECL void archive_entry_copy_stat(struct archive_entry *, const struct stat *);
+
388 
+
389 /*
+
390  * Storage for Mac OS-specific AppleDouble metadata information.
+
391  * Apple-format tar files store a separate binary blob containing
+
392  * encoded metadata with ACL, extended attributes, etc.
+
393  * This provides a place to store that blob.
+
394  */
+
395 
+
396 __LA_DECL const void * archive_entry_mac_metadata(struct archive_entry *, size_t *);
+
397 __LA_DECL void archive_entry_copy_mac_metadata(struct archive_entry *, const void *, size_t);
+
398 
+
399 /*
+
400  * Digest routine. This is used to query the raw hex digest for the
+
401  * given entry. The type of digest is provided as an argument.
+
402  */
+
403 #define ARCHIVE_ENTRY_DIGEST_MD5 0x00000001
+
404 #define ARCHIVE_ENTRY_DIGEST_RMD160 0x00000002
+
405 #define ARCHIVE_ENTRY_DIGEST_SHA1 0x00000003
+
406 #define ARCHIVE_ENTRY_DIGEST_SHA256 0x00000004
+
407 #define ARCHIVE_ENTRY_DIGEST_SHA384 0x00000005
+
408 #define ARCHIVE_ENTRY_DIGEST_SHA512 0x00000006
+
409 
+
410 __LA_DECL const unsigned char * archive_entry_digest(struct archive_entry *, int /* type */);
+
411 
+
412 /*
+
413  * ACL routines. This used to simply store and return text-format ACL
+
414  * strings, but that proved insufficient for a number of reasons:
+
415  * = clients need control over uname/uid and gname/gid mappings
+
416  * = there are many different ACL text formats
+
417  * = would like to be able to read/convert archives containing ACLs
+
418  * on platforms that lack ACL libraries
+
419  *
+
420  * This last point, in particular, forces me to implement a reasonably
+
421  * complete set of ACL support routines.
+
422  */
+
423 
+
424 /*
+
425  * Permission bits.
+
426  */
+
427 #define ARCHIVE_ENTRY_ACL_EXECUTE 0x00000001
+
428 #define ARCHIVE_ENTRY_ACL_WRITE 0x00000002
+
429 #define ARCHIVE_ENTRY_ACL_READ 0x00000004
+
430 #define ARCHIVE_ENTRY_ACL_READ_DATA 0x00000008
+
431 #define ARCHIVE_ENTRY_ACL_LIST_DIRECTORY 0x00000008
+
432 #define ARCHIVE_ENTRY_ACL_WRITE_DATA 0x00000010
+
433 #define ARCHIVE_ENTRY_ACL_ADD_FILE 0x00000010
+
434 #define ARCHIVE_ENTRY_ACL_APPEND_DATA 0x00000020
+
435 #define ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY 0x00000020
+
436 #define ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS 0x00000040
+
437 #define ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS 0x00000080
+
438 #define ARCHIVE_ENTRY_ACL_DELETE_CHILD 0x00000100
+
439 #define ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES 0x00000200
+
440 #define ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES 0x00000400
+
441 #define ARCHIVE_ENTRY_ACL_DELETE 0x00000800
+
442 #define ARCHIVE_ENTRY_ACL_READ_ACL 0x00001000
+
443 #define ARCHIVE_ENTRY_ACL_WRITE_ACL 0x00002000
+
444 #define ARCHIVE_ENTRY_ACL_WRITE_OWNER 0x00004000
+
445 #define ARCHIVE_ENTRY_ACL_SYNCHRONIZE 0x00008000
+
446 
+
447 #define ARCHIVE_ENTRY_ACL_PERMS_POSIX1E \
+
448  (ARCHIVE_ENTRY_ACL_EXECUTE \
+
449  | ARCHIVE_ENTRY_ACL_WRITE \
+
450  | ARCHIVE_ENTRY_ACL_READ)
+
451 
+
452 #define ARCHIVE_ENTRY_ACL_PERMS_NFS4 \
+
453  (ARCHIVE_ENTRY_ACL_EXECUTE \
+
454  | ARCHIVE_ENTRY_ACL_READ_DATA \
+
455  | ARCHIVE_ENTRY_ACL_LIST_DIRECTORY \
+
456  | ARCHIVE_ENTRY_ACL_WRITE_DATA \
+
457  | ARCHIVE_ENTRY_ACL_ADD_FILE \
+
458  | ARCHIVE_ENTRY_ACL_APPEND_DATA \
+
459  | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY \
+
460  | ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS \
+
461  | ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS \
+
462  | ARCHIVE_ENTRY_ACL_DELETE_CHILD \
+
463  | ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES \
+
464  | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES \
+
465  | ARCHIVE_ENTRY_ACL_DELETE \
+
466  | ARCHIVE_ENTRY_ACL_READ_ACL \
+
467  | ARCHIVE_ENTRY_ACL_WRITE_ACL \
+
468  | ARCHIVE_ENTRY_ACL_WRITE_OWNER \
+
469  | ARCHIVE_ENTRY_ACL_SYNCHRONIZE)
+
470 
+
471 /*
+
472  * Inheritance values (NFS4 ACLs only); included in permset.
+
473  */
+
474 #define ARCHIVE_ENTRY_ACL_ENTRY_INHERITED 0x01000000
+
475 #define ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT 0x02000000
+
476 #define ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT 0x04000000
+
477 #define ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT 0x08000000
+
478 #define ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY 0x10000000
+
479 #define ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS 0x20000000
+
480 #define ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS 0x40000000
+
481 
+
482 #define ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4 \
+
483  (ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT \
+
484  | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT \
+
485  | ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT \
+
486  | ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY \
+
487  | ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS \
+
488  | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS \
+
489  | ARCHIVE_ENTRY_ACL_ENTRY_INHERITED)
+
490 
+
491 /* We need to be able to specify combinations of these. */
+
492 #define ARCHIVE_ENTRY_ACL_TYPE_ACCESS 0x00000100 /* POSIX.1e only */
+
493 #define ARCHIVE_ENTRY_ACL_TYPE_DEFAULT 0x00000200 /* POSIX.1e only */
+
494 #define ARCHIVE_ENTRY_ACL_TYPE_ALLOW 0x00000400 /* NFS4 only */
+
495 #define ARCHIVE_ENTRY_ACL_TYPE_DENY 0x00000800 /* NFS4 only */
+
496 #define ARCHIVE_ENTRY_ACL_TYPE_AUDIT 0x00001000 /* NFS4 only */
+
497 #define ARCHIVE_ENTRY_ACL_TYPE_ALARM 0x00002000 /* NFS4 only */
+
498 #define ARCHIVE_ENTRY_ACL_TYPE_POSIX1E (ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
+
499  | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
+
500 #define ARCHIVE_ENTRY_ACL_TYPE_NFS4 (ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
+
501  | ARCHIVE_ENTRY_ACL_TYPE_DENY \
+
502  | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
+
503  | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
+
504 
+
505 /* Tag values mimic POSIX.1e */
+
506 #define ARCHIVE_ENTRY_ACL_USER 10001 /* Specified user. */
+
507 #define ARCHIVE_ENTRY_ACL_USER_OBJ 10002 /* User who owns the file. */
+
508 #define ARCHIVE_ENTRY_ACL_GROUP 10003 /* Specified group. */
+
509 #define ARCHIVE_ENTRY_ACL_GROUP_OBJ 10004 /* Group who owns the file. */
+
510 #define ARCHIVE_ENTRY_ACL_MASK 10005 /* Modify group access (POSIX.1e only) */
+
511 #define ARCHIVE_ENTRY_ACL_OTHER 10006 /* Public (POSIX.1e only) */
+
512 #define ARCHIVE_ENTRY_ACL_EVERYONE 10107 /* Everyone (NFS4 only) */
+
513 
+
514 /*
+
515  * Set the ACL by clearing it and adding entries one at a time.
+
516  * Unlike the POSIX.1e ACL routines, you must specify the type
+
517  * (access/default) for each entry. Internally, the ACL data is just
+
518  * a soup of entries. API calls here allow you to retrieve just the
+
519  * entries of interest. This design (which goes against the spirit of
+
520  * POSIX.1e) is useful for handling archive formats that combine
+
521  * default and access information in a single ACL list.
+
522  */
+
523 __LA_DECL void archive_entry_acl_clear(struct archive_entry *);
+
524 __LA_DECL int archive_entry_acl_add_entry(struct archive_entry *,
+
525  int /* type */, int /* permset */, int /* tag */,
+
526  int /* qual */, const char * /* name */);
+
527 __LA_DECL int archive_entry_acl_add_entry_w(struct archive_entry *,
+
528  int /* type */, int /* permset */, int /* tag */,
+
529  int /* qual */, const wchar_t * /* name */);
+
530 
+
531 /*
+
532  * To retrieve the ACL, first "reset", then repeatedly ask for the
+
533  * "next" entry. The want_type parameter allows you to request only
+
534  * certain types of entries.
+
535  */
+
536 __LA_DECL int archive_entry_acl_reset(struct archive_entry *, int /* want_type */);
+
537 __LA_DECL int archive_entry_acl_next(struct archive_entry *, int /* want_type */,
+
538  int * /* type */, int * /* permset */, int * /* tag */,
+
539  int * /* qual */, const char ** /* name */);
+
540 
+
541 /*
+
542  * Construct a text-format ACL. The flags argument is a bitmask that
+
543  * can include any of the following:
+
544  *
+
545  * Flags only for archive entries with POSIX.1e ACL:
+
546  * ARCHIVE_ENTRY_ACL_TYPE_ACCESS - Include POSIX.1e "access" entries.
+
547  * ARCHIVE_ENTRY_ACL_TYPE_DEFAULT - Include POSIX.1e "default" entries.
+
548  * ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT - Include "default:" before each
+
549  * default ACL entry.
+
550  * ARCHIVE_ENTRY_ACL_STYLE_SOLARIS - Output only one colon after "other" and
+
551  * "mask" entries.
+
552  *
+
553  * Flags only for archive entries with NFSv4 ACL:
+
554  * ARCHIVE_ENTRY_ACL_STYLE_COMPACT - Do not output the minus character for
+
555  * unset permissions and flags in NFSv4 ACL permission and flag fields
+
556  *
+
557  * Flags for for archive entries with POSIX.1e ACL or NFSv4 ACL:
+
558  * ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID - Include extra numeric ID field in
+
559  * each ACL entry.
+
560  * ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA - Separate entries with comma
+
561  * instead of newline.
+
562  */
+
563 #define ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID 0x00000001
+
564 #define ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT 0x00000002
+
565 #define ARCHIVE_ENTRY_ACL_STYLE_SOLARIS 0x00000004
+
566 #define ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA 0x00000008
+
567 #define ARCHIVE_ENTRY_ACL_STYLE_COMPACT 0x00000010
+
568 
+
569 __LA_DECL wchar_t *archive_entry_acl_to_text_w(struct archive_entry *,
+
570  la_ssize_t * /* len */, int /* flags */);
+
571 __LA_DECL char *archive_entry_acl_to_text(struct archive_entry *,
+
572  la_ssize_t * /* len */, int /* flags */);
+
573 __LA_DECL int archive_entry_acl_from_text_w(struct archive_entry *,
+
574  const wchar_t * /* wtext */, int /* type */);
+
575 __LA_DECL int archive_entry_acl_from_text(struct archive_entry *,
+
576  const char * /* text */, int /* type */);
+
577 
+
578 /* Deprecated constants */
+
579 #define OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID 1024
+
580 #define OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT 2048
+
581 
+
582 /* Deprecated functions */
+
583 __LA_DECL const wchar_t *archive_entry_acl_text_w(struct archive_entry *,
+
584  int /* flags */) __LA_DEPRECATED;
+
585 __LA_DECL const char *archive_entry_acl_text(struct archive_entry *,
+
586  int /* flags */) __LA_DEPRECATED;
+
587 
+
588 /* Return bitmask of ACL types in an archive entry */
+
589 __LA_DECL int archive_entry_acl_types(struct archive_entry *);
+
590 
+
591 /* Return a count of entries matching 'want_type' */
+
592 __LA_DECL int archive_entry_acl_count(struct archive_entry *, int /* want_type */);
+
593 
+
594 /* Return an opaque ACL object. */
+
595 /* There's not yet anything clients can actually do with this... */
+
596 struct archive_acl;
+
597 __LA_DECL struct archive_acl *archive_entry_acl(struct archive_entry *);
+
598 
+
599 /*
+
600  * extended attributes
+
601  */
+
602 
+
603 __LA_DECL void archive_entry_xattr_clear(struct archive_entry *);
+
604 __LA_DECL void archive_entry_xattr_add_entry(struct archive_entry *,
+
605  const char * /* name */, const void * /* value */,
+
606  size_t /* size */);
+
607 
+
608 /*
+
609  * To retrieve the xattr list, first "reset", then repeatedly ask for the
+
610  * "next" entry.
+
611  */
+
612 
+
613 __LA_DECL int archive_entry_xattr_count(struct archive_entry *);
+
614 __LA_DECL int archive_entry_xattr_reset(struct archive_entry *);
+
615 __LA_DECL int archive_entry_xattr_next(struct archive_entry *,
+
616  const char ** /* name */, const void ** /* value */, size_t *);
+
617 
+
618 /*
+
619  * sparse
+
620  */
+
621 
+
622 __LA_DECL void archive_entry_sparse_clear(struct archive_entry *);
+
623 __LA_DECL void archive_entry_sparse_add_entry(struct archive_entry *,
+
624  la_int64_t /* offset */, la_int64_t /* length */);
+
625 
+
626 /*
+
627  * To retrieve the xattr list, first "reset", then repeatedly ask for the
+
628  * "next" entry.
+
629  */
+
630 
+
631 __LA_DECL int archive_entry_sparse_count(struct archive_entry *);
+
632 __LA_DECL int archive_entry_sparse_reset(struct archive_entry *);
+
633 __LA_DECL int archive_entry_sparse_next(struct archive_entry *,
+
634  la_int64_t * /* offset */, la_int64_t * /* length */);
+
635 
+
636 /*
+
637  * Utility to match up hardlinks.
+
638  *
+
639  * The 'struct archive_entry_linkresolver' is a cache of archive entries
+
640  * for files with multiple links. Here's how to use it:
+
641  * 1. Create a lookup object with archive_entry_linkresolver_new()
+
642  * 2. Tell it the archive format you're using.
+
643  * 3. Hand each archive_entry to archive_entry_linkify().
+
644  * That function will return 0, 1, or 2 entries that should
+
645  * be written.
+
646  * 4. Call archive_entry_linkify(resolver, NULL) until
+
647  * no more entries are returned.
+
648  * 5. Call archive_entry_linkresolver_free(resolver) to free resources.
+
649  *
+
650  * The entries returned have their hardlink and size fields updated
+
651  * appropriately. If an entry is passed in that does not refer to
+
652  * a file with multiple links, it is returned unchanged. The intention
+
653  * is that you should be able to simply filter all entries through
+
654  * this machine.
+
655  *
+
656  * To make things more efficient, be sure that each entry has a valid
+
657  * nlinks value. The hardlink cache uses this to track when all links
+
658  * have been found. If the nlinks value is zero, it will keep every
+
659  * name in the cache indefinitely, which can use a lot of memory.
+
660  *
+
661  * Note that archive_entry_size() is reset to zero if the file
+
662  * body should not be written to the archive. Pay attention!
+
663  */
+
664 struct archive_entry_linkresolver;
+
665 
+
666 /*
+
667  * There are three different strategies for marking hardlinks.
+
668  * The descriptions below name them after the best-known
+
669  * formats that rely on each strategy:
+
670  *
+
671  * "Old cpio" is the simplest, it always returns any entry unmodified.
+
672  * As far as I know, only cpio formats use this. Old cpio archives
+
673  * store every link with the full body; the onus is on the dearchiver
+
674  * to detect and properly link the files as they are restored.
+
675  * "tar" is also pretty simple; it caches a copy the first time it sees
+
676  * any link. Subsequent appearances are modified to be hardlink
+
677  * references to the first one without any body. Used by all tar
+
678  * formats, although the newest tar formats permit the "old cpio" strategy
+
679  * as well. This strategy is very simple for the dearchiver,
+
680  * and reasonably straightforward for the archiver.
+
681  * "new cpio" is trickier. It stores the body only with the last
+
682  * occurrence. The complication is that we might not
+
683  * see every link to a particular file in a single session, so
+
684  * there's no easy way to know when we've seen the last occurrence.
+
685  * The solution here is to queue one link until we see the next.
+
686  * At the end of the session, you can enumerate any remaining
+
687  * entries by calling archive_entry_linkify(NULL) and store those
+
688  * bodies. If you have a file with three links l1, l2, and l3,
+
689  * you'll get the following behavior if you see all three links:
+
690  * linkify(l1) => NULL (the resolver stores l1 internally)
+
691  * linkify(l2) => l1 (resolver stores l2, you write l1)
+
692  * linkify(l3) => l2, l3 (all links seen, you can write both).
+
693  * If you only see l1 and l2, you'll get this behavior:
+
694  * linkify(l1) => NULL
+
695  * linkify(l2) => l1
+
696  * linkify(NULL) => l2 (at end, you retrieve remaining links)
+
697  * As the name suggests, this strategy is used by newer cpio variants.
+
698  * It's noticeably more complex for the archiver, slightly more complex
+
699  * for the dearchiver than the tar strategy, but makes it straightforward
+
700  * to restore a file using any link by simply continuing to scan until
+
701  * you see a link that is stored with a body. In contrast, the tar
+
702  * strategy requires you to rescan the archive from the beginning to
+
703  * correctly extract an arbitrary link.
+
704  */
+
705 
+
706 __LA_DECL struct archive_entry_linkresolver *archive_entry_linkresolver_new(void);
+
707 __LA_DECL void archive_entry_linkresolver_set_strategy(
+
708  struct archive_entry_linkresolver *, int /* format_code */);
+
709 __LA_DECL void archive_entry_linkresolver_free(struct archive_entry_linkresolver *);
+
710 __LA_DECL void archive_entry_linkify(struct archive_entry_linkresolver *,
+
711  struct archive_entry **, struct archive_entry **);
+
712 __LA_DECL struct archive_entry *archive_entry_partial_links(
+
713  struct archive_entry_linkresolver *res, unsigned int *links);
+
714 #ifdef __cplusplus
+
715 }
+
716 #endif
+
717 
+
718 /* This is meaningless outside of this header. */
+
719 #undef __LA_DECL
+
720 
+
721 #endif /* !ARCHIVE_ENTRY_H_INCLUDED */
+
diff --git a/docs/class_b_tag_calibration-members.html b/docs/class_b_tag_calibration-members.html index 78a452d..3205535 100644 --- a/docs/class_b_tag_calibration-members.html +++ b/docs/class_b_tag_calibration-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@ - + +/* @license-end */ - + +/* @license-end */
const std::vector< BTagEntry > & getEntries (const BTagEntry::Parameters &par) const   - -void makeCSV (std::ostream &s) const -  std::string makeCSV () const   - -void readCSV (std::istream &s) -  + +void makeCSV (std::ostream &s) const +  void readCSV (const std::string &s)   + +void readCSV (std::istream &s) +  std::string tagger () const   @@ -155,7 +159,7 @@ diff --git a/docs/class_b_tag_calibration_reader-members.html b/docs/class_b_tag_calibration_reader-members.html index 68fab16..b8a3bb4 100644 --- a/docs/class_b_tag_calibration_reader-members.html +++ b/docs/class_b_tag_calibration_reader-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */
Collaboration graph
- + +
[legend]
@@ -157,7 +162,7 @@ diff --git a/docs/class_b_tag_entry__coll__graph.map b/docs/class_b_tag_entry__coll__graph.map index a3c702a..b1fc1ac 100644 --- a/docs/class_b_tag_entry__coll__graph.map +++ b/docs/class_b_tag_entry__coll__graph.map @@ -1,3 +1,4 @@ - + + diff --git a/docs/class_b_tag_entry__coll__graph.md5 b/docs/class_b_tag_entry__coll__graph.md5 index 36a8455..1190620 100644 --- a/docs/class_b_tag_entry__coll__graph.md5 +++ b/docs/class_b_tag_entry__coll__graph.md5 @@ -1 +1 @@ -770ab07e7a3eba623d30ab84380af01d \ No newline at end of file +df4d79a063238747e08ae33a41bcaa85 \ No newline at end of file diff --git a/docs/class_b_tag_entry__coll__graph.png b/docs/class_b_tag_entry__coll__graph.png index 5a30ece..2dac63f 100644 Binary files a/docs/class_b_tag_entry__coll__graph.png and b/docs/class_b_tag_entry__coll__graph.png differ diff --git a/docs/class_deep_a_k8__helper-members.html b/docs/class_deep_a_k8__helper-members.html index e079c75..1eb5d9d 100644 --- a/docs/class_deep_a_k8__helper-members.html +++ b/docs/class_deep_a_k8__helper-members.html @@ -1,9 +1,9 @@ - + - +TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

 DeepAK8_helper (std::string particle, int year, std::string workingpoint, bool massDecorr) - Construct a new DeepAK8_helper object. More...
+ Construct a new DeepAK8_helper object. More...
  std::vector< float > eval (float pt) - Lookup the scale factor and variations based on the AK8 jet momentum. Returned values are absolute {nominal, up, down}. More...
+ Lookup the scale factor and variations based on the AK8 jet momentum. Returned values are absolute {nominal, up, down}. More...
 

Detailed Description

@@ -129,7 +133,7 @@

-

Construct a new DeepAK8_helper object.

+

Construct a new DeepAK8_helper object.

Parameters
@@ -179,7 +183,7 @@

diff --git a/docs/class_eff_loader-members.html b/docs/class_eff_loader-members.html index 09db9b4..2053048 100644 --- a/docs/class_eff_loader-members.html +++ b/docs/class_eff_loader-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

particleEither "Top" or "W"

- + +/* @license-end */ - + +/* @license-end */
 Empty constructor.
   EffLoader (std::string filename, std::string histname) - Construct a new EffLoader object. More...
+ Construct a new EffLoader object. More...
  std::vector< float > eval (float xval, float yval=0, float zval=0) - Evaluate by axis value. More...
+ Evaluate by axis value. More...
  std::vector< float > eval_bybin (int binx, int biny=0, int binz=0) - Evaluate by per-axis bin numbers. More...
+ Evaluate by per-axis bin numbers. More...
  std::vector< float > eval_byglobal (int globalbin) - Evaluate by global bin number. More...
+ Evaluate by global bin number. More...
 

Detailed Description

@@ -127,7 +131,7 @@

-

Construct a new EffLoader object.

+

Construct a new EffLoader object.

Parameters
@@ -265,7 +269,7 @@

diff --git a/docs/class_gen_jet_matcher-members.html b/docs/class_gen_jet_matcher-members.html index 7a1c169..d4efbbf 100644 --- a/docs/class_gen_jet_matcher-members.html +++ b/docs/class_gen_jet_matcher-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

filenameFile to access.

- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

 GenJetMatcher (float dRMax, float dPtMaxFactor=3) - Construct a new GenJetMatcher object. More...
+ Construct a new GenJetMatcher object. More...
  LorentzV match (LorentzV &jet, RVec< LorentzV > genJets, float resolution) - Perform the actual matching. More...
+ Perform the actual matching. More...
 

Detailed Description

@@ -121,7 +125,7 @@

Parameters
- +
dRMaxThe maximum \(\Delta R\) to consider. For an AK8 jet, use 0.4.
dPtMaxFactorThe maximum \(p_{T}\) factor to consider where the difference \(p_{T}\) between the reco and gen jets must be less than dPtMaxFactor times the resolution (provided as an argument to GenJetMatcher::match). Default is 3.
dPtMaxFactorThe maximum \(p_{T}\) factor to consider where the difference \(p_{T}\) between the reco and gen jets must be less than dPtMaxFactor times the resolution (provided as an argument to GenJetMatcher::match). Default is 3.
@@ -183,7 +187,7 @@

diff --git a/docs/class_gen_particle_tree-members.html b/docs/class_gen_particle_tree-members.html index 5fcee8a..4a2b465 100644 --- a/docs/class_gen_particle_tree-members.html +++ b/docs/class_gen_particle_tree-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

-ParticleAddParticle (Particle particle) - Add particle to tree. More...
-  template<class T > ParticleAddParticle (int index, T p) - Add particle to tree. More...
+ Add particle to tree. More...
  +ParticleAddParticle (Particle particle) + Add particle to tree. More...
+  std::vector< std::vector< Particle * > > FindChain (std::string chainstring) - Find a chain of decays in the tree. More...
+ Find a chain of decays in the tree. More...
   GenParticleTree (int nParticles) - Construct a new GenParticleTree object. More...
+ Construct a new GenParticleTree object. More...
  std::vector< Particle * > GetChildren (Particle *particle) - Get the list of child particles for a given particle in the tree. More...
+ Get the list of child particles for a given particle in the tree. More...
  ParticleGetParent (Particle *particle) - Get the parent of the given particle in the tree. More...
+ Get the parent of the given particle in the tree. More...
  std::vector< Particle * > GetParticles () - Get the list of particle objects. More...
+ Get the list of particle objects. More...
 

Detailed Description

@@ -123,7 +127,7 @@

-

Construct a new GenParticleTree object.

+

Construct a new GenParticleTree object.

Parameters
@@ -134,34 +138,8 @@

Member Function Documentation

- -

◆ AddParticle() [1/2]

- -
-
-
nParticles
- - - - - - - -
Particle * AddParticle (Particle particle)
-

- -

Add particle to tree.

-
Parameters
- - -
particle
-
-
- -
- -

◆ AddParticle() [2/2]

+

◆ AddParticle() [1/2]

@@ -202,6 +180,32 @@

Returns
Particle*
+

+
+ +

◆ AddParticle() [2/2]

+ +
+
+ + + + + + + + +
Particle * AddParticle (Particle particle)
+
+ +

Add particle to tree.

+
Parameters
+ + +
particle
+
+
+
@@ -314,7 +318,7 @@

diff --git a/docs/class_h_e_m__drop-members.html b/docs/class_h_e_m__drop-members.html index 3708d24..79d4bd6 100644 --- a/docs/class_h_e_m__drop-members.html +++ b/docs/class_h_e_m__drop-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@ - + +/* @license-end */ - + +/* @license-end */

Public Member Functions

std::vector< float > eval (RVec< float > FatJet_eta, RVec< float > FatJet_phi, int run=0) - Return an event weight based on the existence of at least one jet in the affected HEM15/16 region. The algorithm is meant to drop the event entirely in data if there is a jet in this region and to weight down the event if affected in simulation. More...
+ Return an event weight based on the existence of at least one jet in the affected HEM15/16 region. The algorithm is meant to drop the event entirely in data if there is a jet in this region and to weight down the event if affected in simulation. More...
   HEM_drop (std::string setname, std::vector< int > idxToCheck={}) - Constructor for HEM_drop. More...
+ Constructor for HEM_drop. More...
 

Detailed Description

@@ -117,7 +121,7 @@

-

Constructor for HEM_drop.

+

Constructor for HEM_drop.

Parameters
@@ -166,7 +170,8 @@

- +
setnamedataA, dataB, dataC, dataD, or some MC name (does not matter what)
runrun for data. Defaults to 0 (to be used with MC).
FatJet_eta
FatJet_phi
FatJet_phi
+
@@ -182,7 +187,7 @@

diff --git a/docs/class_hist_loader-members.html b/docs/class_hist_loader-members.html index 5305b67..4c8ec8c 100644 --- a/docs/class_hist_loader-members.html +++ b/docs/class_hist_loader-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

std::vector< float > eval (float xval, float yval=0., float zval=0.) - Evaluate by axis value. More...
+ Evaluate by axis value. More...
  std::vector< float > eval_bybin (int binx, int biny=0, int binz=0) - Evaluate by bin numbers. More...
+ Evaluate by bin numbers. More...
   HistLoader ()  Empty constructor.
   HistLoader (std::string filename, std::string histname) - Construct a new HistLoader object. More...
+ Construct a new HistLoader object. More...
 

@@ -132,7 +136,7 @@

-

Construct a new HistLoader object.

+

Construct a new HistLoader object.

Parameters
@@ -243,7 +247,7 @@

diff --git a/docs/class_j_e_r__weight-members.html b/docs/class_j_e_r__weight-members.html index 63781a6..4d3a2a8 100644 --- a/docs/class_j_e_r__weight-members.html +++ b/docs/class_j_e_r__weight-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

filenameFile to access.
- + +/* @license-end */
This is the complete list of members for JER_weight, including all inherited members.

- +
eval(std::vector< Tjet > jets, std::vector< TgenJet > genJets, float fixedGridRhoFastjetAll)JER_weight
eval(std::vector< Tjet > jets, std::vector< TgenJet > genJets, float fixedGridRhoFastjetAll)JER_weight
JER_weight(std::string jerTag, std::string jetType)JER_weight
~JER_weight() (defined in JER_weight)JER_weight
@@ -83,7 +87,7 @@ diff --git a/docs/class_j_e_r__weight.html b/docs/class_j_e_r__weight.html index cd0023b..dd2cced 100644 --- a/docs/class_j_e_r__weight.html +++ b/docs/class_j_e_r__weight.html @@ -1,9 +1,9 @@ - + - + TIMBER: JER_weight Class Reference @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

- + +/* @license-end */

Public Member Functions

-template<class Tjet , class TgenJet > -RVec< RVec< float > > eval (std::vector< Tjet > jets, std::vector< TgenJet > genJets, float fixedGridRhoFastjetAll) - Evaluation calculates the factor necessary for each jet in the provided vector of jets* in order to smear the jet \(p_{T}\) distribution. See JetSmearer for more information on the smearing algorithm. More...
-  +template<class Tjet , class TgenJet > +RVec< RVec< float > > eval (std::vector< Tjet > jets, std::vector< TgenJet > genJets, float fixedGridRhoFastjetAll) + Evaluation calculates the factor necessary for each jet in the provided vector of jets* in order to smear the jet \(p_{T}\) distribution. See JetSmearer for more information on the smearing algorithm. More...
+   JER_weight (std::string jerTag, std::string jetType) - Construct a new JER weight object. More...
+ Construct a new JER weight object. More...
 

Detailed Description

@@ -130,14 +134,14 @@

Member Function Documentation

- -

◆ eval()

+ +

◆ eval()

- + @@ -162,7 +166,7 @@

-

Evaluation calculates the factor necessary for each jet in the provided vector of jets* in order to smear the jet \(p_{T}\) distribution. See JetSmearer for more information on the smearing algorithm.

+

Evaluation calculates the factor necessary for each jet in the provided vector of jets* in order to smear the jet \(p_{T}\) distribution. See JetSmearer for more information on the smearing algorithm.

Parameters

RVec< RVec<float> > eval RVec<RVec<float> > eval ( std::vector< Tjet >  jets,
@@ -184,7 +188,7 @@

diff --git a/docs/class_j_e_rpaths-members.html b/docs/class_j_e_rpaths-members.html index e8d00cd..30dc72a 100644 --- a/docs/class_j_e_rpaths-members.html +++ b/docs/class_j_e_rpaths-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

jetsVector of structs with the jet collection branches as attributes.
- + +/* @license-end */
This is the complete list of members for JERpaths, including all inherited members.

- - - - - - - - - - + + + +
_GetPath(str tarfile, str jmefile)JMEpathsprivate
_GetTxtFileStr(str tarfile, str jmefile)JMEpathsprivate
_jmeArchivePathJMEpathsprivate
_tempdirJMEpathsprivate
_timberPathJMEpathsprivate
GetResolution()JERpaths
GetSF()JERpaths
JERpaths()JERpaths
JERpaths(str jerTag, str jetType)JERpaths
JMEpaths()JMEpathsprivate
GetResolution()JERpaths
GetSF()JERpaths
JERpaths()JERpaths
JERpaths(str jerTag, str jetType)JERpaths
diff --git a/docs/class_j_e_rpaths.html b/docs/class_j_e_rpaths.html index 73f36b0..6d031dd 100644 --- a/docs/class_j_e_rpaths.html +++ b/docs/class_j_e_rpaths.html @@ -1,9 +1,9 @@ - + - + TIMBER: JERpaths Class Reference @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
Inheritance graph
- + +
[legend]
@@ -91,25 +96,26 @@
Collaboration graph
- - + + +
[legend]
- + - + - + - +

Public Member Functions

JME::JetResolution GetResolution ()
 Get the JetResolution object. More...
 Get the JetResolution object. More...
 
JME::JetResolutionScaleFactor GetSF ()
 Get the JetResolutionScaleFactor object. More...
 Get the JetResolutionScaleFactor object. More...
 
 JERpaths ()
 Construct a new JERpaths object.
 Construct a new JERpaths object.
 
 JERpaths (str jerTag, str jetType)
 Construct a new JERpaths object with the JER tag and jet type specified. More...
 Construct a new JERpaths object with the JER tag and jet type specified. More...
 

Detailed Description

@@ -141,7 +147,7 @@

-

Construct a new JERpaths object with the JER tag and jet type specified.

+

Construct a new JERpaths object with the JER tag and jet type specified.

Parameters
@@ -202,7 +208,7 @@

diff --git a/docs/class_j_e_rpaths__coll__graph.map b/docs/class_j_e_rpaths__coll__graph.map index 9004c80..d8ff660 100644 --- a/docs/class_j_e_rpaths__coll__graph.map +++ b/docs/class_j_e_rpaths__coll__graph.map @@ -1,4 +1,5 @@ - - + + + diff --git a/docs/class_j_e_rpaths__coll__graph.md5 b/docs/class_j_e_rpaths__coll__graph.md5 index 67ecd05..f43bd18 100644 --- a/docs/class_j_e_rpaths__coll__graph.md5 +++ b/docs/class_j_e_rpaths__coll__graph.md5 @@ -1 +1 @@ -2e9b2db80b52a78e302dbad9dfdb96c1 \ No newline at end of file +92e995d8ed593493dba25b93fb6a9201 \ No newline at end of file diff --git a/docs/class_j_e_rpaths__coll__graph.png b/docs/class_j_e_rpaths__coll__graph.png index 73d944e..365f772 100644 Binary files a/docs/class_j_e_rpaths__coll__graph.png and b/docs/class_j_e_rpaths__coll__graph.png differ diff --git a/docs/class_j_e_rpaths__inherit__graph.map b/docs/class_j_e_rpaths__inherit__graph.map index e588b06..0e07055 100644 --- a/docs/class_j_e_rpaths__inherit__graph.map +++ b/docs/class_j_e_rpaths__inherit__graph.map @@ -1,3 +1,4 @@ - + + diff --git a/docs/class_j_e_rpaths__inherit__graph.md5 b/docs/class_j_e_rpaths__inherit__graph.md5 index 5efe4c2..d89c037 100644 --- a/docs/class_j_e_rpaths__inherit__graph.md5 +++ b/docs/class_j_e_rpaths__inherit__graph.md5 @@ -1 +1 @@ -0e07be788b52fb8a4ecf87eb63c9e4ca \ No newline at end of file +27d176222fcbc0ee106c2a89bdb79ce7 \ No newline at end of file diff --git a/docs/class_j_e_rpaths__inherit__graph.png b/docs/class_j_e_rpaths__inherit__graph.png index 60b16b5..6d9c5d8 100644 Binary files a/docs/class_j_e_rpaths__inherit__graph.png and b/docs/class_j_e_rpaths__inherit__graph.png differ diff --git a/docs/class_j_e_s__weight-members.html b/docs/class_j_e_s__weight-members.html index b6b6ea9..d595d80 100644 --- a/docs/class_j_e_s__weight-members.html +++ b/docs/class_j_e_s__weight-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

jerTag

- + +/* @license-end */
This is the complete list of members for JES_weight, including all inherited members.

- +
eval(std::vector< T > jets, float fixedGridRhoFastjetAll)JES_weight
eval(std::vector< T > jets, float fixedGridRhoFastjetAll)JES_weight
JES_weight(str jecTag, str jetType, str uncertType="", bool redoJECs=false)JES_weight
~JES_weight() (defined in JES_weight)JES_weight
@@ -83,7 +87,7 @@ diff --git a/docs/class_j_e_s__weight.html b/docs/class_j_e_s__weight.html index 13dd377..58d19bd 100644 --- a/docs/class_j_e_s__weight.html +++ b/docs/class_j_e_s__weight.html @@ -1,9 +1,9 @@ - + - + TIMBER: JES_weight Class Reference @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */

Public Member Functions

-template<class T > -RVec< RVec< float > > eval (std::vector< T > jets, float fixedGridRhoFastjetAll) - If redoJECs is true, evaluation calculates the weight necessary to uncorrect and recorrect the jet energy for each jet in the provided vector of jets*. In either case of redoJECs, the uncertainties are calculated. See JetRecalibrator for more information on the algorithm. More...
-  +template<class T > +RVec< RVec< float > > eval (std::vector< T > jets, float fixedGridRhoFastjetAll) + If redoJECs is true, evaluation calculates the weight necessary to uncorrect and recorrect the jet energy for each jet in the provided vector of jets*. In either case of redoJECs, the uncertainties are calculated. See JetRecalibrator for more information on the algorithm. More...
+   JES_weight (str jecTag, str jetType, str uncertType="", bool redoJECs=false) - Construct a new JES weight object. More...
+ Construct a new JES weight object. More...
 

Detailed Description

@@ -144,14 +148,14 @@

Member Function Documentation

- -

◆ eval()

+ +

◆ eval()

- + @@ -194,7 +198,7 @@

diff --git a/docs/class_j_e_spaths-members.html b/docs/class_j_e_spaths-members.html index edf2ce9..63271b6 100644 --- a/docs/class_j_e_spaths-members.html +++ b/docs/class_j_e_spaths-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

RVec< RVec<float> > eval RVec<RVec<float> > eval ( std::vector< T >  jets,
- + +/* @license-end */
This is the complete list of members for JESpaths, including all inherited members.

- - - - - - - - - - + + + +
_GetPath(str tarfile, str jmefile)JMEpathsprivate
_GetTxtFileStr(str tarfile, str jmefile)JMEpathsprivate
_jmeArchivePathJMEpathsprivate
_tempdirJMEpathsprivate
_timberPathJMEpathsprivate
GetParameters(str level, str uncertType="")JESpaths
GetTxtFileStr(str level)JESpaths
JESpaths()JESpaths
JESpaths(str jecTag, str jetType)JESpaths
JMEpaths()JMEpathsprivate
GetParameters(str level, str uncertType="")JESpaths
GetTxtFileStr(str level)JESpaths
JESpaths()JESpaths
JESpaths(str jecTag, str jetType)JESpaths
diff --git a/docs/class_j_e_spaths.html b/docs/class_j_e_spaths.html index cccace6..57a2b63 100644 --- a/docs/class_j_e_spaths.html +++ b/docs/class_j_e_spaths.html @@ -1,9 +1,9 @@ - + - + TIMBER: JESpaths Class Reference @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
Inheritance graph
- + +
[legend]
@@ -91,25 +96,26 @@
Collaboration graph
- - + + +
[legend]
- + - + - + - +

Public Member Functions

JetCorrectorParameters GetParameters (str level, str uncertType="")
 Get the JetCorrectorParameters object. More...
 Get the JetCorrectorParameters object. More...
 
str GetTxtFileStr (str level)
 Get the JEC file as a string. Used in JES_weight for parsing possible uncertainty sources. More...
 Get the JEC file as a string. Used in JES_weight for parsing possible uncertainty sources. More...
 
 JESpaths ()
 Construct a new JESpaths object.
 Construct a new JESpaths object.
 
 JESpaths (str jecTag, str jetType)
 Construct a new JESpaths object with the jecTag and jetType specified. More...
 Construct a new JESpaths object with the jecTag and jetType specified. More...
 

Detailed Description

@@ -141,7 +147,7 @@

-

Construct a new JESpaths object with the jecTag and jetType specified.

+

Construct a new JESpaths object with the jecTag and jetType specified.

Parameters
@@ -207,7 +213,7 @@

-

Get the JEC file as a string. Used in JES_weight for parsing possible uncertainty sources.

+

Get the JEC file as a string. Used in JES_weight for parsing possible uncertainty sources.

Parameters

jecTag
@@ -227,7 +233,7 @@

diff --git a/docs/class_j_e_spaths__coll__graph.map b/docs/class_j_e_spaths__coll__graph.map index ab77fa4..918a453 100644 --- a/docs/class_j_e_spaths__coll__graph.map +++ b/docs/class_j_e_spaths__coll__graph.map @@ -1,4 +1,5 @@ - - + + + diff --git a/docs/class_j_e_spaths__coll__graph.md5 b/docs/class_j_e_spaths__coll__graph.md5 index 13b3a08..7bf25af 100644 --- a/docs/class_j_e_spaths__coll__graph.md5 +++ b/docs/class_j_e_spaths__coll__graph.md5 @@ -1 +1 @@ -7009731d2722afba43620f13fb7c03e6 \ No newline at end of file +3158292acd109c6b3ea740dc9aa85a19 \ No newline at end of file diff --git a/docs/class_j_e_spaths__coll__graph.png b/docs/class_j_e_spaths__coll__graph.png index 09801ea..9eaf86c 100644 Binary files a/docs/class_j_e_spaths__coll__graph.png and b/docs/class_j_e_spaths__coll__graph.png differ diff --git a/docs/class_j_e_spaths__inherit__graph.map b/docs/class_j_e_spaths__inherit__graph.map index 938dfe3..8349623 100644 --- a/docs/class_j_e_spaths__inherit__graph.map +++ b/docs/class_j_e_spaths__inherit__graph.map @@ -1,3 +1,4 @@ - + + diff --git a/docs/class_j_e_spaths__inherit__graph.md5 b/docs/class_j_e_spaths__inherit__graph.md5 index 45904b8..e7bf553 100644 --- a/docs/class_j_e_spaths__inherit__graph.md5 +++ b/docs/class_j_e_spaths__inherit__graph.md5 @@ -1 +1 @@ -0310b13f0fd294cdb99640a29671807b \ No newline at end of file +232d7aa8d9d099ae09c0073e96fc769f \ No newline at end of file diff --git a/docs/class_j_e_spaths__inherit__graph.png b/docs/class_j_e_spaths__inherit__graph.png index 375de92..53cd532 100644 Binary files a/docs/class_j_e_spaths__inherit__graph.png and b/docs/class_j_e_spaths__inherit__graph.png differ diff --git a/docs/class_j_m_epaths-members.html b/docs/class_j_m_epaths-members.html index 5ed2bd4..fd0da5e 100644 --- a/docs/class_j_m_epaths-members.html +++ b/docs/class_j_m_epaths-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

levelCorrection level (ex. "L1").

- + +/* @license-end */ - + +/* @license-end */
-

C++ class. Parent class to handle shared attributes and methods among JESpaths and JERpaths. +

C++ class. Parent class to handle shared attributes and methods among JESpaths and JERpaths. More...

Inheritance diagram for JMEpaths:
Inheritance graph
- - + + +
[legend]
@@ -93,21 +98,22 @@
Collaboration graph
- + +
[legend]
- + - + - +

Public Member Functions

str _GetPath (str tarfile, str jmefile)
 Extract jmefile from tarfile into a temporary directory and return the path to that directory. More...
 Extract jmefile from tarfile into a temporary directory and return the path to that directory. More...
 
str _GetTxtFileStr (str tarfile, str jmefile)
 Extract jmefile from tarfile into a string which is returned. More...
 Extract jmefile from tarfile into a string which is returned. More...
 
 JMEpaths ()
 Construct a new JMEpaths object.
 Construct a new JMEpaths object.
 

@@ -126,7 +132,7 @@

 

Detailed Description

-

C++ class. Parent class to handle shared attributes and methods among JESpaths and JERpaths.

+

C++ class. Parent class to handle shared attributes and methods among JESpaths and JERpaths.

Member Function Documentation

◆ _GetPath()

@@ -213,7 +219,7 @@

diff --git a/docs/class_j_m_epaths__coll__graph.map b/docs/class_j_m_epaths__coll__graph.map index 4d7a68c..2ec8343 100644 --- a/docs/class_j_m_epaths__coll__graph.map +++ b/docs/class_j_m_epaths__coll__graph.map @@ -1,3 +1,4 @@ - + + diff --git a/docs/class_j_m_epaths__coll__graph.md5 b/docs/class_j_m_epaths__coll__graph.md5 index 553d175..5442ccc 100644 --- a/docs/class_j_m_epaths__coll__graph.md5 +++ b/docs/class_j_m_epaths__coll__graph.md5 @@ -1 +1 @@ -943670cbd8d64a64be83a12981318b70 \ No newline at end of file +5f23cfb501881ad87f65bb46c70a0c36 \ No newline at end of file diff --git a/docs/class_j_m_epaths__coll__graph.png b/docs/class_j_m_epaths__coll__graph.png index 32ba9fc..043941e 100644 Binary files a/docs/class_j_m_epaths__coll__graph.png and b/docs/class_j_m_epaths__coll__graph.png differ diff --git a/docs/class_j_m_epaths__inherit__graph.map b/docs/class_j_m_epaths__inherit__graph.map index 76a9550..89a0e43 100644 --- a/docs/class_j_m_epaths__inherit__graph.map +++ b/docs/class_j_m_epaths__inherit__graph.map @@ -1,4 +1,5 @@ - - + + + diff --git a/docs/class_j_m_epaths__inherit__graph.md5 b/docs/class_j_m_epaths__inherit__graph.md5 index 67551ca..285d2b8 100644 --- a/docs/class_j_m_epaths__inherit__graph.md5 +++ b/docs/class_j_m_epaths__inherit__graph.md5 @@ -1 +1 @@ -864866317bb23d52b0fd3951e14f95ae \ No newline at end of file +07eb87e90f3f3a148a05d7e44af5a9c3 \ No newline at end of file diff --git a/docs/class_j_m_epaths__inherit__graph.png b/docs/class_j_m_epaths__inherit__graph.png index 5000c67..861f1ce 100644 Binary files a/docs/class_j_m_epaths__inherit__graph.png and b/docs/class_j_m_epaths__inherit__graph.png differ diff --git a/docs/class_j_m_r__weight-members.html b/docs/class_j_m_r__weight-members.html index f5aa38b..3230cc3 100644 --- a/docs/class_j_m_r__weight-members.html +++ b/docs/class_j_m_r__weight-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

- + +/* @license-end */
This is the complete list of members for JMR_weight, including all inherited members.

- +
eval(std::vector< Tjet > jets, std::vector< TgenJet > genJets)JMR_weight
eval(std::vector< Tjet > jets, std::vector< TgenJet > genJets)JMR_weight
JMR_weight(int year)JMR_weight
~JMR_weight() (defined in JMR_weight)JMR_weight
@@ -83,7 +87,7 @@ diff --git a/docs/class_j_m_r__weight.html b/docs/class_j_m_r__weight.html index e98805e..4a87398 100644 --- a/docs/class_j_m_r__weight.html +++ b/docs/class_j_m_r__weight.html @@ -1,9 +1,9 @@ - + - + TIMBER: JMR_weight Class Reference @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */

Public Member Functions

-template<class Tjet , class TgenJet > -RVec< RVec< float > > eval (std::vector< Tjet > jets, std::vector< TgenJet > genJets) - Evaluation calculates the factor necessary for each jet in the provided vector of jets* in order to smear the jet mass distribution. See JetSmearer for more information on the smearing algorithm. More...
-  +template<class Tjet , class TgenJet > +RVec< RVec< float > > eval (std::vector< Tjet > jets, std::vector< TgenJet > genJets) + Evaluation calculates the factor necessary for each jet in the provided vector of jets* in order to smear the jet mass distribution. See JetSmearer for more information on the smearing algorithm. More...
+   JMR_weight (int year) - Construct a new JMR weight object. More...
+ Construct a new JMR weight object. More...
 

Detailed Description

@@ -124,14 +128,14 @@

Member Function Documentation

- -

◆ eval()

+ +

◆ eval()

- + @@ -150,7 +154,7 @@

-

Evaluation calculates the factor necessary for each jet in the provided vector of jets* in order to smear the jet mass distribution. See JetSmearer for more information on the smearing algorithm.

+

Evaluation calculates the factor necessary for each jet in the provided vector of jets* in order to smear the jet mass distribution. See JetSmearer for more information on the smearing algorithm.

  • NOTE that the "jet" is a struct which is custom made by TIMBER's analyzer() to have the branches of the collection as the attributes of the struct. To use it in TIMBER, just reference the vector of all struct of objections named <CollectionName>s (ex. FatJets).
@@ -174,7 +178,7 @@

diff --git a/docs/class_j_m_s__weight-members.html b/docs/class_j_m_s__weight-members.html index b32ba0e..bbb924a 100644 --- a/docs/class_j_m_s__weight-members.html +++ b/docs/class_j_m_s__weight-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

RVec< RVec<float> > eval RVec<RVec<float> > eval ( std::vector< Tjet >  jets,
- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

RVec< RVec< float > > eval (size_t nJets) - Evaluation just returns the scale factors for the provided year. The number of jets must be provided so that a weight for each jet can be stored correctly. More...
+ Evaluation just returns the scale factors for the provided year. The number of jets must be provided so that a weight for each jet can be stored correctly. More...
   JMS_weight (int year) - Construct a new JMS weight object. More...
+ Construct a new JMS weight object. More...
 

Detailed Description

@@ -159,7 +163,7 @@

diff --git a/docs/class_jet_recalibrator-members.html b/docs/class_jet_recalibrator-members.html index 5f46b3e..6e2b84d 100644 --- a/docs/class_jet_recalibrator-members.html +++ b/docs/class_jet_recalibrator-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

- + +/* @license-end */ - + +/* @license-end */
template<class T > void CalculateCorrection (T jet, float fixedGridRhoFastjetAll) - Calculate the correction for a given jet and rho and store the value internally. More...
+ Calculate the correction for a given jet and rho and store the value internally. More...
  template<class T > void CalculateUncertainty (T jet, float delta=1) - Calculate the correction uncertainty for a given jet and store the value internally. WARNING: CalculateCorrection must be run first. More...
+ Calculate the correction uncertainty for a given jet and store the value internally. WARNING: CalculateCorrection must be run first. More...
  float GetCorrection () - Return the internally stored correction value that was calculated during CalculateCorrection. More...
+ Return the internally stored correction value that was calculated during CalculateCorrection. More...
  float GetUncertainty () - Return the internally stored uncertainty value that was calculated during CalculateUncertainty. More...
+ Return the internally stored uncertainty value that was calculated during CalculateUncertainty. More...
  -JetRecalibrator () - Construct a new Jet Recalibrator object.
JetRecalibrator () + Construct a new Jet Recalibrator object. More...
   JetRecalibrator (str jecTag, str jetType, bool doResidualJECs, str uncertType, int upToLevel=3) - Construct a new Jet Recalibrator object. More...
+ Construct a new Jet Recalibrator object. More...
 

Detailed Description

C++ class to recalibrate the \(p_{T}\) of jets. Initialized with basic parameters and calculations done on vectors of jets from an event using the class methods.

Constructor & Destructor Documentation

+ +

◆ JetRecalibrator() [1/2]

+ +
+
+ + + + + + + +
JetRecalibrator ()
+
+ +

Construct a new Jet Recalibrator object.

+ +
+
-

◆ JetRecalibrator()

+

◆ JetRecalibrator() [2/2]

@@ -289,7 +311,7 @@

diff --git a/docs/class_jet_smearer-members.html b/docs/class_jet_smearer-members.html index a92a8d8..9a972fa 100644 --- a/docs/class_jet_smearer-members.html +++ b/docs/class_jet_smearer-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

TFile * GetPuppiJMRFile () - Get the file for mass resolution smearing. More...
+ Get the file for mass resolution smearing. More...
  TF1 * GetPuppiSDResolutionCentral () - Get the function for the mass resolution for the central portion of the detector. More...
+ Get the function for the mass resolution for the central portion of the detector. More...
  TF1 * GetPuppiSDResolutionForward () - Get the function for the mass resolution for the forward portion of the detector. More...
+ Get the function for the mass resolution for the forward portion of the detector. More...
  std::vector< float > GetSmearValsM (LorentzV jet, RVec< LorentzV > genJets) - Smear jet mass to account for measured difference in JMR between data and simulation. The function computes the nominal smeared jet mass simultaneously with the JMR up and down shifts, in order to use the same random number to smear all three (for consistency reasons). More...
+ Smear jet mass to account for measured difference in JMR between data and simulation. The function computes the nominal smeared jet mass simultaneously with the JMR up and down shifts, in order to use the same random number to smear all three (for consistency reasons). More...
  std::vector< float > GetSmearValsPt (LorentzV jet, RVec< LorentzV > genJets, float fixedGridRhoFastjetAll) - Smear jet pT to account for measured difference in JER between data and simulation. The function computes the nominal smeared jet pT simultaneously with the JER up and down shifts, in order to use the same random number to smear all three (for consistency reasons). More...
+ Smear jet pT to account for measured difference in JER between data and simulation. The function computes the nominal smeared jet pT simultaneously with the JER up and down shifts, in order to use the same random number to smear all three (for consistency reasons). More...
   JetSmearer (std::string jerTag, std::string jetType) - Construct a new Jet Smearer object for jet energy smearing. More...
+ Construct a new Jet Smearer object for jet energy smearing. More...
   JetSmearer (std::vector< float > jmrVals) - Construct a new Jet Smearer object for jet mass smearing. More...
+ Construct a new Jet Smearer object for jet mass smearing. More...
 

Detailed Description

@@ -325,7 +329,7 @@

diff --git a/docs/class_lumi_filter-members.html b/docs/class_lumi_filter-members.html index 59ad704..1ecbf8d 100644 --- a/docs/class_lumi_filter-members.html +++ b/docs/class_lumi_filter-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

bool eval (unsigned int run, unsigned int lumi) - Evaluate whether the given run and lumi pass the luminosity JSON filter. More...
+ Evaluate whether the given run and lumi pass the luminosity JSON filter. More...
  - LumiFilter (std::string filename) - Construct a new Lumi Filter object with a custom json file name. More...
-   LumiFilter (int year) - Construct a new Lumi Filter object for a given year. Supports formatting as 2017 or 17. 2016 not needed currently. More...
+ Construct a new Lumi Filter object for a given year. Supports formatting as (for example) 2017 or 17. More...
  + LumiFilter (std::string filename) + Construct a new Lumi Filter object with a custom json file name. More...

Detailed Description

- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

std::vector< float > eval (RVec< float > LHEPdfWeight) - Per-event evaluation function. More...
+ Per-event evaluation function. More...
   PDFweight_uncert (int lhaID, bool ignoreEmptyBranch=false) - Construct a new PDF weight uncertainty lookup object. More...
+ Construct a new PDF weight uncertainty lookup object. More...
 

Detailed Description

@@ -166,7 +170,7 @@

diff --git a/docs/class_particle-members.html b/docs/class_particle-members.html index 94b4340..a52b85e 100644 --- a/docs/class_particle-members.html +++ b/docs/class_particle-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

void AddChild (int idx) - Add child index to track. More...
+ Add child index to track. More...
  void AddParent (int idx) - Add parent index to track. More...
+ Add parent index to track. More...
  std::map< std::string, bool > CompareToVector (LVector vect) - Compares particle to a provided vector. More...
+ Compares particle to a provided vector. More...
  float DeltaR (LVector input_vector) - Calculate \(\Delta R\) between current particle and input vector. More...
+ Calculate \(\Delta R\) between current particle and input vector. More...
  std::vector< int > GetChild () - Get vector of indices of the children. More...
+ Get vector of indices of the children. More...
  int GetParent () - Return the index of the parent. More...
+ Return the index of the parent. More...
  int GetStatusFlag (std::string flagName) - Returns the bool for the flag name provided. More...
+ Returns the bool for the flag name provided. More...
   Particle () - Construct a new Particle object.
+ Construct a new Particle object.
  template<class T >  Particle (int i, T p) - Construct a new Particle object with TIMBER collection struct as input. More...
+ Construct a new Particle object with TIMBER collection struct as input. More...
  void SetStatusFlags (int flags) - Set the internal status flags map. More...
+ Set the internal status flags map. More...
 

@@ -165,7 +169,7 @@

-

Construct a new Particle object with TIMBER collection struct as input.

+

Construct a new Particle object with TIMBER collection struct as input.

Template Parameters
@@ -394,7 +398,7 @@

-

Children indices in GenParticleTree

+

Children indices in GenParticleTree

@@ -454,7 +458,7 @@

-

Parent index in GenParticleTree

+

Parent index in GenParticleTree

@@ -484,7 +488,7 @@

-

Particle status

+

Particle status

@@ -499,7 +503,8 @@

-

Map of status flags for set gen particle

+

Map of status flags for set gen particle
+

@@ -527,7 +532,7 @@

diff --git a/docs/class_pileup__weight-members.html b/docs/class_pileup__weight-members.html index f2f0b93..530a3bd 100644 --- a/docs/class_pileup__weight-members.html +++ b/docs/class_pileup__weight-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

T
- + +/* @license-end */

- + +/* @license-end */

Public Member Functions

std::vector< float > eval (int Pileup_nTrueInt) - Evaluate the pileup weight (value of ratio of data to simulation). More...
+ Evaluate the pileup weight (value of ratio of data to simulation). More...
  - Pileup_weight (std::string filename_mc, std::string filename_data, std::string histname_mc, std::string histname_data) - Construct a new Pileup_weight object, providing custom MC and data histograms to take the ratio of the true number of primary vertices. More...
-   Pileup_weight (std::string era) - Construct a new Pileup_weight object. Assumes "auto" pileup calculation for MC distribution. Calculates the ratio of the true number of primary vertices between data and simulation. More...
+ Construct a new Pileup_weight object. Assumes "auto" pileup calculation for MC distribution. Calculates the ratio of the true number of primary vertices between data and simulation. More...
  + Pileup_weight (std::string filename_mc, std::string filename_data, std::string histname_mc, std::string histname_data) + Construct a new Pileup_weight object, providing custom MC and data histograms to take the ratio of the true number of primary vertices. More...

Detailed Description

C++ class to handle pileup reweighting. Used in AutoPU.py.

@@ -132,7 +136,7 @@

-

Construct a new Pileup_weight object, providing custom MC and data histograms to take the ratio of the true number of primary vertices.

+

Construct a new Pileup_weight object, providing custom MC and data histograms to take the ratio of the true number of primary vertices.

Parameters
@@ -161,7 +165,7 @@

-

Construct a new Pileup_weight object. Assumes "auto" pileup calculation for MC distribution. Calculates the ratio of the true number of primary vertices between data and simulation.

+

Construct a new Pileup_weight object. Assumes "auto" pileup calculation for MC distribution. Calculates the ratio of the true number of primary vertices between data and simulation.

Parameters

filename_mcUse "auto" to get the number of primary vertices directly from "autoPU" histogram in memory (gDirectory)
@@ -208,7 +212,7 @@

diff --git a/docs/class_prefire__weight-members.html b/docs/class_prefire__weight-members.html index d60b130..ae0ebac 100644 --- a/docs/class_prefire__weight-members.html +++ b/docs/class_prefire__weight-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

era2016(UL), 2017(UL), 2018(UL)

- + +/* @license-end */
This is the complete list of members for Prefire_weight, including all inherited members.

- +
eval(std::vector< Jet > Jets, std::vector< Photon > Photons, std::vector< Electron > Electrons)Prefire_weight
eval(RVec< float > Jet_pt, RVec< float > Jet_eta, RVec< float > Photon_pt, RVec< float > Photon_eta, RVec< int > Photon_jetIdx, RVec< int > Photon_electronIdx, RVec< float > Electron_pt, RVec< float > Electron_eta, RVec< int > Electron_jetIdx, RVec< int > Electron_photonIdx)Prefire_weight
Prefire_weight(int year, bool UseEMpt=false)Prefire_weight
~Prefire_weight() (defined in Prefire_weight)Prefire_weight
@@ -83,7 +87,7 @@ diff --git a/docs/class_prefire__weight.html b/docs/class_prefire__weight.html index 514a929..0d86c31 100644 --- a/docs/class_prefire__weight.html +++ b/docs/class_prefire__weight.html @@ -1,9 +1,9 @@ - + - + TIMBER: Prefire_weight Class Reference @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */

Public Member Functions

-template<class Jet , class Photon , class Electron > -ROOT::VecOps::RVec< float > eval (std::vector< Jet > Jets, std::vector< Photon > Photons, std::vector< Electron > Electrons) - Calculate the value of the weight. More...
-  +ROOT::VecOps::RVec< float > eval (RVec< float > Jet_pt, RVec< float > Jet_eta, RVec< float > Photon_pt, RVec< float > Photon_eta, RVec< int > Photon_jetIdx, RVec< int > Photon_electronIdx, RVec< float > Electron_pt, RVec< float > Electron_eta, RVec< int > Electron_jetIdx, RVec< int > Electron_photonIdx) + Calculate the value of the weight. More...
+   Prefire_weight (int year, bool UseEMpt=false) - Construct a new Prefire_weight object. More...
+ Construct a new Prefire_weight object. More...
 

Detailed Description

@@ -118,7 +121,7 @@

-

Construct a new Prefire_weight object.

+

Construct a new Prefire_weight object.

Parameters
@@ -130,29 +133,71 @@

Member Function Documentation

- -

◆ eval()

+ +

◆ eval()

year
- + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -163,19 +208,18 @@

Calculate the value of the weight.

-
Template Parameters
-

ROOT::VecOps::RVec<float> eval ROOT::VecOps::RVec< float > eval (std::vector< Jet > Jets, RVec< float > Jet_pt,
std::vector< Photon > Photons, RVec< float > Jet_eta,
std::vector< Electron > Electrons RVec< float > Photon_pt,
RVec< float > Photon_eta,
RVec< int > Photon_jetIdx,
RVec< int > Photon_electronIdx,
RVec< float > Electron_pt,
RVec< float > Electron_eta,
RVec< int > Electron_jetIdx,
RVec< int > Electron_photonIdx 
- - - -
Jet
Photon
Electron
-
-
Parameters
- - - + + + + + + + + + +
JetsJetStruct from TIMBER
PhotonsPhotonStruct from TIMBER
ElectronsElectronStruct from TIMBER
Jet_pt
Jet_eta
Photon_pt
Photon_eta
Photon_jetIdx
Photon_electronIdx
Electron_pt
Electron_eta
Electron_jetIdx
Electron_photonIdx
@@ -192,7 +236,7 @@

diff --git a/docs/class_s_j_btag___s_f-members.html b/docs/class_s_j_btag___s_f-members.html index a96bced..c5e2b75 100644 --- a/docs/class_s_j_btag___s_f-members.html +++ b/docs/class_s_j_btag___s_f-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

RVec< float > eval (float pt, float eta) - Per-event evaluation function. More...
+ Per-event evaluation function. More...
   SJBtag_SF (int year, std::string tagger, std::string op_string) - Construct a new subjet b tag scale factor lookup object. More...
+ Construct a new subjet b tag scale factor lookup object. More...
 

Detailed Description

@@ -183,7 +187,7 @@

diff --git a/docs/class_temp_dir-members.html b/docs/class_temp_dir-members.html index 3677c8a..6ac0a3a 100644 --- a/docs/class_temp_dir-members.html +++ b/docs/class_temp_dir-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

std::string Hash () - Generate a hash to create a temporary random folder. More...
+ Generate a hash to create a temporary random folder. More...
  -TempDir () - Construct a new Temp Dir object.
TempDir () + Construct a new Temp Dir object. More...
  std::string Write (std::string filename, std::string in) - Write a string (in) to a file (filename) within the temporary directory. More...
+ Write a string (in) to a file (filename) within the temporary directory. More...
  -~TempDir () - Destroy the Temp Dir object.
~TempDir () + Destroy the Temp Dir object. More...
 

Detailed Description

C++ class. Creates a temporary directory that is destroyed on delete.

-

Member Function Documentation

+

Constructor & Destructor Documentation

+ +

◆ TempDir()

+ +
+
+ + + + + + + +
TempDir ()
+
+ +

Construct a new Temp Dir object.

+ +
+
+ +

◆ ~TempDir()

+ +
+
+ + + + + + + +
~TempDir ()
+
+ +

Destroy the Temp Dir object.

+ +
+
+

Member Function Documentation

◆ Hash()

@@ -166,7 +207,7 @@

diff --git a/docs/class_top_pt__weight-members.html b/docs/class_top_pt__weight-members.html index 8d9bbc4..c1c7d93 100644 --- a/docs/class_top_pt__weight-members.html +++ b/docs/class_top_pt__weight-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

RVec< float > eval (RVec< int > GenPart_pdgId, RVec< int > GenPart_statusFlags, RVec< ROOT::Math::PtEtaPhiMVector > GenPart_vect, ROOT::Math::PtEtaPhiMVector jet0, ROOT::Math::PtEtaPhiMVector jet1, float scale=0.5) - Calculate the top \(p_T\) reweighting value for \(t\bar{t}\) simulation based on doing gen particle matching. Additionally, calculate variations of the top \(p_T\) weight by varying the \(\beta\) parameter. The amount of variation can be changed via the scale arguement which is a percent change on \(\beta\). There is no corresponding function for \(\alpha\) because the effect is only a flat normalization change. More...
+ Calculate the top \(p_T\) reweighting value for \(t\bar{t}\) simulation based on doing gen particle matching. Additionally, calculate variations of the top \(p_T\) weight by varying the \(\beta\) parameter. The amount of variation can be changed via the scale arguement which is a percent change on \(\beta\). There is no corresponding function for \(\alpha\) because the effect is only a flat normalization change. More...
  -TopPt_weight () - Construct a new TopPt_weight object. No arguments.
TopPt_weight () + Construct a new TopPt_weight object. No arguments. More...
 

Detailed Description

@@ -95,8 +98,28 @@ \[ \sqrt{e^{\alpha - \beta \cdot p_{T}^{\textrm{Gen} t}} \cdot e^{\alpha - \beta \cdot p_{T}^{\textrm{Gen} \bar{t}} }} \]

.

-

where \(\alpha = 0.0615\) and \(\beta = 0.0005\). See the eval() function to calculate the weight plus variations of the \(\beta\) parameter. The \(\alpha\) parameter is not varied since it would only represent a flat normalization change.

-

Member Function Documentation

+

where \(\alpha = 0.0615\) and \(\beta = 0.0005\). See the eval() function to calculate the weight plus variations of the \(\beta\) parameter. The \(\alpha\) parameter is not varied since it would only represent a flat normalization change.

+

Constructor & Destructor Documentation

+ +

◆ TopPt_weight()

+ +
+
+ + + + + + + +
TopPt_weight ()
+
+ +

Construct a new TopPt_weight object. No arguments.

+ +
+
+

Member Function Documentation

◆ eval()

@@ -152,7 +175,7 @@

GenPart_pdgIdNanoAOD branch GenPart_statusFlagsNanoAOD branch - GenPart_vectVector of ROOT::Math::PtEtaPhiMVectors (create through hardware::TLvector) + GenPart_vectVector of ROOT::Math::PtEtaPhiMVectors (create through hardware::TLvector) jet0 jet1 scalePercent variation on \(\beta\) parameter. @@ -172,7 +195,7 @@

diff --git a/docs/class_top_tag___s_f-members.html b/docs/class_top_tag___s_f-members.html index bae2fe9..88353a1 100644 --- a/docs/class_top_tag___s_f-members.html +++ b/docs/class_top_tag___s_f-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

- + +/* @license-end */
This is the complete list of members for TopTag_SF, including all inherited members.

- +
eval(LVector top_vect, std::vector< T > GenParts)TopTag_SF
NMerged(LVector top_vect, RVec< Particle *> Ws, RVec< Particle *> quarks, GenParticleTree GPT)TopTag_SF
NMerged(LVector top_vect, RVec< Particle * > Ws, RVec< Particle * > quarks, GenParticleTree GPT)TopTag_SF
TopTag_SF(int year, int workpoint, bool NoMassCut=false)TopTag_SF
~TopTag_SF() (defined in TopTag_SF)TopTag_SF
@@ -84,7 +88,7 @@ diff --git a/docs/class_top_tag___s_f.html b/docs/class_top_tag___s_f.html index de47f44..3e2007c 100644 --- a/docs/class_top_tag___s_f.html +++ b/docs/class_top_tag___s_f.html @@ -1,9 +1,9 @@ - + - + TIMBER: TopTag_SF Class Reference @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */
template<class T > RVec< double > eval (LVector top_vect, std::vector< T > GenParts) - Evaluation function based on the reconstructed top jet pt and the matched generator particles (GenParts). More...
+ Evaluation function based on the reconstructed top jet pt and the matched generator particles (GenParts). More...
  -int NMerged (LVector top_vect, RVec< Particle *> Ws, RVec< Particle *> quarks, GenParticleTree GPT) - Finds the number of merged generator particles in the reconstructed jet. More...
-  +int NMerged (LVector top_vect, RVec< Particle * > Ws, RVec< Particle * > quarks, GenParticleTree GPT) + Finds the number of merged generator particles in the reconstructed jet. More...
+   TopTag_SF (int year, int workpoint, bool NoMassCut=false) - Construct a new TopTag_SF object. More...
+ Construct a new TopTag_SF object. More...
 

Detailed Description

@@ -127,7 +131,7 @@

-

Construct a new TopTag_SF object.

+

Construct a new TopTag_SF object.

Parameters
@@ -184,8 +188,8 @@

-

◆ NMerged()

+ +

◆ NMerged()

@@ -199,13 +203,13 @@

- + - + @@ -228,7 +232,7 @@

top_vect

- +
year2016, 2017, 2018
RVec< Particle *> RVec< Particle * >  Ws,
RVec< Particle *> RVec< Particle * >  quarks,
LorentzVector of the reconstructed top jet
WsVector of (pointers to) the W particles
quarksVector of (pointers to) the non-top quark particles
GPTGenParticleTree object with particles already added to tree.
GPTGenParticleTree object with particles already added to tree.
@@ -245,7 +249,7 @@

diff --git a/docs/class_top_tag_d_a_k8___s_f-members.html b/docs/class_top_tag_d_a_k8___s_f-members.html index 674f747..ef100e8 100644 --- a/docs/class_top_tag_d_a_k8___s_f-members.html +++ b/docs/class_top_tag_d_a_k8___s_f-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

std::vector< float > eval (float pt) - Lookup the scale factor and variations based on the AK8 jet momentum. Returned values are absolute {nominal, up, down}. More...
+ Lookup the scale factor and variations based on the AK8 jet momentum. Returned values are absolute {nominal, up, down}. More...
   TopTagDAK8_SF (int year, std::string workingpoint, bool massDecorr) - Construct a new TopTagDAK8_SF object. More...
+ Construct a new TopTagDAK8_SF object. More...
 

Detailed Description

@@ -123,7 +127,7 @@

-

Construct a new TopTagDAK8_SF object.

+

Construct a new TopTagDAK8_SF object.

Parameters
@@ -172,7 +176,7 @@

diff --git a/docs/class_trigger__weight-members.html b/docs/class_trigger__weight-members.html index 2cf36c8..cea90ef 100644 --- a/docs/class_trigger__weight-members.html +++ b/docs/class_trigger__weight-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

year

- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

RVec< float > eval (float var, float plateau=0) - Evaluates the efficiency as a weight for the provided value, var. Also calculates variations of the weight with uncertainties calculated as one half of the trigger inefficiency. More...
+ Evaluates the efficiency as a weight for the provided value, var. Also calculates variations of the weight with uncertainties calculated as one half of the trigger inefficiency. More...
   Trigger_weight (std::string filename, std::string histname) - Construct a new Trigger_weight object. More...
+ Construct a new Trigger_weight object. More...
 

Detailed Description

@@ -119,7 +123,7 @@

-

Construct a new Trigger_weight object.

+

Construct a new Trigger_weight object.

Parameters
@@ -178,7 +182,7 @@

diff --git a/docs/class_weight_calculator_from_histogram-members.html b/docs/class_weight_calculator_from_histogram-members.html index 0b6090b..6d8bf58 100644 --- a/docs/class_weight_calculator_from_histogram-members.html +++ b/docs/class_weight_calculator_from_histogram-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

filename

- + +/* @license-end */ - + +/* @license-end */
float getWeightErr (float x, float y=0) const   -WeightCalculatorFromHistogram (TH1 *histogram, bool verbose=false) -   WeightCalculatorFromHistogram (TH1 *hist, TH1 *targethist, bool norm=true, bool fixLargeWeights=true, bool verbose=false)   +WeightCalculatorFromHistogram (TH1 *histogram, bool verbose=false) + 
The documentation for this class was generated from the following files:
  • TIMBER/Framework/ext/WeightCalculatorFromHistogram.h
  • @@ -100,7 +104,7 @@ diff --git a/docs/class_wtag___s_f-members.html b/docs/class_wtag___s_f-members.html index 7c52766..83e4470 100644 --- a/docs/class_wtag___s_f-members.html +++ b/docs/class_wtag___s_f-members.html @@ -1,9 +1,9 @@ - + - + TIMBER: Member List @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */ - + +/* @license-end */

Public Member Functions

ROOT::VecOps::RVec< float > eval (float tau21) - Get the scale factor for a given tau21 value. More...
+ Get the scale factor for a given tau21 value. More...
   Wtag_SF (int year) - Construct a new Wtag_SF object. More...
+ Construct a new Wtag_SF object. More...
 

Detailed Description

@@ -154,7 +158,7 @@

diff --git a/docs/common_8h_source.html b/docs/common_8h_source.html index 5b32c9a..8f53acb 100644 --- a/docs/common_8h_source.html +++ b/docs/common_8h_source.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework/include/common.h Source File @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@

- + +/* @license-end */
common.h
-
1 #ifndef _TIMBER_COMMON
2 #define _TIMBER_COMMON
3 
4 #include <fstream>
5 #include <string>
6 #include <iostream>
7 #include <sstream>
8 #include <algorithm>
9 #include <iterator>
10 #include <vector>
11 #include <stdexcept>
12 #include <boost/filesystem.hpp>
13 
14 #include <cmath>
15 #include <cstdlib>
16 #include <ROOT/RVec.hxx>
17 #include <TMath.h>
18 #include <TFile.h>
19 #include <TH1.h>
20 #include <Math/GenVector/LorentzVector.h>
21 #include <Math/GenVector/PtEtaPhiM4D.h>
22 #include <Math/Vector4Dfwd.h>
23 
24 using namespace ROOT::VecOps;
29 namespace hardware {
38  TFile *Open(std::string file, const char *option = "READ");
47  TH1 *LoadHist(std::string filename, std::string histname);
55  RVec<float> HadamardProduct(RVec<float> v1, RVec<float> v2);
66  RVec<float> HadamardProduct(RVec<float> v1, RVec<RVec<float>> v2, int v2subindex);
77  RVec<float> MultiHadamardProduct(RVec<float> v1, RVec<RVec<RVec<float>>> Multiv2, int v2subindex);
85  float DeltaPhi(float phi1,float phi2);
93  float DeltaR(ROOT::Math::PtEtaPhiMVector v1, ROOT::Math::PtEtaPhiMVector v2);
101  template<class T1, class T2>
102  float DeltaR(T1 in1, T2 in2) {
103  ROOT::Math::PtEtaPhiMVector v1(in1.pt, in1.eta, in1.phi, in1.mass);
104  ROOT::Math::PtEtaPhiMVector v2(in2.pt, in2.eta, in2.phi, in2.mass);
105  float deta = v1.Eta()-v2.Eta();
106  float dphi = DeltaPhi(v1.Phi(),v2.Phi());
107  return sqrt(deta*deta+dphi*dphi);
108  }
118  ROOT::Math::PtEtaPhiMVector TLvector(float pt,float eta,float phi,float m);
128  RVec<ROOT::Math::PtEtaPhiMVector> TLvector(RVec<float> pt,RVec<float> eta,RVec<float> phi,RVec<float> m);
135  template<class T>
136  ROOT::Math::PtEtaPhiMVector TLvector(T obj) {
137  ROOT::Math::PtEtaPhiMVector v (obj.pt, obj.eta, obj.phi, obj.mass);
138  return v;
139  }
146  template<class T>
147  RVec<ROOT::Math::PtEtaPhiMVector> TLvector(std::vector<T> objs) {
148  RVec<ROOT::Math::PtEtaPhiMVector> vs;
149  vs.reserve(objs.size());
150  for (size_t i = 0; i < objs.size(); i++) {
151  vs.emplace_back(objs[i].pt, objs[i].eta, objs[i].phi, objs[i].mass);
152  }
153  return vs;
154  }
155 
166  float TransverseMass(float MET_pt, float obj_pt, float MET_phi, float obj_phi);
176  double InvariantMass(RVec<ROOT::Math::PtEtaPhiMVector> vects);
183  template <class T>
184  RVec<RVec<T>> Transpose(RVec<RVec<T>> v) {
185  if (v.size() == 0) {
186  return RVec<RVec<T>> (0);
187  } else {
188  RVec<RVec<T>> out;
189  for (int i = 0; i < v[0].size(); i++) {
190  RVec<T> inner;
191  for (int j = 0; j < v.size(); j++) {
192  inner.push_back(v[j][i]);
193  }
194  out.push_back(inner);
195  }
196  return out;
197  }
198  }
199 }
200 
201 namespace Pythonic {
212  template <typename IntType>
213  std::vector<IntType> Range(IntType start, IntType stop, IntType step) {
214  if (step == IntType(0)) {
215  throw std::invalid_argument("step for range must be non-zero");
216  }
217 
218  std::vector<IntType> result;
219  IntType i = start;
220  while ((step > 0) ? (i < stop) : (i > stop)) {
221  result.push_back(i);
222  i += step;
223  }
224 
225  return result;
226  }
227 
237  template <typename IntType>
238  std::vector<IntType> Range(IntType start, IntType stop) {
239  return Range(start, stop, IntType(1));
240  }
241 
250  template <typename IntType>
251  std::vector<IntType> Range(IntType stop) {
252  return Range(IntType(0), stop, IntType(1));
253  }
254 
264  std::vector<std::string> Split(const std::string& str, char delim = ' ');
265 
266  // Personal
275  template<typename T>
276  int InList(T obj, std::vector<T> list) {
277  int out;
278  auto pos = std::find(std::begin(list), std::end(list), obj);
279  if (pos != std::end(list)){
280  out = pos - std::begin(list);
281  } else {out = -1;}
282  return out;
283  }
284 
293  bool InString(std::string sub, std::string main);
294 
302  template<typename T>
303  void Extend(std::vector<T> base, std::vector<T> extension) {
304  for (int i = 0; i < extension.size(); i++) {
305  base.push_back(extension.at(i));
306  }
307  }
308 
316  bool IsDir(char* dirname);
322  void Execute(std::string cmd);
323 }
324 
333 std::string ReadTarFile(std::string tarname, std::string internalFile);
334 
338 class TempDir {
339  private:
340  const boost::filesystem::path _path;
341  std::vector<std::string> _filesSaved;
342 
343  public:
348  TempDir();
353  ~TempDir();
362  std::string Write(std::string filename, std::string in);
368  std::string Hash();
369 
370 };
371 #endif
TH1 * LoadHist(std::string filename, std::string histname)
Generically open a histogram from a file into memory (closing the file in the process).
Definition: common.cc:9
-
TFile * Open(std::string file, const char *option="READ")
Open a ROOT file inside the TIMBER path. Thsi function essentially just does the char + string format...
Definition: common.cc:5
-
C++ namespace for common physics functions.
-
float DeltaR(ROOT::Math::PtEtaPhiMVector v1, ROOT::Math::PtEtaPhiMVector v2)
Calculate between two vectors.
Definition: common.cc:55
-
RVec< float > HadamardProduct(RVec< float > v1, RVec< float > v2)
Hadamard product of two vectors (v3[i] = v1[i]*v2[i])
Definition: common.cc:17
-
double InvariantMass(RVec< ROOT::Math::PtEtaPhiMVector > vects)
Calculates the invariant mass of a vector of Lorentz vectors (ROOT::Math::PtEtaPhiMVector). Note that this is an alternative to ROOT::VecOps::InvariantMasses() which does not need the intermediate Lorentz vector.
Definition: common.cc:78
-
RVec< RVec< T > > Transpose(RVec< RVec< T >> v)
Transpose a vector so that output[j][i] = input[i][j].
Definition: common.h:184
- -
float DeltaPhi(float phi1, float phi2)
Calculate the difference in .
Definition: common.cc:48
-
Definition: common.h:201
-
C++ class. Creates a temporary directory that is destroyed on delete.
Definition: common.h:338
-
RVec< float > MultiHadamardProduct(RVec< float > v1, RVec< RVec< RVec< float >>> Multiv2, int v2subindex)
Hadamard product of a base vector and a list of N more vectors (vout[i] = v1[i]*v2[i][v2subindex]*v3[...
Definition: common.cc:35
-
ROOT::Math::PtEtaPhiMVector TLvector(float pt, float eta, float phi, float m)
Create a ROOT::Math::PtEtaPhiMVector.
Definition: common.cc:61
-
float TransverseMass(float MET_pt, float obj_pt, float MET_phi, float obj_phi)
Calculate the transverse mass from MET and and an object&#39;s and .
Definition: common.cc:74
+
1 #ifndef _TIMBER_COMMON
+
2 #define _TIMBER_COMMON
+
3 
+
4 #include <fstream>
+
5 #include <string>
+
6 #include <iostream>
+
7 #include <sstream>
+
8 #include <algorithm>
+
9 #include <iterator>
+
10 #include <vector>
+
11 #include <stdexcept>
+
12 #include <boost/filesystem.hpp>
+
13 
+
14 #include <cmath>
+
15 #include <cstdlib>
+
16 #include <ROOT/RVec.hxx>
+
17 #include <TMath.h>
+
18 #include <TFile.h>
+
19 #include <TH1.h>
+
20 #include <Math/GenVector/LorentzVector.h>
+
21 #include <Math/GenVector/PtEtaPhiM4D.h>
+
22 #include <Math/Vector4Dfwd.h>
+
23 
+
24 using namespace ROOT::VecOps;
+
29 namespace hardware {
+
39  TFile *Open(std::string file, bool inTIMBER = true, const char *option = "READ");
+
49  TH1 *LoadHist(std::string filename, std::string histname, bool inTIMBER = true);
+
57  RVec<float> HadamardProduct(RVec<float> v1, RVec<float> v2);
+
68  RVec<float> HadamardProduct(RVec<float> v1, RVec<RVec<float>> v2, int v2subindex);
+
76  RVec<float> MultiHadamardProduct(RVec<float> v1, RVec<RVec<float>> Multiv2);
+
87  RVec<float> MultiHadamardProduct(RVec<float> v1, RVec<RVec<RVec<float>>> Multiv2, int v2subindex);
+
95  float DeltaPhi(float phi1,float phi2);
+
103  float DeltaR(ROOT::Math::PtEtaPhiMVector v1, ROOT::Math::PtEtaPhiMVector v2);
+
111  template<class T1, class T2>
+
112  float DeltaR(T1 in1, T2 in2) {
+
113  ROOT::Math::PtEtaPhiMVector v1(in1.pt, in1.eta, in1.phi, in1.mass);
+
114  ROOT::Math::PtEtaPhiMVector v2(in2.pt, in2.eta, in2.phi, in2.mass);
+
115  float deta = v1.Eta()-v2.Eta();
+
116  float dphi = DeltaPhi(v1.Phi(),v2.Phi());
+
117  return sqrt(deta*deta+dphi*dphi);
+
118  }
+
128  ROOT::Math::PtEtaPhiMVector TLvector(float pt,float eta,float phi,float m);
+
138  RVec<ROOT::Math::PtEtaPhiMVector> TLvector(RVec<float> pt,RVec<float> eta,RVec<float> phi,RVec<float> m);
+
145  template<class T>
+
146  ROOT::Math::PtEtaPhiMVector TLvector(T obj) {
+
147  ROOT::Math::PtEtaPhiMVector v (obj.pt, obj.eta, obj.phi, obj.mass);
+
148  return v;
+
149  }
+
156  template<class T>
+
157  RVec<ROOT::Math::PtEtaPhiMVector> TLvector(std::vector<T> objs) {
+
158  RVec<ROOT::Math::PtEtaPhiMVector> vs;
+
159  vs.reserve(objs.size());
+
160  for (size_t i = 0; i < objs.size(); i++) {
+
161  vs.emplace_back(objs[i].pt, objs[i].eta, objs[i].phi, objs[i].mass);
+
162  }
+
163  return vs;
+
164  }
+
165 
+
176  float TransverseMass(float MET_pt, float obj_pt, float MET_phi, float obj_phi);
+
186  double InvariantMass(RVec<ROOT::Math::PtEtaPhiMVector> vects);
+
193  template <class T>
+
194  RVec<RVec<T>> Transpose(RVec<RVec<T>> v) {
+
195  if (v.size() == 0) {
+
196  return RVec<RVec<T>> (0);
+
197  } else {
+
198  RVec<RVec<T>> out;
+
199  for (int i = 0; i < v[0].size(); i++) {
+
200  RVec<T> inner;
+
201  for (int j = 0; j < v.size(); j++) {
+
202  inner.push_back(v[j][i]);
+
203  }
+
204  out.push_back(inner);
+
205  }
+
206  return out;
+
207  }
+
208  }
+
209 }
+
210 
+
211 namespace Pythonic {
+
222  template <typename IntType>
+
223  std::vector<IntType> Range(IntType start, IntType stop, IntType step) {
+
224  if (step == IntType(0)) {
+
225  throw std::invalid_argument("step for range must be non-zero");
+
226  }
+
227 
+
228  std::vector<IntType> result;
+
229  IntType i = start;
+
230  while ((step > 0) ? (i < stop) : (i > stop)) {
+
231  result.push_back(i);
+
232  i += step;
+
233  }
+
234 
+
235  return result;
+
236  }
+
237 
+
247  template <typename IntType>
+
248  std::vector<IntType> Range(IntType start, IntType stop) {
+
249  return Range(start, stop, IntType(1));
+
250  }
+
251 
+
260  template <typename IntType>
+
261  std::vector<IntType> Range(IntType stop) {
+
262  return Range(IntType(0), stop, IntType(1));
+
263  }
+
264 
+
274  std::vector<std::string> Split(const std::string& str, char delim = ' ');
+
275 
+
276  // Personal
+
285  template<typename T>
+
286  int InList(T obj, std::vector<T> list) {
+
287  int out;
+
288  auto pos = std::find(std::begin(list), std::end(list), obj);
+
289  if (pos != std::end(list)){
+
290  out = pos - std::begin(list);
+
291  } else {out = -1;}
+
292  return out;
+
293  }
+
294 
+
303  bool InString(std::string sub, std::string main);
+
304 
+
312  template<typename T>
+
313  void Extend(std::vector<T> base, std::vector<T> extension) {
+
314  for (int i = 0; i < extension.size(); i++) {
+
315  base.push_back(extension.at(i));
+
316  }
+
317  }
+
318 
+
326  bool IsDir(char* dirname);
+
332  void Execute(std::string cmd);
+
333 }
+
334 
+
343 std::string ReadTarFile(std::string tarname, std::string internalFile);
+
344 
+
348 class TempDir {
+
349  private:
+
350  const boost::filesystem::path _path;
+
351  std::vector<std::string> _filesSaved;
+
352 
+
353  public:
+
358  TempDir();
+
363  ~TempDir();
+
372  std::string Write(std::string filename, std::string in);
+
378  std::string Hash();
+
379 
+
380 };
+
381 #endif
+
TFile * Open(std::string file, bool inTIMBER=true, const char *option="READ")
Open a ROOT file inside the TIMBER path. Thsi function essentially just does the char + string format...
Definition: common.cc:5
+
RVec< RVec< T > > Transpose(RVec< RVec< T >> v)
Transpose a vector so that output[j][i] = input[i][j].
Definition: common.h:194
+
TH1 * LoadHist(std::string filename, std::string histname, bool inTIMBER=true)
Generically open a histogram from a file into memory (closing the file in the process).
Definition: common.cc:13
+
C++ class. Creates a temporary directory that is destroyed on delete.
Definition: common.h:348
+
float DeltaPhi(float phi1, float phi2)
Calculate the difference in .
Definition: common.cc:65
+
float DeltaR(ROOT::Math::PtEtaPhiMVector v1, ROOT::Math::PtEtaPhiMVector v2)
Calculate between two vectors.
Definition: common.cc:72
+
RVec< float > MultiHadamardProduct(RVec< float > v1, RVec< RVec< float >> Multiv2)
Hadamard product of a base vector and a list of N more vectors (vout[i] = v1[i]*v2[i]*v3[i]....
Definition: common.cc:39
+
RVec< float > HadamardProduct(RVec< float > v1, RVec< float > v2)
Hadamard product of two vectors (v3[i] = v1[i]*v2[i])
Definition: common.cc:21
+
ROOT::Math::PtEtaPhiMVector TLvector(float pt, float eta, float phi, float m)
Create a ROOT::Math::PtEtaPhiMVector.
Definition: common.cc:78
+
C++ namespace for common physics functions.
diff --git a/docs/dir_16d9e443a39e4d4bfc6fd05dcfa96ec2.html b/docs/dir_16d9e443a39e4d4bfc6fd05dcfa96ec2.html index 83cb82f..f8afa4c 100644 --- a/docs/dir_16d9e443a39e4d4bfc6fd05dcfa96ec2.html +++ b/docs/dir_16d9e443a39e4d4bfc6fd05dcfa96ec2.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER/Framework Directory Reference @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */ - + +/* @license-end */

Directories

+directory  data +  directory  Framework   @@ -87,7 +93,7 @@ diff --git a/docs/dir_fa831c2f115bbdef41b4043b3bad12cb.html b/docs/dir_fa831c2f115bbdef41b4043b3bad12cb.html index 02bcb4b..c3108c2 100644 --- a/docs/dir_fa831c2f115bbdef41b4043b3bad12cb.html +++ b/docs/dir_fa831c2f115bbdef41b4043b3bad12cb.html @@ -1,9 +1,9 @@ - + - + TIMBER: bin/libarchive/include Directory Reference @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */ - + +/* @license-end */
@@ -73,11 +77,42 @@

This page explains how to interpret the graphs that are generated by doxygen.

-

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };
/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };
/* Class not documented with doxygen comments */
class Undocumented { };
/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };
/*! A template class */
template<class T> class Templ { };
/*! Class that is inherited using protected inheritance */
class ProtectedBase { };
/*! Class that is inherited using private inheritance */
class PrivateBase { };
/*! Class that is used by the Inherited class */
class Used { };
/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
protected ProtectedBase,
private PrivateBase,
public Undocumented,
public Templ<int>
{
private:
Used *m_usedClass;
};

This will result in the following graph:

-
- -
-

The boxes in the above graph have the following meaning:

+

Consider the following example:

/*! Invisible class because of truncation */
+
class Invisible { };
+
+
/*! Truncated class, inheritance relation is hidden */
+
class Truncated : public Invisible { };
+
+
/* Class not documented with doxygen comments */
+
class Undocumented { };
+
+
/*! Class that is inherited using public inheritance */
+
class PublicBase : public Truncated { };
+
+
/*! A template class */
+
template<class T> class Templ { };
+
+
/*! Class that is inherited using protected inheritance */
+
class ProtectedBase { };
+
+
/*! Class that is inherited using private inheritance */
+
class PrivateBase { };
+
+
/*! Class that is used by the Inherited class */
+
class Used { };
+
+
/*! Super class that inherits a number of other classes */
+
class Inherited : public PublicBase,
+
protected ProtectedBase,
+
private PrivateBase,
+
public Undocumented,
+
public Templ<int>
+
{
+
private:
+
Used *m_usedClass;
+
};
+

This will result in the following graph:

+

The boxes in the above graph have the following meaning:

  • A filled gray box represents the struct or class for which the graph is generated.
  • @@ -106,7 +141,7 @@ diff --git a/docs/graph_legend.md5 b/docs/graph_legend.md5 index a06ed05..8fcdccd 100644 --- a/docs/graph_legend.md5 +++ b/docs/graph_legend.md5 @@ -1 +1 @@ -387ff8eb65306fa251338d3c9bd7bfff \ No newline at end of file +f51bf6e9a10430aafef59831b08dcbfe \ No newline at end of file diff --git a/docs/graph_legend.png b/docs/graph_legend.png index 81788d8..7e2cbcf 100644 Binary files a/docs/graph_legend.png and b/docs/graph_legend.png differ diff --git a/docs/index.html b/docs/index.html index cd533b0..f0f1ec6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,9 +1,9 @@ - + - + TIMBER: TIMBER @@ -17,7 +17,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -39,18 +40,21 @@
- + +/* @license-end */ @@ -67,41 +71,47 @@ -
+
TIMBER

Full Documentation

TIMBER (Tree Interface for Making Binned Events with RDataFrame) is an easy-to-use and fast python analysis framework used to quickly process CMS data sets. Default arguments assume the use of the NanoAOD format but any ROOT TTree can be processed.

-

Quick install

+

Quick install

Despite the fact that Python 2.7 reached end-of-life on January 1st, 2020, it is still the dominant version used by CMS. If you need CMSSW (ex. for JME modules), Python 2.7 is recommended. Otherwise, please take this opportunity to start using Python 3! Remember to make sure your ROOT version has been built with Python 3 compatibility. For information on how to do this, see this explanation. Though this does not always work consistently when CMSSW code is needed.

Working in a virtual environment is also recommended. Below are the commands for using virtualenv but you're obviously free to use your favorite tool for the job (you can install virtualenv for Python 3 with pip install virtualenv (pip3 for Python 3)).

-
python -m virtualenv timber-env
source timber-env/bin/activate
git clone https://github.com/lcorcodilos/TIMBER.git
cd TIMBER
source setup.sh

Some C++ modules also have the boost library as a dependency. The internet has plenty instructions on how to install boost. The standard apt-get (Ubuntu) and brew (macOS) package managers support install as well.

-

The RDataFrame Backbone

+
python -m virtualenv timber-env
+
source timber-env/bin/activate
+
git clone https://github.com/lcorcodilos/TIMBER.git
+
cd TIMBER
+
source setup.sh
+

Some C++ modules also have the boost library as a dependency. The internet has plenty instructions on how to install boost. The standard apt-get (Ubuntu) and brew (macOS) package managers support install as well.

+

The RDataFrame Backbone

TIMBER's speed comes from the use of ROOT's RDataFrame. RDataFrame offers "multi-threading and other low-level optimisations" which make analysis level processing faster and more efficient than traditional python for loops. However, RDataFrame derives its speed from its C++ back-end and while an RDataFrame object can be instantiated and manipulated in python, any actions on it are written in C++ (even if you're using python).

-

No more for loops

+

No more for loops

Using RDataFrame means a fundamental re-thinking of how we treat a block of data or simulation. Instead of looping over the events or entries of a TTree (or other data format), the TTree is converted into a table called the "data frame". A user then books a number of "lazy" actions on the data frame such as filtering out events or calculating new values. These actions aren't performed though until the data frame needs to be evaluated (ex. you ask to plot a histogram from it).

In this way, there are no more for loops and instead just actions on the data frame table that transform it into a final table of values that the analyzer cares about.

-

Anatomy of a data frame

+

Anatomy of a data frame

Each row of the table is a separate event and each column is a different variable in the event (a branch in TTree terms). Columns can be single values or vectors (specifically ROOT::VecOps:RVec).

Since each row is an event, vectors are necessary for the case of multiple of the same physics object in an event - for example, multiple electrons.

NOTE NanoAOD orders these vectors in \(p_T\) of the objects. So if you'd like the \(\eta\) of the leading electron, it is stored as Electron_eta[0]

This can make accessing values tricky! For example, if there's one electron in an event and the analyzer asks for Electron_eta[1], the computer will return a seg fault. These are the types of problems that TIMBER attempts to solve (even if it's just by users sharing their experiences).

-

Happy Analyzers

+

Happy Analyzers

TIMBER is meant to keep both the processing fast via RDataFrame and the analyzer fast via python scripting.

To maintain python's appeal in HEP as a quick scripting language, TIMBER handles interfacing with RDataFrame so the analyzer can focus on writing their analysis.

TIMBER automates opening one or many ROOT files, calculating the number of events generated (provided the ROOT files are NanoAOD simulation), loading in C++ scripts for use while looping over the data frame, and grouping actions for easy manipulation.

In addition, TIMBER treats each step in the RDataFrame processing as a "node" and keeps track of these nodes as a larger tree. Each action (or group of actions) performed on a node produces another node and nodes store information about their parents or children. This makes it possible to write tools like Nminus1() which takes as input a node and a group of cuts to apply and returns N new nodes, each with every cut but one applied.

Finally, the RDataFrame for each node is always kept easily accessible so that any of the native RDataFrame tools are at the user's fingertips.

-

Sharing is caring

+

Sharing is caring

TIMBER includes a repository of common algorithms used frequently in CMS which access scale factors, calculate pileup weights, and more. These are all written in C++ for use in Cut and Define arguments and are provided so that users have a common tool box to share. Additionally, the AnalysisModules folder welcomes additions of custom C++ modules on a per-analysis basis so that the code can be properly archived for future reference and for sharing with other analyzers.

-
+
+ diff --git a/docs/jquery.js b/docs/jquery.js index f5343ed..103c32d 100644 --- a/docs/jquery.js +++ b/docs/jquery.js @@ -1,71 +1,26 @@ +/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0a;a++)for(i in o[a])n=o[a][i],o[a].hasOwnProperty(i)&&void 0!==n&&(e[i]=t.isPlainObject(n)?t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=s.call(arguments,1),h=this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(h=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):h=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new i(o,this))})),h}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("
"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widthi?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,(i>0||u>a(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var n=!1;t(document).on("mouseup",function(){n=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!n){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,o="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!o&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),n=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t("
"),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,h=this._change[o];return this._updatePrevProperties(),h?(i=h.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,h=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidtht.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("
"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element +},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,h=t(this).resizable("instance"),l=h.options,c=h.element,u=l.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(h.containerElement=t(d),/document/.test(u)||u===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=h._num(e.css("padding"+s))}),h.containerOffset=e.offset(),h.containerPosition=e.position(),h.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,o=h.containerSize.width,a=h._hasScroll(d,"left")?d.scrollWidth:o,r=h._hasScroll(d)?d.scrollHeight:n,h.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?h.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-h.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-h.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,c=h[1]||1,u=Math.round((n.width-o.width)/l)*l,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=h,_&&(p+=l),v&&(f+=c),m&&(p-=l),g&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-l)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-l>0?(i.size.width=p,i.position.left=a.left-u):(p=l-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable});/** + * Copyright (c) 2007 Ariel Flesler - aflesler ○ gmail • com | https://github.com/flesler + * Licensed under MIT + * @author Ariel Flesler + * @version 2.1.2 + */ +;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1=f[g]?0:Math.min(f[g],n));!a&&1)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b40){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bb.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bb.attachEvent("onload",bF.ready);var b0=false;try{b0=bb.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bb.JSON&&bb.JSON.parse){return bb.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(bb.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(bb.execScript||function(b1){bb["eval"].call(bb,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b40&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b21?aJ.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aJ.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv
a";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="
";bM=av.createElement("div");bM.style.cssText=bR+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bQ.insertBefore(bM,bQ.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="
t
";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bJ.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);bv.innerHTML="";bv.style.width=bv.style.paddingLeft="1px";b.boxModel=bJ.boxModel=bv.offsetWidth===2;if(typeof bv.style.zoom!=="undefined"){bv.style.display="inline";bv.style.zoom=1;bJ.inlineBlockNeedsLayout=(bv.offsetWidth===2);bv.style.display="";bv.innerHTML="
";bJ.shrinkWrapBlocks=(bv.offsetWidth!==2)}bv.style.cssText=bS+bR;bv.innerHTML=bP;bU=bv.firstChild;bV=bU.firstChild;bN=bU.nextSibling.firstChild.firstChild;bO={doesNotAddBorder:(bV.offsetTop!==5),doesAddBorderForTableAndCells:(bN.offsetTop===5)};bV.style.position="fixed";bV.style.top="20px";bO.fixedPosition=(bV.offsetTop===20||bV.offsetTop===15);bV.style.position=bV.style.top="";bU.style.overflow="hidden";bU.style.position="relative";bO.subtractsBorderForOverflowNotVisible=(bV.offsetTop===-5);bO.doesNotIncludeMarginInBodyOffset=(bQ.offsetTop!==bL);bQ.removeChild(bM);bv=bM=null;b.extend(bJ,bO)});return bJ})();var aS=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.nodeName.toLowerCase()]||b.valHooks[bw.type];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aU,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType;if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aY:be)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(bx,bz){var by,bA,bv,e,bw=0;if(bz&&bx.nodeType===1){bA=bz.toLowerCase().split(af);e=bA.length;for(;bw=0)}}})});var bd=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/\bhover(\.\S+)?\b/,aO=/^key/,bf=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bb,bI])}}for(bC=0;bCbA){bH.push({elem:this,matches:bz.slice(bA)})}for(bC=0;bC0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aO.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bf.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); -/*! - * Sizzle CSS Selector Engine - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift()}b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1},lt:function(bS,bR,e){return bRe[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodeValue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodeValue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="

";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT0){for(bB=bA;bB=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(C(bx[0])||C(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||a9.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aG(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e)}else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aR.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aR="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ag=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},ac=a(av);ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div
","
"]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this);bv.text(e.call(this,bw,bv.text()))})}if(typeof e!=="object"&&e!==L){return this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(bx){if(bx===L){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ag,""):null}else{if(typeof bx==="string"&&!ae.test(bx)&&(b.support.leadingWhitespace||!ar.test(bx))&&!ax[(d.exec(bx)||["",""])[1].toLowerCase()]){bx=bx.replace(R,"<$1>");try{for(var bw=0,bv=this.length;bw1&&bw0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bg(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function al(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||!ah.test("<"+by.nodeName)?by.cloneNode(true):al(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){ai(by,bz);e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){if(bv[bx]){ai(e[bx],bv[bx])}}}if(bA){t(by,bz);if(bw){e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){t(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bw,by,bH,bA){var bF;by=by||av;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||av}var bI=[],bB;for(var bE=0,bz;(bz=bw[bE])!=null;bE++){if(typeof bz==="number"){bz+=""}if(!bz){continue}if(typeof bz==="string"){if(!W.test(bz)){bz=by.createTextNode(bz)}else{bz=bz.replace(R,"<$1>");var bK=(d.exec(bz)||["",""])[1].toLowerCase(),bx=ax[bK]||ax._default,bD=bx[0],bv=by.createElement("div");if(by===av){ac.appendChild(bv)}else{a(by).appendChild(bv)}bv.innerHTML=bx[1]+bz+bx[2];while(bD--){bv=bv.lastChild}if(!b.support.tbody){var e=w.test(bz),bC=bK==="table"&&!e?bv.firstChild&&bv.firstChild.childNodes:bx[1]===""&&!e?bv.childNodes:[];for(bB=bC.length-1;bB>=0;--bB){if(b.nodeName(bC[bB],"tbody")&&!bC[bB].childNodes.length){bC[bB].parentNode.removeChild(bC[bB])}}}if(!b.support.leadingWhitespace&&ar.test(bz)){bv.insertBefore(by.createTextNode(ar.exec(bz)[0]),bv.firstChild)}bz=bv.childNodes}}var bG;if(!b.support.appendChecked){if(bz[0]&&typeof(bG=bz.length)==="number"){for(bB=0;bB=0){return bx+"px"}}else{return bx}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bv,e){return au.test((e&&bv.currentStyle?bv.currentStyle.filter:bv.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(by,bz){var bx=by.style,bv=by.currentStyle,e=b.isNumeric(bz)?"alpha(opacity="+bz*100+")":"",bw=bv&&bv.filter||bx.filter||"";bx.zoom=1;if(bz>=1&&b.trim(bw.replace(ak,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=ak.test(bw)?bw.replace(ak,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,bv){var e;b.swap(bw,{display:"inline-block"},function(){if(bv){e=Z(bw,"margin-right","marginRight")}else{e=bw.style.marginRight}});return e}}}});if(av.defaultView&&av.defaultView.getComputedStyle){aI=function(by,bw){var bv,bx,e;bw=bw.replace(z,"-$1").toLowerCase();if((bx=by.ownerDocument.defaultView)&&(e=bx.getComputedStyle(by,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(by.ownerDocument.documentElement,by)){bv=b.style(by,bw)}}return bv}}if(av.documentElement.currentStyle){aX=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv===null&&bx&&(by=bx[bw])){bv=by}if(!bc.test(bv)&&bn.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":(bv||0);bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aI||aX;function p(by,bw,bv){var bA=bw==="width"?by.offsetWidth:by.offsetHeight,bz=bw==="width"?an:a1,bx=0,e=bz.length;if(bA>0){if(bv!=="border"){for(;bx)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"":"")+"");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b})}})(window);/*! - * jQuery UI 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */ -(function(a,d){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{e=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(m,l,i,n){a.each(f,function(){l-=parseFloat(a.curCSS(m,"padding"+this,true))||0;if(i){l-=parseFloat(a.curCSS(m,"border"+this+"Width",true))||0}if(n){l-=parseFloat(a.curCSS(m,"margin"+this,true))||0}});return l}a.fn["inner"+e]=function(i){if(i===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,i)+"px")})};a.fn["outer"+e]=function(i,l){if(typeof i!=="number"){return k["outer"+e].call(this,i)}return this.each(function(){a(this).css(h,j(this,i,true,l)+"px")})}});function c(g,e){var j=g.nodeName.toLowerCase();if("area"===j){var i=g.parentNode,h=i.name,f;if(!g.href||!h||i.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(j)?!g.disabled:"a"==j?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(j,f,i,h,e,g){return a.ui.isOverAxis(j,i,e)&&a.ui.isOverAxis(f,h,g)}})})(jQuery);/*! - * jQuery UI Widget 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Widget - */ -(function(b,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],j;f=f.split(".")[1];j=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][j]=function(k){return !!b.data(k,f)};b[g]=b[g]||{};b[g][f]=function(k,l){if(arguments.length){this._createWidget(k,l)}};var i=new h();i.options=b.extend(true,{},i.options);b[g][f].prototype=b.extend(true,i,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:j},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(i){var g=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!g&&h.length?b.extend.apply(null,[true,i].concat(h)):i;if(g&&i.charAt(0)==="_"){return j}if(g){this.each(function(){var k=b.data(this,f),l=k&&b.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==d){j=l;return false}})}else{this.each(function(){var k=b.data(this,f);if(k){k.option(i||{})._init()}else{b.data(this,f,new e(i,this))}})}return j}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,f,g){var j,i,h=this.options[e];g=g||{};f=b.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];i=f.originalEvent;if(i){for(j in i){if(!(j in f)){f[j]=i[j]}}}this.element.trigger(f,g);return !(b.isFunction(h)&&h.call(this.element[0],f,g)===false||f.isDefaultPrevented())}}})(jQuery);/*! - * jQuery UI Mouse 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Mouse - * - * Depends: - * jquery.ui.widget.js - */ -(function(b,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g
');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var j=this.options,i,h,f,k,e;e={minWidth:a(j.minWidth)?j.minWidth:0,maxWidth:a(j.maxWidth)?j.maxWidth:Infinity,minHeight:a(j.minHeight)?j.minHeight:0,maxHeight:a(j.maxHeight)?j.maxHeight:Infinity};if(this._aspectRatio||g){i=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;k=e.maxWidth/this.aspectRatio;if(i>e.minWidth){e.minWidth=i}if(f>e.minHeight){e.minHeight=f}if(hl.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.18"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10)})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);/*! - * jQuery hashchange event - v1.3 - 7/21/2010 - * http://benalman.com/projects/jquery-hashchange-plugin/ - * - * Copyright (c) 2010 "Cowboy" Ben Alman - * Dual licensed under the MIT and GPL licenses. - * http://benalman.com/about/license/ - */ -(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('